/* CSS Variables for Theme Management */
:root {
    --primary-color: #4a90e2;
    --secondary-color: #7b68ee;
    --accent-color: #ff6b6b;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    
    /* Light Theme */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #e9ecef;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --border-color: #dee2e6;
    --shadow: rgba(0, 0, 0, 0.1);
    
    /* Layout */
    --border-radius: 8px;
    --transition: all 0.3s ease;
    --container-width: 1200px;
}

/* Dark Theme */
[data-theme="dark"] {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --bg-tertiary: #404040;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --border-color: #404040;
    --shadow: rgba(0, 0, 0, 0.3);
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Global font rendering improvements */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Chrome-specific font improvements */
body, input, textarea, select, button, pre, code {
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
    text-rendering: optimizeLegibility !important;
    font-smooth: never;
    -webkit-text-stroke: 0.5px transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    transition: var(--transition);
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
    text-rendering: optimizeLegibility !important;
    font-feature-settings: "kern" 1;
    -webkit-text-stroke: 0.5px transparent;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
.header {
    background: #ffffff;
    color: #333333;
    padding: 1rem 0;
    border-bottom: 1px solid #e0e0e0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

.logo h1 i {
    margin-right: 0.5rem;
    color: #ffd700;
}

.logo-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 0.5rem;
    object-fit: cover;
    border: 2px solid #ffd700;
}

.brand-info {
    font-size: 0.9rem;
    opacity: 0.9;
    font-weight: 300;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

.nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav a {
    color: #333333;
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
}

.nav a:hover {
    background-color: #f0f0f0;
    color: var(--primary-color);
}

.theme-toggle {
    background: #f0f0f0;
    border: 2px solid #e0e0e0;
    color: #333333;
    padding: 0.5rem;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    background-color: var(--primary-color);
    color: white;
    transform: rotate(180deg);
}

/* Hero Section */
.hero {
    background: #f8f9fa;
    padding: 4rem 0;
    text-align: center;
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #333333;
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    flex-wrap: wrap;
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Section Styles */
.playground, .api-section, .resources {
    padding: 4rem 0;
}

.playground h2, .api-section h2, .resources h2 {
    text-align: center;
    font-size: 2.2rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.section-desc {
    text-align: center;
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 3rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.section-desc code {
    background: var(--bg-tertiary);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

/* Elements Grid */
.elements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.element-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    transition: var(--transition);
    position: relative;
}

.element-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px var(--shadow);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.card-header h3 {
    color: var(--primary-color);
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.hint-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.8rem;
}

.hint-btn:hover {
    background: var(--secondary-color);
    transform: scale(1.1);
}

.hint-btn.active {
    background: var(--accent-color);
}

.element-demo {
    margin-bottom: 1rem;
}

.element-demo input, .element-demo select, .element-demo button {
    width: 100%;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 1rem;
    transition: var(--transition);
}

.element-demo input:focus, .element-demo select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.element-demo button {
    background: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    font-weight: 500;
}

.element-demo button:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

.element-demo button:disabled {
    background: var(--text-secondary);
    cursor: not-allowed;
    transform: none;
}

.element-demo label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
}

.element-demo input[type="checkbox"], 
.element-demo input[type="radio"] {
    width: auto;
    margin: 0;
}

.element-demo a {
    color: var(--primary-color);
    text-decoration: none;
    margin-right: 1rem;
    padding: 0.5rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.element-demo a:hover {
    background: var(--bg-tertiary);
}

/* Drag and Drop Styles */
.drag-container {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
}

#draggable {
    background: var(--primary-color);
    color: white;
    padding: 1rem;
    border-radius: var(--border-radius);
    cursor: move;
    user-select: none;
    transition: var(--transition);
}

#draggable:hover {
    background: var(--secondary-color);
}

#dropzone {
    border: 2px dashed var(--border-color);
    padding: 1rem;
    border-radius: var(--border-radius);
    text-align: center;
    color: var(--text-secondary);
    transition: var(--transition);
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#dropzone.drag-over {
    border-color: var(--primary-color);
    background: rgba(74, 144, 226, 0.1);
}

/* Login Form Styles */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.login-form input {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 1rem;
}

.login-form input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.login-form button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
}

.login-form button:hover {
    background: var(--secondary-color);
}

#login-result {
    margin-top: 0.5rem;
    padding: 0.5rem;
    border-radius: var(--border-radius);
    font-weight: 500;
}

/* Shadow DOM Styles */
#shadow-host {
    padding: 1rem;
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius);
    text-align: center;
}

#shadow-host button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    margin-bottom: 1rem;
    transition: var(--transition);
}

#shadow-host button:hover {
    background: var(--secondary-color);
}

#shadow-status {
    color: var(--text-secondary);
    font-style: italic;
}

/* iFrame Styles */
.iframe-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.iframe-container h4 {
    color: var(--primary-color);
    margin: 0.5rem 0;
    font-size: 1rem;
}

.iframe-container iframe {
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--bg-primary);
    width: 100%;
    min-height: 100px;
}

/* New Feature Styles */

/* Image Container for Broken Images */
.image-container {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.image-container img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border: 2px solid transparent;
    border-radius: var(--border-radius);
}

/* Challenging DOM Styles */
.challenging-buttons {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.btn-primary, .btn-secondary, .btn-tertiary {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-tertiary {
    background: var(--accent-color);
    color: white;
}

.btn-primary:hover, .btn-secondary:hover, .btn-tertiary:hover {
    opacity: 0.8;
    transform: translateY(-1px);
}

/* Table Styles */
#challenging-table, #table1 {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

#challenging-table th, #challenging-table td,
#table1 th, #table1 td {
    border: 1px solid var(--border-color);
    padding: 0.75rem;
    text-align: left;
}

#challenging-table th, #table1 th {
    background: var(--bg-tertiary);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

#challenging-table th:hover, #table1 th:hover {
    background: var(--primary-color);
    color: white;
}

/* Menu Items for Disappearing Elements */
.menu-items {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.menu-items a {
    color: var(--primary-color);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.menu-items a:hover {
    background: var(--primary-color);
    color: white;
}

/* Drag Columns */
.drag-column {
    width: 100px;
    height: 100px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: bold;
    cursor: move;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.drag-column:hover {
    background: var(--primary-color);
    color: white;
}

/* Control Groups for Dynamic Controls */
.control-group {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.control-group input {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--bg-primary);
    color: var(--text-primary);
}

.control-group button {
    padding: 0.5rem 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
}

.control-group button:hover {
    background: var(--secondary-color);
}

/* Hover Items */
.hover-items {
    display: flex;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
}

.figure {
    position: relative;
    text-align: center;
}

.figure img {
    width: 100px;
    height: 100px;
    border-radius: var(--border-radius);
}

.figcaption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.5rem;
    opacity: 0;
    transition: var(--transition);
    border-radius: 0 0 var(--border-radius) var(--border-radius);
}

.figure:hover .figcaption {
    opacity: 1;
}

.figcaption h5 {
    margin: 0 0 0.25rem 0;
    font-size: 0.9rem;
}

.figcaption a {
    color: #4a90e2;
    text-decoration: none;
    font-size: 0.8rem;
}

/* Slider Styles */
#slider {
    width: 100%;
    margin: 1rem 0;
}

#slider-value {
    display: inline-block;
    margin-left: 1rem;
    font-weight: bold;
    color: var(--primary-color);
}

/* Form Styles */
form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 300px;
}

form input {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--bg-primary);
    color: var(--text-primary);
}

form button {
    padding: 0.75rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}

form button:hover {
    background: var(--secondary-color);
}

/* Flash Message */
#flash-message {
    margin-top: 1rem;
}

/* Editor Toolbar */
.editor-toolbar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.editor-toolbar button {
    width: 30px;
    height: 30px;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    cursor: pointer;
    border-radius: var(--border-radius);
    font-weight: bold;
    transition: var(--transition);
}

.editor-toolbar button:hover {
    background: var(--primary-color);
    color: white;
}

/* Content Row */
.content-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.content-row img {
    width: 100px;
    height: 100px;
    border-radius: var(--border-radius);
}

/* Loading Styles */
#loading-spinner {
    text-align: center;
    padding: 2rem;
    color: var(--primary-color);
    font-weight: bold;
}

#finish-text {
    text-align: center;
    padding: 2rem;
    color: var(--success-color);
    font-weight: bold;
    font-size: 1.2rem;
}

/* Tooltip Styles */
.code-tooltip {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1rem;
    margin-top: 1rem;
    transition: var(--transition);
    box-shadow: 0 2px 8px var(--shadow);
    max-height: 400px;
    overflow-y: auto;
}

.code-tooltip.show {
    display: block !important;
}

.code-section {
    margin-bottom: 1rem;
}

.code-section:last-child {
    margin-bottom: 0;
}

.code-section h4 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.code-tooltip pre {
    background: var(--bg-tertiary);
    padding: 1rem;
    border-radius: var(--border-radius);
    overflow-x: auto;
    font-size: 0.85rem;
    margin: 0;
}

.code-tooltip code {
    font-family: 'Courier New', monospace;
}

/* API Section Styles */
.api-section {
    background: var(--bg-secondary);
}

.api-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
}

.api-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    transition: var(--transition);
}

.api-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px var(--shadow);
}

.api-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.method {
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

.method.get {
    background: #333333;
    color: white;
    border: 1px solid #555555;
}

.method.post {
    background: #333333;
    color: white;
    border: 1px solid #555555;
}

.method.put {
    background: #333333;
    color: white;
    border: 1px solid #555555;
}

.method.delete {
    background: #333333;
    color: white;
    border: 1px solid #555555;
}

.endpoint {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    font-weight: 600;
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

.api-example {
    margin: 1rem 0;
}

.api-example h4 {
    color: #333333;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

.api-example pre {
    background: var(--bg-tertiary);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    overflow-x: auto;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    line-height: 1.6;
    border: 1px solid var(--border-color);
    white-space: pre-wrap;
    word-break: break-word;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
    text-rendering: optimizeLegibility !important;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    font-weight: 500;
    letter-spacing: 0.02em;
    -webkit-text-stroke: 0.5px transparent;
}

.api-card button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
    width: 100%;
}

.api-card button:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

/* Contact Section */
.contact {
    padding: 4rem 0;
    background: var(--bg-secondary);
}

.contact-content {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.contact-info h3 {
    color: var(--primary-color);
    font-size: 2rem;
    margin-bottom: 1rem;
}

.contact-info p {
    color: var(--text-primary);
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.contact-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 2rem;
}

.contact-links a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    padding: 1rem 2rem;
    border: 2px solid var(--primary-color);
    border-radius: var(--border-radius);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.contact-links a:hover {
    background: var(--primary-color);
    color: white;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: var(--text-primary);
}

.modal-header button {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
}

.modal-header button:hover {
    color: var(--danger-color);
}

.modal-body {
    padding: 1.5rem;
}

.modal-body input {
    width: 100%;
    padding: 0.75rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.modal-body button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
}

.modal-body button:hover {
    background: var(--secondary-color);
}

/* Footer */
.footer {
    background: var(--bg-tertiary);
    text-align: center;
    padding: 2rem 0;
    margin-top: 4rem;
    border-top: 1px solid var(--border-color);
}

.footer p {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
}

.footer-main {
    text-align: center;
}

.footer-contact {
    text-align: center;
}

.footer-contact p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
    background: rgba(74, 144, 226, 0.1);
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .nav {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .hero h2 {
        font-size: 2rem;
    }
    
    .hero-stats {
        gap: 1.5rem;
    }
    
    .elements-grid {
        grid-template-columns: 1fr;
    }
    
    .api-grid {
        grid-template-columns: 1fr;
    }
    
    .drag-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .hint-btn {
        align-self: flex-end;
    }
    
    /* Mobile styles for new elements */
    .challenging-buttons {
        flex-direction: column;
    }
    
    .menu-items {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .hover-items {
        flex-direction: column;
        align-items: center;
    }
    
    .control-group {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .content-row {
        flex-direction: column;
        text-align: center;
    }
    
    #challenging-table, #table1 {
        font-size: 0.8rem;
    }
    
    form {
        max-width: 100%;
    }
    
    /* Footer mobile styles */
    .footer-links {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }
    
    .footer-links a {
        width: 200px;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .element-card, .api-card, .resource-card {
        padding: 1rem;
    }
    
    .modal-content {
        width: 95%;
        margin: 10px;
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--border-color);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Syntax Highlighting Overrides */
code[class*="language-"],
pre[class*="language-"] {
    color: var(--text-primary) !important;
    background: var(--bg-tertiary) !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
    text-rendering: optimizeLegibility !important;
    font-weight: 500;
    letter-spacing: 0.02em;
    -webkit-text-stroke: 0.5px transparent;
}

.token.string,
.token.attr-value {
    color: var(--success-color) !important;
}

.token.number {
    color: var(--warning-color) !important;
}

.token.keyword {
    color: var(--primary-color) !important;
}

.token.comment {
    color: var(--text-secondary) !important;
} 