/* ================================
   CSS VARIABLES & THEME SYSTEM
   ================================ */

:root {
    /* Light Theme (Default) */
    --primary: #8b5cf6;
    --primary-dark: #1d4ed8;
    --secondary: #10b981;
    --accent: #8b5cf6;
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #e2e8f0;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --border: #e2e8f0;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --code-bg: #1e293b;
    --code-text: #10b981;
    --sidebar-width: 300px;
    --header-height: auto;
    --shadow: rgba(0, 0, 0, 0.1);
    --shadow-lg: rgba(0, 0, 0, 0.15);
    --card-bg: #ffffff;
    --navbar-bg: #ffffff;
    --footer-bg: #f8fafc;
}

/* Dark Theme */
[data-theme="dark"] {
    --primary: #8b5cf6;
    --primary-dark: #2563eb;
    --secondary: #10b981;
    --accent: #a78bfa;
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --border: #334155;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --code-bg: #1e293b;
    --code-text: #10b981;
    --shadow: rgba(0, 0, 0, 0.3);
    --shadow-lg: rgba(0, 0, 0, 0.5);
    --card-bg: #1e293b;
    --navbar-bg: #1e293b;
    --footer-bg: #1e293b;
}

/* ================================
   GLOBAL STYLES
   ================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 
         'Helvetica Neue', Arial, sans-serif;
    font-weight: 500;
    letter-spacing: -0.01em;
    line-height: 1.6;
    background: var(--bg-primary);
    min-height: 100vh;
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}



.light-label {
    color: #f59e0b;
    transition: color 0.3s ease;
}

.dark-label {
    color: #8b5cf6;
    transition: color 0.3s ease;
}

[data-theme="dark"] .light-label {
    color: var(--text-secondary);
}

[data-theme="dark"] .dark-label {
    color: var(--primary);
}

/* ================================
   CONTAINER & LAYOUT
   ================================ */

.container {
    max-width: 100%;
    margin: 0 auto;
    background: var(--bg-primary);
    overflow-x: hidden;
    width: 100%;
}

/* ================================
   HERO CAROUSEL SECTION
   ================================ */

.hero-carousel-container {
    position: relative;
    margin: 30px 20px 20px;
    height: 400px;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 20px 60px var(--shadow-lg);
    border: 2px solid var(--border);
}

.hero-carousel {
    position: relative;
    width: 100%;
    height: 100%;
}

.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.8s ease, visibility 0.8s ease;
    background: linear-gradient(135deg,
        rgba(139, 92, 246, 0.95),
        rgba(59, 130, 246, 0.95),
        rgba(16, 185, 129, 0.95)
    );
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 40px;
}

.hero-slide.active {
    opacity: 1;
    visibility: visible;
    z-index: 1;
}

.slide-content {
    text-align: center;
    color: white;
    z-index: 2;
    position: relative;
    max-width: 700px;
    animation: slideContentFadeIn 0.8s ease;
    padding-bottom: 60px; /* Adjust this line */
}

@keyframes slideContentFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-icon {
    font-size: 3rem; /* Reduced from 4rem */
    margin-bottom: 10px; /* Reduced from 20px to pull content up */
    margin-top: 20px; /* Add this to push icon down */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 90px; /* Reduced from 120px */
    height: 90px; /* Reduced from 120px */
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    backdrop-filter: blur(10px);
    border: 3px solid rgba(255, 255, 255, 0.3);
    animation: iconFloat 3s ease-in-out infinite;
}

@keyframes iconFloat {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

.slide-icon i {
    color: white;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.slide-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 15px;
    text-shadow: 2px 4px 12px rgba(0, 0, 0, 0.3);
    letter-spacing: -0.02em;
}

.slide-description {
    font-size: 1.25rem;
    margin-bottom: 30px;
    opacity: 0.95;
    line-height: 1.6;
    text-shadow: 1px 2px 8px rgba(0, 0, 0, 0.2);
}

.slide-cta {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: white;
    color: var(--primary);
    padding: 16px 36px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.slide-cta:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
    background: rgba(255, 255, 255, 0.95);
}

.slide-cta i {
    transition: transform 0.3s ease;
}

.slide-cta:hover i {
    transform: translateX(5px);
}

/* Decorative Elements */
.slide-decoration {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.decoration-circle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
}

.circle-1 {
    width: 300px;
    height: 300px;
    top: -100px;
    right: -100px;
    animation: float1 6s ease-in-out infinite;
}

.circle-2 {
    width: 200px;
    height: 200px;
    bottom: -50px;
    left: -50px;
    animation: float2 8s ease-in-out infinite;
}

.circle-3 {
    width: 150px;
    height: 150px;
    top: 50%;
    left: 10%;
    animation: float3 7s ease-in-out infinite;
}

@keyframes float1 {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    50% {
        transform: translate(-20px, 20px) rotate(180deg);
    }
}

@keyframes float2 {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    50% {
        transform: translate(30px, -30px) rotate(-180deg);
    }
}

@keyframes float3 {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    50% {
        transform: translate(20px, 20px) scale(1.1);
    }
}

/* Carousel Navigation Dots */
.carousel-nav {
    position: absolute;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    z-index: 10;
}

.carousel-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    border: 2px solid white;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.carousel-dot:hover {
    background: rgba(255, 255, 255, 0.7);
    transform: scale(1.2);
}

.carousel-dot.active {
    background: white;
    width: 32px;
    border-radius: 6px;
}

/* Carousel Arrow Controls */
.carousel-control {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    font-size: 1.2rem;
}

.carousel-control:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(1.1);
}

.carousel-control.prev {
    left: 20px;
}

.carousel-control.next {
    right: 20px;
}

/* Responsive Design for Carousel */
@media (max-width: 768px) {
    .hero-carousel-container {
        height: 450px;
        margin: 15px 10px;
        border-radius: 16px;
    }

    .hero-slide {
        padding: 40px 25px;
    }

    .slide-icon {
        width: 90px;
        height: 90px;
        font-size: 2.5rem;
        margin-bottom: 15px;
    }

    .slide-title {
        font-size: 2rem;
    }

    .slide-description {
        font-size: 1rem;
        margin-bottom: 25px;
    }

    .slide-cta {
        padding: 12px 28px;
        font-size: 1rem;
    }

    .carousel-control {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .carousel-control.prev {
        left: 10px;
    }

    .carousel-control.next {
        right: 10px;
    }

    .carousel-nav {
        bottom: 20px;
        gap: 8px;
    }

    .carousel-dot {
        width: 10px;
        height: 10px;
    }

    .carousel-dot.active {
        width: 24px;
    }

    .circle-1, .circle-2, .circle-3 {
        display: none;
    }
}

@media (max-width: 480px) {
    .hero-carousel-container {
        height: 420px;
    }

    .slide-icon {
        width: 70px;
        height: 70px;
        font-size: 2rem;
    }

    .slide-title {
        font-size: 1.6rem;
    }

    .slide-description {
        font-size: 0.9rem;
        padding: 30px;
    }
}

/* ================================
   DARK THEME CAROUSEL STYLES
   ================================ */

[data-theme="dark"] .hero-carousel-container {
    border-color: var(--border);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

[data-theme="dark"] .hero-slide {
    background: linear-gradient(135deg,
        rgba(139, 92, 246, 0.85),
        rgba(59, 130, 246, 0.85),
        rgba(16, 185, 129, 0.85)
    );
}

[data-theme="dark"] .slide-icon {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.25);
}

[data-theme="dark"] .slide-cta {
    background: rgba(255, 255, 255, 0.95);
    color: var(--primary);
}

[data-theme="dark"] .slide-cta:hover {
    background: white;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .decoration-circle {
    background: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .carousel-dot {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.8);
}

[data-theme="dark"] .carousel-dot:hover {
    background: rgba(255, 255, 255, 0.6);
}

[data-theme="dark"] .carousel-dot.active {
    background: rgba(255, 255, 255, 0.9);
}

[data-theme="dark"] .carousel-control {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.25);
}

[data-theme="dark"] .carousel-control:hover {
    background: rgba(255, 255, 255, 0.25);
}

.header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, 
        transparent 30%, 
        rgba(255, 255, 255, 0.1) 50%, 
        transparent 70%
    );
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.header h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 15px;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    position: relative;
    z-index: 1;
}

.header p {
    font-size: 1.3rem;
    opacity: 0.95;
    font-weight: 400;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.8;
    position: relative;
    z-index: 1;
}

.theme-tag {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    padding: 10px 24px;
    border-radius: 25px;
    margin-top: 20px;
    font-weight: 600;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    position: relative;
    z-index: 1;
}

/* ================================
   MAIN CONTENT GRID
   ================================ */

.main-content {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    gap: 25px;
    background: var(--bg-primary);
    border-radius: 20px;
    box-shadow: 0 25px 60px -15px var(--shadow);
    overflow: hidden;
    min-height: 75vh;
    border: 2px solid var(--border);
    margin: 20px;
    transition: grid-template-columns 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 100%;
    box-sizing: border-box;
}

/* ================================
   SIDEBAR STYLES
   ================================ */

.sidebar {
    background: var(--bg-secondary);
    border-right: 2px solid var(--border);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    height: 100%;
}

.sidebar-header {
    padding: 15px 20px;
    border-bottom: 2px solid var(--border);
    display: flex;
    justify-content: flex-end;
    background: var(--bg-secondary);
}

.collapse-btn {
    background: var(--warning);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.collapse-btn:hover {
    background: var(--warning);
    opacity: 0.9;
    transform: translateX(-3px);
}

/* Sidebar navigation */
#sidebar-nav {
    padding: 20px;
}

.lesson-category {
    margin-bottom: 25px;
}

.category-header {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-secondary);
    padding: 10px 15px;
    margin-bottom: 10px;
    border-radius: 8px;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.lesson-item {
    padding: 12px 15px 12px 25px;
    margin: 5px 0;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
    color: var(--text-primary);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}

.lesson-item:hover {
    background: var(--bg-tertiary);
    transform: translateX(5px);
}

.lesson-item.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.lesson-item.completed::after {
    content: '✓';
    position: absolute;
    right: 15px;
    color: var(--success);
    font-weight: bold;
}

/* ================================
   SIDEBAR COLLAPSE FUNCTIONALITY
   ================================ */

.sidebar.collapsed {
    width: 0 !important;
    min-width: 0 !important;
    opacity: 0;
    visibility: hidden;
    border-right: none;
    padding: 0;
    margin: 0;
    overflow: hidden;
}

.sidebar.collapsed .sidebar-header,
.sidebar.collapsed #sidebar-nav {
    display: none;
}

/* Main content expands when sidebar is collapsed */
.main-content.with-collapsed-sidebar {
    grid-template-columns: 1fr !important;
}

/* Floating toggle button - hidden by default */
.floating-toggle {
    position: fixed;
    top: 200px;
    left: 20px;
    z-index: 100;
    background: var(--success);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    justify-content: center;
    box-shadow: 0 4px 12px var(--shadow);
    transition: all 0.3s ease;
    padding: 8px 15px;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-20px);
}

.floating-toggle:hover {
    background: var(--success);
    opacity: 0.9;
    transform: translateX(-3px);
}

.floating-toggle.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    animation: floatIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes floatIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ================================
   CONTENT AREA
   ================================ */

.content-area {
    padding: 30px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.lesson-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border);
}

.lesson-title {
    font-size: 2.8rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.lesson-description {
    font-size: 1.2rem;
    color: var(--text-secondary);
    line-height: 1.7;
    max-width: 800px;
    margin: 0 auto;
}

.lesson-content {
    display: grid;
    gap: 30px;
    grid-template-rows: auto 1fr auto;
    animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* ================================
   CONCEPT EXPLANATION CARDS
   ================================ */

.concept-explanation {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 28px;
    border-left: 5px solid var(--accent);
    box-shadow: 0 5px 15px var(--shadow);
    border: 1px solid goldenrod;
    transition: all 0.3s ease;
}

.concept-explanation:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px var(--shadow);
}

.concept-explanation h3 {
    color: var(--accent);
    margin-bottom: 20px;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.concept-explanation p {
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 18px;
    font-size: 1.1rem;
}

.concept-explanation ul {
    margin-left: 20px;
    color: var(--text-secondary);
}

.concept-explanation li {
    margin-bottom: 10px;
}

/* ================================
   SQL EDITOR & RESULTS
   ================================ */

.sql-editor-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    min-height: 380px;
}

.editor-panel, .result-panel {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 12px 30px var(--shadow);
    display: flex;
    flex-direction: column;
    border: 2px solid var(--border);
    background: var(--card-bg);
    transition: all 0.3s ease;
}

.editor-panel:hover, .result-panel:hover {
    box-shadow: 0 15px 40px var(--shadow);
}

.panel-header {
    background: var(--code-bg);
    color: var(--code-text);
    padding: 16px 25px;
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--border);
}

.sql-editor {
    background: var(--code-bg);
    color: var(--code-text);
    font-family: 'Fira Code', 'JetBrains Mono', Consolas, monospace;
    font-size: 15px;
    line-height: 1.6;
    padding: 25px;
    border: none;
    outline: none;
    resize: none;
    width: 100%;
    flex: 1;
    tab-size: 4;
}

.sql-editor:focus {
    box-shadow: inset 0 0 0 2px var(--accent);
}

.sql-editor::placeholder {
    color: #64748b;
    font-style: italic;
}

.result-display {
    background: var(--code-bg);
    padding: 25px;
    flex: 1;
    overflow: auto;
    color: var(--code-text);
}

.table-container {
    overflow-x: auto;
    border-radius: 8px;
    border: 2px solid var(--border);
    box-shadow: 0 4px 12px var(--shadow);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

th, td {
    padding: 14px 18px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    background: var(--bg-secondary);
    font-weight: 700;
    color: var(--text-primary);
}

tr:hover {
    background: var(--bg-secondary);
}

/* ================================
   BUTTONS
   ================================ */

.action-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: 14px 32px;
    border-radius: 60px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 12px var(--shadow);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, #8b5cf6, #3b82f6);
    color: white;
    border: 1px solid;
    border-color: goldenrod
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 12px 25px rgba(139, 92, 246, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #ef4444, #f59e0b);
    color: white;
    border: 1px solid;
    border-color: goldenrod
}

.btn-secondary:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 12px 25px rgba(239, 68, 68, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: 1px solid;
    border-color: goldenrod
}

.btn-success:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 12px 25px rgba(16, 185, 129, 0.4);
}

/* ================================
   PROGRESS BAR
   ================================ */

.progress-bar {
    width: 100%;
    height: 10px;
    background: var(--bg-tertiary);
    border-radius: 5px;
    overflow: hidden;
    margin: 25px 0;
    box-shadow: inset 0 2px 4px var(--shadow);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--success), var(--secondary));
    border-radius: 5px;
    transition: width 0.5s ease;
}

/* ================================
   CODE HIGHLIGHTING
   ================================ */

/* Fix for pre element overflow */
pre {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    font-family: 'Fira Code', 'JetBrains Mono', monospace;
    font-size: 14px;
    border-radius: 8px;
    padding: 20px;
    overflow-x: auto;
    white-space: pre;
    margin: 15px 0;
    border: 2px solid var(--border);
    line-height: 1.6;
    position: relative;
    min-width: 0;
}

/* Inline code elements */
code:not(pre code) {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    font-family: 'Fira Code', 'JetBrains Mono', monospace;
    font-size: 14px;
    border-radius: 4px;
    padding: 2px 6px;
    margin: 0 2px;
    display: inline-block;
}

/* Code inside pre should not have extra styling */
pre code {
    background: transparent;
    color: inherit;
    padding: 0;
    font-size: inherit;
    border-radius: 0;
    display: block;
    min-width: min-content;
}

/* Syntax highlighting classes - override white text for specific elements */
pre .syntax-keyword { color: #ffd700; font-weight: bold; }
pre .syntax-string  { color: #90ee90; }
pre .syntax-number  { color: #87ceeb; }
pre .syntax-comment { color: #d3d3d3; font-style: italic; }
pre .syntax-function { color: #ffb6c1; }
pre .syntax-table   { color: #98fb98; }

/* ================================
   SAMPLE DATA & SCHEMA
   ================================ */

.sample-data, .schema-diagram {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 30px;
    margin: 20px 0;
    border: 1px solid goldenrod;
    line-height: 1.8;
    box-shadow: 0 5px 20px var(--shadow);
    overflow: visible;
}

.sample-data h4, .schema-diagram h4 {
    color: var(--accent);
    margin-bottom: 20px;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Fix for schema diagram pre specifically */
.schema-diagram pre {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    font-family: 'Fira Code', monospace;
    line-height: 1.6;
    border: 2px solid var(--border);
    white-space: pre;
    margin: 0;
    max-width: 100%;
    box-sizing: border-box;
    position: relative;
    min-width: 0;
}

/* Ensure code inside has proper width */
.schema-diagram pre code {
    display: block;
    min-width: min-content;
    white-space: pre;
}

/* Container for horizontal scrolling */
.schema-diagram .table-container,
.sample-data .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
}

/* ================================
   MESSAGES
   ================================ */

.error-message, .success-message {
    padding: 18px;
    border-radius: 8px;
    margin: 15px 0;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}

.error-message {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
    border-left: 4px solid var(--error);
}

.success-message {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border-left: 4px solid var(--success);
}

/* ================================
   QUIZ SECTION
   ================================ */

.quiz-container {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 28px;
    margin: 25px 0;
    border: 1px solid goldenrod;
    box-shadow: 0 5px 20px var(--shadow);
}

.quiz-question {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 25px;
    color: var(--text-primary);
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.quiz-options {
    display: grid;
    gap: 12px;
}

.quiz-option {
    padding: 18px;
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    color: var(--text-primary);
}

.quiz-option:hover {
    border-color: var(--accent);
    background: var(--bg-tertiary);
    transform: translateX(5px);
}

.quiz-option.selected {
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.1);
}

.quiz-option.correct {
    border-color: var(--success);
    background: rgba(16, 185, 129, 0.1);
}

.quiz-option.incorrect {
    border-color: var(--error);
    background: rgba(239, 68, 68, 0.1);
}

/* ================================
   LOADING ANIMATION
   ================================ */

.loading {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid rgba(139, 92, 246, 0.3);
    border-radius: 50%;
    border-top-color: var(--accent);
    animation: spin 1s ease-in-out infinite;
}

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



.tables-list-with-padding {
    padding-left: 30px !important; /* Use !important to override */
    opacity: 1 !important;
    display: block !important;
}


/* ================================
   RESPONSIVE DESIGN
   ================================ */

@media (max-width: 768px) {

    pre, .schema-diagram pre {
        font-size: 13px;
        padding: 15px;
        margin: 10px -15px;
        border-radius: 6px;
        max-width: calc(100% + 30px);
    }
    
    .schema-diagram, .sample-data {
        padding: 20px;
        margin: 10px 0;
        overflow-x: auto;
    }
    
    .schema-diagram pre {
        margin-left: -10px;
        margin-right: -10px;
        max-width: calc(100% + 20px);
    }

    .header {
        margin: 10px;
        padding: 20px 15px;
        width: calc(100% - 20px);
    }

    .header h1 {
        font-size: 2rem;
        flex-direction: column;
        text-align: center;
    }

    .header p {
        font-size: 1rem;
        padding: 0 10px;
    }

    .container {
        padding: 0;
        margin: 0;
        width: 100%;
    }

    .main-content {
        grid-template-columns: 1fr;
        margin: 10px;
        width: calc(100% - 20px);
        border-radius: 15px;
        min-height: auto;
    }

    .sidebar {
        max-height: none;
        border-right: none;
        border-bottom: 2px solid var(--border);
        padding: 15px 0;
    }

    .sidebar.collapsed {
        display: none;
    }

    .lesson-item {
        padding: 12px 15px 12px 25px;
        font-size: 0.95rem;
    }

    .content-area {
        padding: 20px;
        width: 100%;
        box-sizing: border-box;
    }

    .lesson-title {
        font-size: 1.8rem;
        text-align: center;
        flex-wrap: wrap;
    }

    .sql-editor-container {
        grid-template-columns: 1fr;
        gap: 15px;
        width: 100%;
    }

    .sql-editor, .result-display {
        font-size: 14px;
        padding: 15px;
        width: 100%;
        color:#10b981;
    }

    .table-container {
        overflow-x: auto;
        width: 100%;
        display: block;
    }

    table {
        min-width: 600px;
    }

    .action-buttons {
        flex-direction: column;
        width: 100%;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .concept-explanation, .quiz-container{
        padding: 20px;
        margin: 10px 0;
        width: 100%;
        overflow-x: scroll;
    }

    /* Floating toggle for mobile */
    .floating-toggle {
        top: 150px;
        left: 10px;
        padding: 6px 12px;
        font-size: 0.85rem;
    }

    .floating-toggle.show {
        top: 150px;
        left: 10px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 0;
    }

    .header {
        padding: 20px 15px;
        margin: 15px;
    }

    .header h1 {
        font-size: 1.8rem;
    }

    .lesson-title {
        font-size: 1.5rem;
        flex-direction: column;
    }

    .content-area {
        padding: 15px;
    }

    .sql-editor, .result-display {
        font-size: 13px;
        padding: 15px;
    }
}

/* Prevent horizontal scroll - CORRECT WAY */
html {
    overflow-x: hidden;
}

body {
    overflow-x: hidden;
    max-width: 100vw;
}

/* Only apply width constraints to specific containers */
.container,
.main-content {
    max-width: 100%;
    overflow-x: hidden;
}

