        body { font-family: 'Inter', sans-serif; background-color: #0D1117; color: #C9D1D9; }
        .page { display: none; }
        .page.active { display: block; }
        .nav-link.active-nav { color: #58A6FF; background-color: rgba(88, 166, 255, 0.1); }
        .hero-gradient-text { background: linear-gradient(to right, #58A6FF, #3FB950); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
        #subscription-modal.active, #login-page.active { display: flex; }
        .CodeMirror { border: 1px solid #30363D; border-radius: 0.5rem; height: 100%; font-family: 'Fira Code', monospace; font-size: 14px; background: #161B22;}
        .custom-scrollbar {
    -webkit-overflow-scrolling: touch; /* This enables smooth momentum-based scrolling on iOS and other mobile devices */
}

.hidden {
    display: none;
}

.tutorial-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    background-color: rgba(13, 17, 23, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    animation: modal-fade-in 0.3s ease-out;
}
.tutorial-header {
    padding: 1rem 2rem;
    border-bottom: 1px solid #30363D;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}
.tutorial-content {
    padding: 2rem;
    flex-grow: 1;
    overflow-y: auto;
}

.tutorial-bubble {
    /* Base styles for the bubble's appearance */
    background: linear-gradient(160deg, #2c3440, #161B22); /* Gradient for depth */
    border: 1px solid #30363D;
    border-radius: 0.75rem; /* 12px */
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5), inset 0 1px 1px rgba(255, 255, 255, 0.1);
    
    /* Positioning to make space for the tail and give it a "floating" feel */
    margin-top: 14px; 
    transform-origin: top center;
    /* We will control visibility with JS, but can add a default animation */
    /* animation: fadeIn 0.3s ease-out; */
}

/* This creates the little triangle "tail" pointing up */
.tutorial-bubble::after {
    content: '';
    position: absolute;
    /* Position the tail at the top-center of the bubble */
    bottom: 100%; 
    left: 50%;
    transform: translateX(-50%);
    
    /* Create the triangle shape using borders */
    border-width: 8px;
    border-style: solid;
    border-color: transparent transparent #2c3440 transparent; /* Color matches the bubble's top gradient */
}

/* Style for the tutorial links inside the bubble */
.tutorial-link {
    display: block;
    padding: 0.75rem 1.25rem;
    margin: 0.25rem;
    border-radius: 0.5rem;
    color: #C9D1D9;
    transition: all 0.2s ease-out;
    border-left: 2px solid transparent; /* inactive state */
}

.tutorial-link:hover {
    background-color: rgba(88, 166, 255, 0.15); /* Blue glow */
    color: #ffffff;
    transform: translateX(5px);
    border-left: 2px solid #58A6FF;
}
.note-section-card {
    background-color: rgba(22, 27, 34, 0.7); /* Dark, semi-transparent background */
    border: 1px solid #30363D;
    border-left: 3px solid #58A6FF; /* Blue accent on the left */
    border-radius: 0.75rem; /* 12px */
    padding: 1.5rem; /* 24px */
    margin-bottom: 1.5rem; /* 24px */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: all 0.2s ease-in-out;
}

.note-section-card:hover {
    border-left-color: #3FB950; /* Green accent on hover */
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

/* Styling for the heading within each card */
.note-section-heading {
    display: flex;
    align-items: center;
    font-size: 1.125rem; /* 18px */
    font-weight: 700;
    color: #C9D1D9;
    padding-bottom: 0.5rem; /* 8px */
    margin-bottom: 1rem; /* 16px */
    border-bottom: 1px solid #30363D;
}

/* A class for highlighting important keywords in the text */
.keyword-highlight {
    color: #facc15; /* A bright yellow for keywords */
    font-weight: 500;
    font-family: 'Fira Code', monospace;
}

/* Optional: Better styling for lists inside the cards */
.note-section-card ul {
    list-style-type: none;
    padding-left: 1rem; /* 16px */
}

.note-section-card ul li {
    position: relative;
    padding-left: 1.5rem; /* 24px */
    margin-bottom: 0.5rem; /* 8px */
}

.note-section-card ul li::before {
    content: '»'; /* Futuristic bullet point */
    position: absolute;
    left: 0;
    color: #58A6FF; /* Blue accent color */
    font-weight: bold;
}



/* Style for each chapter "card" */
.chapter-card {
    background: rgba(31, 41, 55, 0.4); /* Semi-transparent dark blue-grey */
    border: 1px solid rgba(88, 166, 255, 0.2);
    border-radius: 0.75rem; /* 12px */
    margin-bottom: 1rem;
    overflow: hidden;
    transition: all 0.3s ease;
}

/* Header for each chapter card */
.chapter-header {
    padding: 0.75rem 1rem; /* 12px 16px */
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s ease;
}

.chapter-header:hover {
    background-color: rgba(55, 65, 81, 0.5);
}

.chapter-title {
    font-family: 'Exo 2', sans-serif;
    font-weight: 700;
    font-size: 0.875rem; /* 14px */
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #9ca3af; /* Gray text for inactive chapters */
}

/* Arrow icon for expanding/collapsing */
.chapter-arrow {
    transition: transform 0.3s ease;
    color: #9ca3af;
}

/* Style for the list of lessons inside a chapter */
.lesson-list {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-in-out, padding 0.4s ease-in-out;
    padding: 0 0.5rem; /* No padding when closed */
}

/* Styles for an active/open chapter card */
.chapter-card.active {
    border-color: rgba(45, 212, 191, 0.4); /* Vibrant Teal Border */
    box-shadow: 0 0 25px rgba(45, 212, 191, 0.1);
}

/* Gradient background for the active chapter header */
.chapter-card.active .chapter-header {
    background: linear-gradient(90deg, rgba(45, 212, 191, 0.15) 0%, rgba(45, 212, 191, 0) 100%);
}

/* Glowing text for the active chapter title */
.chapter-card.active .chapter-title {
    color: #a7f3d0; /* Light Mint Green */
    text-shadow: 0 0 8px rgba(45, 212, 191, 0.5);
}
.chapter-card.active .chapter-arrow {
    transform: rotate(90deg);
    color: #ffffff;
}

/* The lesson list becomes visible when its parent card is active */
.chapter-card.active .lesson-list {
    max-height: 500px; /* Adjust if a chapter has many lessons */
    padding: 0.5rem 0.5rem 1rem 0.5rem; /* Add padding when open */
}

/* Style for individual lesson links */
.lesson-link {
    display: block;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem; /* 8px */
    font-size: 0.875rem; /* 14px */
    color: #d1d5db;
    transition: background-color 0.2s ease, color 0.2s ease;
    border-left: 2px solid transparent; /* Inactive state border */
}

.lesson-link:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: #ffffff;
}

/* Style for the currently active lesson link */
.lesson-link.active-lesson {
    background: rgba(45, 212, 191, 0.2); /* Teal background */
    color: #ffffff;
    font-weight: 600;
    border-left: 2px solid #2dd4bf; /* Solid Teal border */
    box-shadow: inset 2px 0 10px rgba(45, 212, 191, 0.2); /* Inner glow */
}
/* When the parent container has this class... */
#sidebar {
    transition: margin-left 0.4s ease-in-out, transform 0.3s ease-in-out;
}

/* When the sidebar is collapsed... */
.sidebar-collapsed #sidebar {
    /* ...we give it a negative left margin equal to its width (w-72 = 18rem).
       This slides it completely off-screen and allows the main content to expand. */
    margin-left: -18rem; 
}

/* This rule for showing the expand button remains the same */
.sidebar-collapsed #expand-sidebar-button {
    display: block;
}


body { 
    font-family: 'Lexend', sans-serif; /* <-- Changed from Inter */
    background-color: #0D1117; 
    color: #C9D1D9;
    overflow: hidden;
}
#page-concepts > main {
    justify-content: center;
}

/* Styles the new main "floating" container */
#quiz-chat-container {
    background: linear-gradient(160deg, rgba(27, 45, 64, 0.5), rgba(13, 17, 23, 0.7));
    border: 1px solid rgba(88, 166, 255, 0.2);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 1.5rem; /* 24px - for the rounder modal look */
}

/* Styles the input field */
#concept-input {
    background-color: rgba(13, 17, 23, 0.5) !important; /* Use !important to override old style */
    border: 1px solid rgba(88, 166, 255, 0.3) !important;
    border-radius: 9999px !important; /* Pill shape */
    color: white;
    font-size: 1rem;
    padding: 0.75rem 1.25rem;
    transition: all 0.2s ease-in-out;
}
#concept-input:focus {
    outline: none;
    border-color: #58a6ff !important;
    box-shadow: 0 0 20px rgba(88, 166, 255, 0.3);
}

/* Hides the old suggestion button styles */
.suggestion-btn {
    display: none;
}

/* 2. Set the HEADING font for branding and impact */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Exo 2', sans-serif;
}

/* 3. Ensure CODE elements use the correct monospaced font */
.CodeMirror, #console-body, #sticky-note-textarea {
    font-family: 'Fira Code', monospace;
}

/* Base style for all new buttons */
.btn-futuristic {
    padding: 0.75rem 1.5rem; /* 12px 24px */
    border-radius: 9999px; /* Pill shape */
    font-weight: 700;
    color: white;
    border: none;
    border-bottom: 3px solid rgba(0, 0, 0, 0.4);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    position: relative;
    top: 0;
    transition: all 0.15s ease-out;
}
.btn-futuristic:hover {
    top: -2px; /* Lifts the button on hover */
}
.btn-futuristic:active {
    top: 1px; /* Pushes the button down on click */
    border-bottom-width: 1px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4); /* Inner "pressed" shadow */
}

/* Primary Action Buttons (Blue/Cyan) */
.btn-futuristic-primary {
    background: linear-gradient(145deg, #0ea5e9, #2563eb); /* Cyan to Blue */
    box-shadow: 0 6px 0 #075985, 0 8px 15px rgba(2, 132, 199, 0.3);
}
.btn-futuristic-primary:hover {
    box-shadow: 0 8px 0 #075985, 0 10px 20px rgba(2, 132, 199, 0.4);
}
.btn-futuristic-primary:active {
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
}

/* Secondary Action Buttons (Green/Lime) */
.btn-futuristic-secondary {
    background: linear-gradient(145deg, #4ade80, #16a34a); /* Lime to Green */
    box-shadow: 0 6px 0 #14532d, 0 8px 15px rgba(74, 222, 128, 0.3);
}
.btn-futuristic-secondary:hover {
    box-shadow: 0 8px 0 #14532d, 0 10px 20px rgba(74, 222, 128, 0.4);
}
.btn-futuristic-secondary:active {
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
}

/* Special Action Buttons (Purple/Magenta) */
.btn-futuristic-special {
    background: linear-gradient(145deg, #d946ef, #a855f7); /* Magenta to Purple */
    box-shadow: 0 6px 0 #6b21a8, 0 8px 15px rgba(217, 70, 239, 0.3);
}
.btn-futuristic-special:hover {
    box-shadow: 0 8px 0 #6b21a8, 0 10px 20px rgba(217, 70, 239, 0.4);
}
.btn-futuristic-special:active {
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
}

/* Destructive Action Buttons (Red) */
.btn-futuristic-destructive {
    padding: 0.25rem 0.75rem; /* Smaller padding for delete buttons */
    font-size: 0.875rem;
    background: linear-gradient(145deg, #f87171, #dc2626); /* Light to Dark Red */
    box-shadow: 0 4px 0 #7f1d1d, 0 5px 10px rgba(248, 113, 113, 0.3);
}
.btn-futuristic-destructive:hover {
    box-shadow: 0 6px 0 #7f1d1d, 0 7px 15px rgba(248, 113, 113, 0.4);
}
.btn-futuristic-destructive:active {
     box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
}

/* Smaller variant for buttons in tight spaces */
.btn-futuristic-small {
    padding: 0.5rem 1rem; /* 8px 16px */
    font-size: 0.875rem; /* 14px */
}


#sticky-note-container {
    background-color: rgba(22, 27, 34, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(88, 166, 255, 0.2);
    border-radius: 1rem; /* 16px */
    box-shadow: 0 20px 30px rgba(0, 0, 0, 0.5);
    /* Reuse the modal fade-in animation */
    animation: modal-fade-in 0.3s ease-out; 
}

/* Style for the textarea inside */
#sticky-note-textarea {
    background-color: rgba(13, 17, 23, 0.8); /* Darker, semi-transparent */
    border: 1px solid rgba(88, 166, 255, 0.3);
    transition: box-shadow 0.2s;
}
#sticky-note-textarea:focus {
    box-shadow: 0 0 15px rgba(88, 166, 255, 0.2);
    outline: none;
}

/* Redesign for the close (x) button */
#close-note-btn {
    position: absolute;
    top: 0.75rem; /* 12px */
    right: 0.75rem; /* 12px */
    width: 1.75rem; /* 28px */
    height: 1.75rem; /* 28px */
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: #aeb8c5;
    font-size: 1.5rem; /* 24px */
    line-height: 1.7rem;
    text-align: center;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}
#close-note-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
    color: white;
}
.btn-futuristic-tertiary {
    background: linear-gradient(145deg, #facc15, #eab308); /* Yellow to Amber Gradient */
    box-shadow: 0 6px 0 #a16207, 0 8px 15px rgba(234, 179, 8, 0.3);
    color: #422006; /* Dark brown text for better contrast on yellow */
    text-shadow: none;
}
.btn-futuristic-tertiary:hover {
    box-shadow: 0 8px 0 #a16207, 0 10px 20px rgba(234, 179, 8, 0.4);
}
.btn-futuristic-tertiary:active {
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
}

#ai-tutor-modal > div {
    /* Futuristic "Frosted Glass" Look */
    background-color: rgba(22, 27, 34, 0.85) !important; /* Use !important to override Tailwind bg */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(88, 166, 255, 0.2); 

    /* Smooth Opening Animation */
    animation: modal-fade-in 0.4s cubic-bezier(0.25, 1, 0.5, 1);

    /* Re-applying some styles to ensure consistency */
    border-radius: 1rem; /* 16px */
    box-shadow: 0 20px 30px rgba(0, 0, 0, 0.4);
    width: 100%;
    max-width: 42rem;
    max-h-[90vh];
    display: flex;
    flex-direction: column;
}

/* Main style for the bubble */
#selection-tutor-popup {
    /* Size & Text */
    font-family: 'Exo 2', sans-serif;
    font-weight: 700;
    font-size: 0.875rem; /* 14px */
    padding: 0.75rem 1.5rem; /* Larger padding */
    color: #422006; /* Dark brown text for better contrast on yellow */
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.3);

    /* Shape & Background */
    background: linear-gradient(145deg, #fde047, #facc15); /* Bright yellow gradient */
    border-radius: 1rem; /* 16px */
    
    /* 3D & Futuristic Effect */
    border: 1px solid #fde047;
    border-top-color: #fef08a;
    border-bottom: 3px solid #ca8a04; /* Darker bottom border for depth */
    box-shadow: 
        /* The main drop shadow for floating effect */
        0 8px 25px rgba(234, 179, 8, 0.3),
        /* A subtle inner highlight */
        inset 0 1px 1px rgba(255, 255, 255, 0.5);
            
    /* Animation */
    transform-origin: bottom center; /* Animate from the tail */
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#selection-tutor-popup:hover {
    transform: scale(1.1) translateY(-2px); /* Scale up and lift on hover */
}

/* The "tail" of the bubble */
#selection-tutor-popup::after {
    content: '';
    position: absolute;
    bottom: 100%; /* Position it at the bottom of the bubble */
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    /* Create the triangle */
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 10px solid #fde047; /* Match the main color of the bubble */
    /* Add a small shadow to the tail itself */
    
}


.bot-container {
    position: relative;
    width: 80px;
    height: 80px;
    animation: bot-bobbing 5s ease-in-out infinite;
    display: block; 
    margin: auto; 
}
.bot-container .bot-body {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    position: relative;
    /* Radial gradient simulates a sphere with a top-left light source */
    background: radial-gradient(circle at 30% 30%, #60a5fa, #2563eb 80%);
    /* Complex shadows for 3D depth */
    box-shadow: 
        inset -5px -5px 15px rgba(0, 0, 0, 0.5), /* Inner shadow for curvature */
        0 8px 25px rgba(59, 130, 246, 0.3);      /* Outer glow/drop shadow */
    border: 2px solid #1e40af; /* A darker blue border */
    transition: transform 0.3s ease;
}

.bot-container:hover .bot-body {
    transform: scale(1.05) translateY(-2px);
}

.bot-container .bot-body::before {
    content: '';
    position: absolute;
    top: 5%;
    left: 15%;
    width: 70%;
    height: 40%;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.1));
    border-radius: 50% / 40%;
    transform: rotate(-30deg);
    filter: blur(2px);
}

.bot-container .bot-antenna::after {
    content: '';
    position: absolute;
    top: -8px;
    left: -3px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    /* Brighter, more vibrant colors */
    background-color: #58a6ff; 
    box-shadow: 0 0 12px #58a6ff, 0 0 20px #58a6ff, 0 0 30px #80c3ff;
    animation: bot-pulsing-glow 3s infinite ease-in-out;
}
.bot-container .bot-screen {
    width: 80%;
    height: 40%;
    background: #020617; /* Very dark blue-black */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 1rem; /* 16px */
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.5);
    /* Strong inner shadow makes it look "pushed in" */
    box-shadow: inset 0 4px 8px rgba(0,0,0,0.7);
}

.bot-container .bot-eye {
    width: 90%;
    height: 5px; /* Slightly thicker */
    background: #facc15; /* Amber color */
    border-radius: 3px;
    position: absolute;
    top: 50%;
    left: 5%;
    transform: translateY(-50%);
    /* More complex shadow for a stronger, more realistic glow */
    box-shadow: 
        0 0 5px #fde047,
        0 0 10px #facc15,
        0 0 20px #eab308;
    animation: bot-blinking 4s infinite;
}

.bot-container .bot-antenna {
    width: 4px;
    height: 20px;
    background-color: #6b7280;
    position: absolute;
    top: -22px;
    left: 50%;
    transform: translateX(-50%);
}
.bot-container .bot-antenna::after {
    content: '';
    position: absolute;
    top: -8px;
    left: -3px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #60a5fa; /* Match new highlight color */
    box-shadow: 0 0 12px #60a5fa, 0 0 20px #60a5fa;
    animation: bot-pulsing-glow 3s infinite ease-in-out;
}

.bot-container .bot-shadow {
    width: 80%;
    height: 8px;
    background: #000;
    opacity: 0.1;
    border-radius: 50%;
    position: absolute;
    bottom: -15px;
    left: 10%;
    filter: blur(5px);
    z-index: -1;
    animation: bot-shadow-scaling 5s ease-in-out infinite;
}
.bot-container .scanline {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 212, 59, 0.3), transparent);
    animation: bot-scanning 2s linear infinite;
    display: none;
}
/* --- Bot States --- */
.bot-container.is-thinking .scanline { display: block; }
.bot-container.is-thinking .bot-eye { display: none; }

/* --- Bot Animations --- */
@keyframes bot-bobbing {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}
@keyframes bot-shadow-scaling {
    0%, 100% { transform: scaleX(1); opacity: 0.1; }
    50% { transform: scaleX(0.85); opacity: 0.2; }
}
@keyframes bot-blinking {
    0%, 95%, 100% { opacity: 1; }
    97% { opacity: 0.2; }
}
@keyframes bot-pulsing-glow {
    0%, 100% { box-shadow: 0 0 10px #3776AB, 0 0 15px #3776AB; }
    50% { box-shadow: 0 0 18px #3776AB, 0 0 28px #3776AB; }
}
@keyframes bot-scanning {
    0% { left: -100%; }
    100% { left: 100%; }
}
@keyframes bot-bobbing-small {
  0%, 100% {
    transform: scale(0.5) translateY(0);
  }
  50% {
    transform: scale(0.5) translateY(-5px); /* Reduced bobbing distance */
  }
}

@keyframes bot-shadow-scaling-small {
  0%, 100% {
    transform: scaleX(0.5);
    opacity: 0.1;
  }
  50% {
    transform: scaleX(0.45);
    opacity: 0.2;
  }
}

@keyframes bot-dance-bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  40% {
    transform: translateY(-10px) rotate(-5deg);
  }
  60% {
    transform: translateY(-5px) rotate(5deg);
  }
}

@keyframes bot-antenna-wiggle {
  0%, 100% {
    transform: rotateZ(0deg);
  }
  50% {
    transform: rotateZ(10deg);
  }
}

@keyframes bot-screen-flash {
  0%, 100% {
    background: #000;
  }
  50% {
    background: #3776AB; /* Python Blue */
  }
}

.bot-container.is-dancing {
  animation: bot-dance-bounce 0.7s ease-in-out;
}

.bot-container.is-dancing .bot-antenna {
  animation: bot-antenna-wiggle 0.3s infinite alternate; /* Subtle wiggle */
}

.bot-container.is-dancing .bot-screen {
  animation: bot-screen-flash 0.3s;
}
#open-ai-tutor-button:active,
#open-ai-tutor-button:focus {
    /* Use !important to override any other styles */
    transform: none !important;
    outline: none !important;
    
    /* This explicitly keeps the shadow the same and prevents it from changing on click */
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05) !important;
}



@keyframes modal-fade-in {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}



/* Add these styles to your existing <style> tag in index.html */

#animated-console-container {
    perspective: 1000px;
    margin-top: 3rem;
}

.animated-console {
    width: 100%;
    max-width: 750px;
    margin: 0 auto;
    background: #282a36; /* Dracula background color */
    border: 1px solid #4a3c69;
    border-radius: 10px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5), 
                inset 0 2px 2px rgba(255, 255, 255, 0.1),
                inset 0 -2px 2px rgba(0, 0, 0, 0.2);
    transform: rotateX(10deg);
    transition: transform 0.5s ease;
}

.animated-console:hover {
    transform: rotateX(0deg);
}

#console-header {
    background: linear-gradient(#3c3358, #2a2141);
    padding: 8px 12px;
    border-bottom: 1px solid #1e1b2e;
    border-radius: 8px 8px 0 0;
    display: flex;
    align-items: center;
}

.console-button {
    height: 12px;
    width: 12px;
    border-radius: 50%;
    margin-right: 8px;
    border: 1px solid rgba(0,0,0,0.2);
}
.red { background: #ff5f56; }
.yellow { background: #ffbd2e; }
.green { background: #27c93f; }

/* New styles for the line numbers and code table */
#console-body {
    padding: 10px 0;
    font-family: 'Fira Code', monospace;
    font-size: 14px;
}

.console-table {
    width: 100%;
    border-collapse: collapse;
}

.line-number {
    text-align: right;
    padding-right: 15px;
    color: #6272a4; /* Dracula line number color */
    user-select: none;
    width: 1%;
}

.line-code {
    padding-left: 10px;
    white-space: pre-wrap;
    color: #f8f8f2; /* Default Dracula text color */
}

/* Syntax Highlighting Classes */
.console-comment { color: #6272a4; } /* Dracula comment */
.console-keyword { color: #ff79c6; } /* Dracula pink/purple */
.console-string { color: #f1fa8c; } /* Dracula yellow */

.typing-cursor {
    display: inline-block;
    width: 8px;
    height: 1em;
    background-color: #f8f8f2;
    margin-left: 2px;
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    from, to { background-color: transparent; }
    50% { background-color: #f8f8f2; }
}
/* Find this existing rule */
body { 
    font-family: 'Inter', sans-serif; 
    background-color: #0D1117; 
    color: #C9D1D9;
    overflow: hidden; /* <-- ADD THIS LINE */
}

/* --- Custom Dark Scrollbar --- */
.custom-scrollbar {
  scrollbar-width: thin;
  /* scrollbar-color: thumb-color track-color */
  scrollbar-color: #30363D transparent; /* For Firefox */
}
.custom-scrollbar::-webkit-scrollbar {
  width: 8px; /* Width of the scrollbar */
}
.custom-scrollbar::-webkit-scrollbar-track {
  background: transparent; /* Make the track invisible */
}
.custom-scrollbar::-webkit-scrollbar-thumb {
  background-color: #30363D; /* The color of the scrollbar */
  border-radius: 4px;      /* Rounded corners for the scrollbar */
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background-color: #586069; /* A slightly lighter color when hovered */
}

}

        #resizer {
            background-color: #30363D;
            width: 5px;
            cursor: col-resize;
            flex-shrink: 0;
        }
        .fullscreen-preview .file-list-pane,
        .fullscreen-preview #editor-pane,
        .fullscreen-preview #resizer {
            display: none;
        }
        
html {
    overflow: hidden;
}

#open-ai-tutor-button {
    display: none; 
}

.speak-button { background: none; border: none; cursor: pointer; opacity: 0.6; transition: opacity 0.2s; }
.speak-button:hover { opacity: 1; }
#mic-button.is-listening { background-color: #ef4444; } /* Red color for when mic is active */
    
#background-animation {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
}

.floating-symbol {
    position: absolute;
    /* UPDATED: Increased base color opacity for better visibility */
    color: rgba(160, 166, 173, 0.2); 
    font-family: 'Fira Code', monospace;
    user-select: none;
    animation-name: floatAndFade;
    animation-timing-function: linear;
}

@keyframes floatAndFade {
    0% {
        opacity: 0;
        transform: translateY(0) scale(0.5);
    }
    15% {
        /* UPDATED: Higher peak opacity */
        opacity: 0.8; 
    }
    90% {
        opacity: 0.8;
        transform: translateY(-80vh) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-100vh) scale(0.8);
    }
}

/* CSS for Rich Autocomplete Suggestions */
.CodeMirror-hints {
    font-family: 'Fira Code', monospace;
    background-color: #2c313a !important;
    border-color: #3e4451 !important;
}
li.CodeMirror-hint {
    color: #abb2bf !important;
}
li.CodeMirror-hint-active {
    background-color: #3e4451 !important;
    color: white !important;
}
.jedi-completion {
    padding-left: 22px !important;
    position: relative;
}
.jedi-completion::before {
    position: absolute;
    left: 5px;
    top: 1px;
    font-weight: bold;
    width: 15px;
    text-align: center;
    font-size: 12px;
    font-family: sans-serif;
    padding-top: 1px;
}
.jedi-type-function::before { content: 'ƒ'; color: #c678dd; }
.jedi-type-class::before { content: 'C'; color: #e5c07b; }
.jedi-type-keyword::before { content: 'k'; color: #56b6c2; }
.jedi-type-module::before { content: 'M'; color: #98c379; }
.jedi-type-statement::before { content: 's'; color: #d19a66; }
.jedi-type-instance::before { content: 'v'; color: #61afef; }
.jedi-type-variable::before { content: 'v'; color: #61afef; }

.tutorial-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem; /* 24px */
}
.tutorial-card {
    background-color: #161B22; /* Slightly lighter than the page background */
    border: 1px solid #30363D;
    border-top: 4px solid #58A6FF; /* Blue accent color */
    border-radius: 0.75rem; /* 12px */
    padding: 1.5rem; /* 24px */
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}
.tutorial-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}
.tutorial-card-icon {
    font-size: 2.5rem; /* 40px */
    margin-bottom: 1rem; /* 16px */
    line-height: 1;
}
.tutorial-card h3 {
    font-size: 1.25rem; /* 20px */
    font-weight: 700;
    color: #C9D1D9; /* Lighter text for headings */
    margin-bottom: 0.5rem; /* 8px */
}
.tutorial-card p {
    font-size: 0.9rem; /* 14.4px */
    color: #8B949E; /* Subtler text for descriptions */
    flex-grow: 1;
}
.suggestion-btn {
    background-color: #30363D;
    color: #C9D1D9;
    padding: 6px 12px;
    border-radius: 9999px;
    font-size: 12px;
    border: 1px solid transparent;
    transition: all 0.2s;
    cursor: pointer;
}
.suggestion-btn:hover {
    background-color: #444c56;
    border-color: #58a6ff;
}
/* --- Custom Dark Scrollbar --- */
.custom-scrollbar {
  scrollbar-width: thin;
  /* For Firefox */
  scrollbar-color: #30363D transparent;
}

.custom-scrollbar::-webkit-scrollbar {
  width: 8px;
  /* Width of the scrollbar */
  height: 8px;
  /* Height for horizontal scrollbar */
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: transparent;
  /* Make the track invisible */
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background-color: #30363D;
  /* The color of the scrollbar */
  border-radius: 4px;
  /* Rounded corners for the scrollbar */
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background-color: #586069;
  /* A slightly lighter color when hovered */
}

/* --- Specific Styling for CodeMirror Scrollbars --- */
.CodeMirror-vscrollbar::-webkit-scrollbar,
.CodeMirror-hscrollbar::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.CodeMirror-vscrollbar::-webkit-scrollbar-track,
.CodeMirror-hscrollbar::-webkit-scrollbar-track {
  background: transparent;
}

.CodeMirror-vscrollbar::-webkit-scrollbar-thumb,
.CodeMirror-hscrollbar::-webkit-scrollbar-thumb {
  background-color: #30363D;
  border-radius: 4px;
}

.CodeMirror-vscrollbar::-webkit-scrollbar-thumb:hover,
.CodeMirror-hscrollbar::-webkit-scrollbar-thumb:hover {
  background-color: #586069;
}
.challenge-tab-btn {
    padding: 8px 16px;
    cursor: pointer;
    background-color: transparent;
    border: none;
    color: #8b949e; /* Gray text for inactive tabs */
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease-in-out;
}

.challenge-tab-btn.active {
    color: #58a6ff; /* Blue text for the active tab */
    border-bottom: 2px solid #58a6ff;
}
/* Leaderboard Styling */
.leaderboard-list {
  list-style: none;
  padding: 0;
}
.leaderboard-item {
  display: flex;
  align-items: center;
  padding: 12px;
  background-color: #161B22;
  border: 1px solid #30363D;
  border-radius: 8px;
  margin-bottom: 8px;
  transition: all 0.2s ease-in-out;
}
.leaderboard-item:hover {
    transform: translateY(-2px);
    border-color: #58a6ff;
}
.leaderboard-rank {
  font-size: 1.25rem;
  font-weight: 700;
  color: #8b949e;
  width: 50px;
  text-align: center;
  flex-shrink: 0;
}
.leaderboard-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin: 0 15px;
}
.leaderboard-name {
  font-weight: 600;
  color: #c9d1d9;
  flex-grow: 1;
}
.leaderboard-score {
  font-size: 1.1rem;
  font-weight: 700;
  color: #3fb950;
}
.leaderboard-tier {
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-left: 20px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.4);
}
/* Highlight for the current user's entry */
.user-highlight {
    background-color: rgba(88, 166, 255, 0.1);
    border: 1px solid #58a6ff;
    box-shadow: 0 0 15px rgba(88, 166, 255, 0.2);
}
/* Styling for the new Interactive Welcome Tour */
#welcome-tour-container {
    display: flex;
    align-items: center;
    gap: 2rem;
    padding: 2rem;
}

#welcome-bot-container {
    flex-shrink: 0;
}

#welcome-dialog-area {
    flex-grow: 1;
}

.speech-bubble {
    background: #161B22;
    border: 1px solid #30363D;
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 1rem;
    position: relative;
    max-width: 600px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    /* Animation */
    opacity: 0;
    transform: translateY(20px);
    animation: bubble-fade-in 0.5s ease-out forwards;
}

.speech-bubble::after {
    content: '';
    position: absolute;
    top: 30px;
    left: -16px;
    width: 0;
    height: 0;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-right: 16px solid #161B22;
    filter: drop-shadow(-1px 0 0 #30363D);
}

@keyframes bubble-fade-in {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
/* Animation for the loading bot */
.is-dancing {
  /* Use a unique animation name to avoid conflicts */
  animation: bot-loader-dance 0.8s ease-in-out infinite;
}

@keyframes bot-loader-dance {
  0%, 100% {
    transform: scale(1.5) translateY(0) rotate(0deg);
  }
  25% {
    transform: scale(1.5) translateY(-15px) rotate(-5deg);
  }
  75% {
    transform: scale(1.5) translateY(-15px) rotate(5deg);
  }
}
Of course. Here is the complete CSS to give your chat window the new look with a 3D-style curved outline, high-contrast message bubbles, and updated buttons.

Chat Window CSS
You can replace the previous chat window CSS in your index.html file's <style> tag with this new set of rules.

CSS

/* --- Futuristic Chat Window Redesign --- */

/* 1. Creates a 3D curved edge effect for the main window */
#ai-tutor-modal > div {
    border: 1px solid #4A5568; /* A slightly lighter, more modern border */
    background-color: #2D3748; /* A deep blue-gray for the window background */
    border-radius: 24px; /* Softer, rounder corners */
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.4); /* A softer, more modern drop shadow */
    overflow: hidden; /* Ensures all child elements respect the rounded corners */
}

#chat-history .flex-col:not(:has(.justify-end)) .leading-relaxed {
    background-color: #FBBF24 !important; /* Vibrant golden-yellow */
    color: #1F2937 !important; /* Dark text for high contrast */
}

/* 3. Clean white background with black text for the user's prompts */
#chat-history .flex-col:has(.justify-end) .leading-relaxed {
    background-color: #FFFFFF !important; /* Crisp white */
    color: #111827 !important; /* Dark text */
}

/* General styling for all chat bubbles */
#chat-history .leading-relaxed {
    padding: 0.65rem 1rem;
    border-radius: 18px; /* Slightly less rounded than the main window */
}

/* 4. Futuristic Pink Search Button */
#tutor-search-button {
    background: linear-gradient(145deg, #EC4899, #D946EF);
    color: #FFFFFF;
    border: none;
    border-radius: 12px;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
}

#tutor-search-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(236, 72, 153, 0.3), 0 4px 6px -4px rgba(236, 72, 153, 0.3);
}

/* 5. Clean White Mic Button */
#mic-button {
    background-color: #FFFFFF;
    color: #1F2937; /* Dark icon for contrast */
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    padding: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
}

#mic-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 10px -3px rgba(0, 0, 0, 0.1);
}

#mic-button.is-listening {
    background-color: #F87171 !important; /* A softer red for the listening state */
    color: #FFFFFF;
    border-color: transparent;
}

/* Updated style for the text input field */
#tutor-input {
    background-color: #1F2937;
    border: 1px solid #4A5568;
    color: #F7FAFC;
    border-radius: 12px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: all 0.2s ease-in-out;
}

#tutor-input:focus {
    outline: none;
    border-color: #A78BFA; /* A nice lavender focus color */
    box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.2);
}
/* Custom Styles for the Quill Editor Dark Theme */
#notebook-editor-container .ql-toolbar {
    background: #1F293B;
    border: none !important;
    border-bottom: 1px solid #4A5568 !important;
}
#notebook-editor-container .ql-container {
    border: none !important;
    font-size: 16px;
    font-family: 'Lexend', sans-serif;
}
#notebook-editor-container .ql-editor {
    color: #D1D5DB;
}
.ql-snow .ql-stroke { stroke: #9CA3AF; }
.ql-snow .ql-picker-label { color: #9CA3AF; }
.ql-snow .ql-active .ql-stroke { stroke: #3B82F6; }
.ql-snow .ql-active .ql-fill { fill: #3B82F6; }

/* Styling for code blocks */
.ql-snow .ql-syntax {
    background-color: #0D1117;
    color: #D1D5DB;
    padding: 1rem;
    border-radius: 0.5rem;
    font-family: 'Fira Code', monospace;
}
.xp-bar-container {
    width: 100%;
    background-color: #161B22;
    border: 1px solid #30363D;
    border-radius: 9999px;
    height: 12px;
    overflow: hidden;
}

.xp-bar-progress {
    height: 100%;
    background: linear-gradient(90deg, #3B82F6, #2DD4BF);
    border-radius: 9999px;
    transition: width 0.5s ease-in-out;
}
.challenge-main-tab-btn {
    padding: 12px 20px;
    cursor: pointer;
    background-color: transparent;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    color: #8b949e;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease-in-out;
}
.challenge-main-tab-btn.active {
    color: #58a6ff;
    border-bottom: 3px solid #58a6ff;
}

/* Styling for Cosmetic Avatar Frames */
.leaderboard-avatar {
    /* Base styles */
    padding: 2px;
    background-color: #30363D;
}
.frame-level-10 {
    border: 3px solid #3B82F6; /* Blue Frame */
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.5);
}
.frame-level-25 {
    border: 3px solid #A855F7; /* Purple Frame */
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.5);
}
.frame-level-50 {
    border: 3px solid #FBBF24; /* Gold Frame */
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.6);
}

/* Styling for the new Rewards Banner Carousel */
#rewards-banner {
    background: linear-gradient(90deg, rgba(22, 27, 34, 0.5), rgba(13, 17, 23, 0.7));
    border: 1px solid rgba(88, 166, 255, 0.2);
    border-radius: 0.75rem; /* 12px */
    padding: 0.75rem; /* 12px */
    margin-bottom: 2rem; /* 32px spacing below */
    overflow: hidden; /* This is crucial for the carousel effect */
    position: relative;
    box-shadow: 0 10px 25px -10px rgba(0,0,0,0.4);
}

#rewards-carousel-track {
    display: flex;
    /* This animation is what makes it scroll */
    animation: scroll-left 30s linear infinite;
}

/* Pause the animation when the user hovers over it */
#rewards-banner:hover #rewards-carousel-track {
    animation-play-state: paused;
}

.reward-item {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    margin-right: 2.5rem; /* 40px spacing between items */
    color: #9CA3AF;
}

.reward-item-icon {
    font-size: 1.5rem; /* 24px */
    margin-right: 0.75rem; /* 12px */
}

.reward-item-text {
    font-size: 0.875rem; /* 14px */
    font-weight: 500;
    white-space: nowrap; /* Prevents text from wrapping */
}

/* The scrolling animation keyframes */
@keyframes scroll-left {
    from {
        transform: translateX(0%);
    }
    to {
        transform: translateX(-50%); /* This moves the track by half its width */
    }
}
/* --- NEW: Skill Path Redesign --- */

/* Main container for each lesson card */
.skill-path-card {
    background: linear-gradient(160deg, rgba(22, 27, 34, 0.8), rgba(13, 17, 23, 0.9));
    border: 1px solid #30363D;
    border-radius: 0.75rem; /* 12px */
    padding: 1.5rem; /* 24px */
    margin-bottom: 1.5rem; /* Space between cards */
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.skill-path-card:hover {
    transform: translateY(-5px);
    border-color: rgba(45, 212, 191, 0.4); /* Teal border on hover */
    box-shadow: 0 15px 30px rgba(0,0,0,0.3), 0 0 20px rgba(45, 212, 191, 0.1);
}

/* Header section within the card (Lesson Title, Progress) */
.skill-path-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #30363D;
    padding-bottom: 0.75rem; /* 12px */
    margin-bottom: 1rem; /* 16px */
}

.skill-path-title {
    font-family: 'Exo 2', sans-serif;
    font-size: 1.25rem; /* 20px */
    font-weight: 700;
    color: #C9D1D9;
}

.skill-path-progress-text {
    font-family: 'Fira Code', monospace;
    font-size: 0.875rem; /* 14px */
    font-weight: 500;
    color: #8B949E; /* Grayish color for progress */
}

/* Container for the list of challenges/quests */
.skill-path-quest-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem; /* 12px gap between quests */
}

/* Individual challenge/quest item */
.skill-path-quest {
    background-color: rgba(13, 17, 23, 0.7);
    border: 1px solid #30363D;
    border-radius: 0.5rem; /* 8px */
    padding: 0.75rem 1rem; /* 12px 16px */
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease-out;
}

.skill-path-quest:hover {
    background-color: rgba(88, 166, 255, 0.1); /* Blue glow on hover */
    border-left: 3px solid #58A6FF;
    transform: translateX(5px);
}

.skill-path-quest-info {
    display: flex;
    align-items: center;
    gap: 0.75rem; /* 12px */
}

.skill-path-quest-icon {
    font-size: 1.25rem; /* 20px */
}

.skill-path-quest-title {
    color: #C9D1D9;
    font-weight: 500;
}

/* --- State-based Styling --- */

/* Card for a fully mastered lesson */
.skill-path-card.is-mastered {
    border-left: 4px solid #3FB950; /* Green accent for mastered */
}

.skill-path-card.is-mastered .skill-path-progress-text {
    color: #3FB950; /* Green text for progress */
}

/* Card for a locked lesson */
.skill-path-card.is-locked {
    opacity: 0.6;
    filter: grayscale(50%);
    pointer-events: none; /* User cannot interact with locked cards */
}

.skill-path-quest .start-quest-btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.75rem;
}

.skill-path-quest .start-quest-btn:disabled {
    background: #30363D;
    color: #8B949E;
    box-shadow: none;
    cursor: not-allowed;
    border-bottom-width: 1px;
    top: 0;
}
#interactive-plot-output {
    overflow-y: auto !important; /* Force vertical scrolling when content overflows */
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Align plot to the top so you can scroll down */
}

#interactive-plot-output img {
    max-width: 100%;
    height: auto; /* Maintain the plot's aspect ratio */
}
#output, 
#text-output,
#interactive-text-output, 
#playground-output, 
#challenge-output {
    white-space: pre-wrap !important; /* Preserves newlines and wraps text */
    word-wrap: break-word;          /* Breaks long words if necessary */
}
#chat-history .prose pre {
    background-color: #111827 !important; /* A very dark blue-black background */
    color: #ffd700 !important;           /* A light gray text color */
}