/* === TABLE OF CONTENTS ===
1. Global & Typography
2. Layout & Navigation
3. Components (Buttons, Cards, Forms, Alerts)
4. Page: Main App & Authentication
5. Page: My Lessons & Analysis
6. Page: Public Site (Landing, Pricing, etc.)
7. Mobile Responsiveness
=========================== */

/* ---= 1. Global & Typography =--- */
:root {
    --primary-color: #0d6efd;
    --primary-hover: #0b5ed7;
    --success-color: #198754;
    --danger-color: #dc3545;
    --danger-hover: #c82333;
    --light-gray: #f8f9fa;
    --medium-gray: #dee2e6;
    --border-color: #ced4da;
    --text-color: #212529;
    --text-muted: #6c757d;
    --border-radius: .375rem;
    --box-shadow-sm: 0 .125rem .25rem rgba(0,0,0,.075);
}
body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    line-height: 1.6;
    margin: 0;
    background-color: #f4f7f9;
    color: var(--text-color);
}
.container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 20px;
}
h1 { font-size: 2rem; border-bottom: 1px solid var(--medium-gray); padding-bottom: 15px; margin-top: 0; margin-bottom: 25px; }
h2 { font-size: 1.6rem; margin-top: 1.5em; padding-bottom: 10px; margin-bottom: 20px; }
h2:first-child { margin-top: 0; }
a { color: var(--primary-color); text-decoration: none; }
a:hover { text-decoration: underline; }
.text-center { text-align: center; }

/* ---= 2. Layout & Navigation =--- */
.main-header, .public-header {
    background-color: #fff;
    border-bottom: 1px solid var(--medium-gray);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 1020;
}
.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 20px;
}
.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    height: 100%;
    gap: 10px;
}
.logo img {
    max-height: 40px;
    width: auto;
}
.logo-text {
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
}
.nav-left, .nav-right {
    display: flex;
    align-items: center;
    gap: 20px;
}
.nav-info {
    color: var(--text-muted);
    font-size: 0.9em;
}
.nav-info strong {
    color: var(--text-color);
}
.hamburger-button, .mobile-menu {
    display: none;
}
.public-footer {
    background-color: var(--text-color);
    color: #fff;
    padding: 30px 0;
    text-align: center;
}
.public-footer p {
    margin: 0;
    color: var(--medium-gray);
}
.mobile-menu-info {
    padding: 15px 20px;
    background-color: var(--light-gray);
    display: flex;
    justify-content: space-between;
    font-size: 0.9em;
    border-bottom: 1px solid var(--medium-gray);
}
.mobile-menu-lang {
    padding: 10px 20px;
    border-bottom: 1px solid var(--light-gray);
}
.mobile-menu-lang select {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background-color: #fff;
}

/* ---= 3. Components (Buttons, Cards, Forms, Alerts) =--- */
.button { display: inline-block; padding: 10px 20px; font-weight: 500; color: #fff !important; text-decoration: none; border-radius: 5px; border: none; font-size: 1rem; cursor: pointer; text-align: center; transition: background-color 0.2s; }
.button.primary { background-color: var(--primary-color); }
.button.primary:hover { background-color: var(--primary-hover); }
.button.danger { background-color: var(--danger-color); }
.button.danger:hover { background-color: var(--danger-hover); }
.button.secondary { background-color: #fff; color: var(--primary-color) !important; border: 1px solid var(--primary-color); }
.button.secondary:hover { background-color: var(--light-gray); text-decoration: none; }
.button.small { padding: 5px 12px; font-size: 0.9em; }
.button.large { padding: 15px 35px; font-size: 1.1rem; font-weight: 600; }
.button.full-width { width: 100%; padding: 12px; font-size: 1.1rem; }
.button:disabled, .button[disabled] { background-color: #ccc; cursor: not-allowed; box-shadow: none; border-color: #ccc; color: var(--text-muted) !important; }

.card { background-color: #fff; padding: 25px 30px; border-radius: var(--border-radius); margin-bottom: 25px; border: 1px solid var(--medium-gray); box-shadow: var(--box-shadow-sm); }
.card h2 { margin-top: 0; }

.form-group { margin-bottom: 1.2rem; }
.form-group label { display: block; margin-bottom: .5rem; font-weight: 500; }
.form-control { display: block; width: 100%; box-sizing: border-box; padding: .6rem .8rem; font-size: 1rem; border: 1px solid var(--border-color); border-radius: .25rem; }

.alert { padding: 15px; margin-bottom: 20px; border: 1px solid transparent; border-radius: 4px; }
.alert-success { color: #0f5132; background-color: #d1e7dd; border-color: #badbcc; }
.alert-danger { color: #842029; background-color: #f8d7da; border-color: #f5c2c7; }
.alert-warning { color: #664d03; background-color: #fff3cd; border-color: #ffc107; }
.alert-info { color: #055160; background-color: #cff4fc; border-color: #b6effb; }

.collapsible-card {
    display: none; /* Hide the form by default */
}

/* Simple CSS for the +/- icons on the button */
[class*="icon-"] {
    display: inline-block;
    width: 1em;
    height: 1em;
    margin-right: 0.5em;
    position: relative;
    top: 0.15em;
}
.icon-plus::before, .icon-plus::after {
    content: '';
    position: absolute;
    background-color: currentColor;
}
.icon-plus::before { top: 0; bottom: 0; left: 50%; width: 2px; margin-left: -1px; }
.icon-plus::after { left: 0; right: 0; top: 50%; height: 2px; margin-top: -1px; }
.icon-minus::after { left: 0; right: 0; top: 50%; height: 2px; margin-top: -1px; }

/* ---= 4. Page: Main App & Authentication =--- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; }
.tabs-container { margin-top: 20px; }
.tab-nav { display: flex; border-bottom: 2px solid var(--medium-gray); }
.tab-nav-item { padding: 10px 20px; cursor: pointer; background: none; border: none; border-bottom: 3px solid transparent; font-size: 1rem; color: var(--text-muted); margin-bottom: -2px; }
.tab-nav-item.active { border-color: var(--primary-color); color: var(--text-color); font-weight: 600; }
.tab-content { padding: 25px 5px 5px 5px; }
.tab-pane { display: none; }
.tab-pane.active { display: block; }
.record-controls { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.volume-control { margin-top: 15px; display: flex; align-items: center; flex-wrap: wrap; gap: 10px;}

.auth-section { padding: 60px 0; background-color: var(--light-gray); min-height: calc(100vh - 122px); display: flex; align-items: center; }
.auth-container { max-width: 450px; margin: 0 auto; background: #fff; padding: 40px; border: 1px solid var(--medium-gray); border-radius: var(--border-radius); }
.auth-title { text-align: center; font-size: 1.8rem; margin-bottom: 30px; }
.auth-form .form-group { margin-bottom: 20px; }
.auth-switch { text-align: center; margin-top: 25px; color: var(--text-muted); }

/* ---= 5. Page: My Lessons & Analysis =--- */
.my-lessons-container { display: flex; gap: 30px; align-items: flex-start; }
.sidebar { flex: 0 0 280px; }
.main-content { flex: 1; }
.create-folder-form form { display: flex; }
.create-folder-form input { flex-grow: 1; border-right: none; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.create-folder-form button { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.folder-search-wrapper { margin-top: 15px; }
.folder-list-container { max-height: 40vh; overflow-y: auto; margin-top: 20px; padding-right: 10px; }
.folder-list { list-style: none; padding: 0; margin: 0; }
.folder-item { display: flex; justify-content: space-between; align-items: center; margin-bottom: 5px; border-radius: 5px; }
.folder-item:hover { background-color: var(--light-gray); }
.folder-item a { padding: 8px 12px; display: block; flex-grow: 1; text-decoration: none; color: var(--text-color); }
.folder-item.active { background-color: var(--primary-color); }
.folder-item.active a { color: white; font-weight: bold; }
.folder-item form { margin: 0; padding: 0; }
.folder-delete-btn { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1.5rem; line-height: 1; padding: 0 12px; visibility: hidden; opacity: 0; transition: opacity 0.2s ease; }
.folder-item:hover .folder-delete-btn { visibility: visible; opacity: 1; }
.folder-delete-btn:hover { color: var(--danger-color); }
.folder-item.active .folder-delete-btn { color: #fff; }

.bulk-actions-bar { display: flex; justify-content: space-between; align-items: center; padding: 10px; background-color: var(--light-gray); border-radius: var(--border-radius); margin-bottom: 20px; }
.bulk-actions-left, .bulk-actions-right { display: flex; align-items: center; gap: 15px; }
.bulk-actions-left label { margin-bottom: 0; }
.move-controls { display: flex; align-items: center; gap: 5px; }

.lessons-table { width: 100%; border-collapse: collapse; }
.lessons-table th { text-align: left; padding: 12px; border-bottom: 2px solid var(--medium-gray); }
.lessons-table td { padding: 12px; border-bottom: 1px solid var(--medium-gray); vertical-align: middle; }
.lesson-name-cell { cursor: pointer; position: relative; }
.lesson-name-cell .edit-icon { display: none; position: absolute; right: 15px; top: 50%; transform: translateY(-50%); font-size: 0.9em; opacity: 0.6; }
.lesson-name-cell:hover .edit-icon { display: inline; }
.lesson-name-cell input { width: 95%; padding: 6px; font-size: 1em; border: 1px solid var(--primary-color); border-radius: 4px; }

/* --- NEW Student Roster Card --- */
.student-card-new {
    display: grid;
    grid-template-columns: 2fr 1fr 1.5fr; /* Three columns for desktop */
    grid-template-areas: "info toggle actions";
    gap: 20px;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}
.student-card-new:last-child {
    border-bottom: none;
}
.sc-info { grid-area: info; }
.sc-toggle { grid-area: toggle; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.sc-actions { grid-area: actions; display: flex; flex-direction: column; gap: 10px; }
.sc-info p { margin: 0.5em 0; }
.sc-info p .label { font-weight: bold; min-width: 90px; display: inline-block; }
.sc-info .editable-field { cursor: pointer; }
.sc-info .edit-icon { opacity: 0; transition: opacity 0.2s; }
.sc-info .editable-field:hover + .edit-icon, 
.sc-info .editable-container:hover .edit-icon {
    opacity: 0.6;
}
.sc-actions .button { width: 100%; }
.sc-notes {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--border-color);
    font-size: 0.9em;
    color: var(--text-muted);
}
.sc-notes .label {
    color: var(--text-color); /* Make the "Notes:" label less muted */
}

/* Progress Indicator & Animation Styles */
.status-cell { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.progress-indicator-container { height: auto; min-height: 12px; }
.progress-lights { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.progress-section { display: flex; align-items: center; gap: 4px; }
.progress-lights .progress-label { font-size: 0.8em; color: var(--text-muted); }
.light { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background-color: #e0e0e0; border: 1px solid #ccc; transition: background-color 0.3s ease; }
.light.pending { background-color: #e0e0e0; }
.light.processing { background-color: #ffc107; }
.light.completed { background-color: #28a745; }
.light.failed { background-color: #dc3545; }

/* NEW: CSS Ellipsis Animation */
.status-cell-text.is-animating::after {
    display: inline-block;
    animation: ellipsis 1.25s infinite;
    content: ".";
    width: 1em; /* Give it a fixed width to prevent layout shift */
    text-align: left;
}
@keyframes ellipsis {
    0% { content: "."; }
    33% { content: ".."; }
    66% { content: "..."; }
}

/* ---= 6. Page: Public Site (Landing, Pricing, etc.) =--- */
.public-header .nav-links-desktop { display: flex; align-items: center; gap: 25px; }
.nav-button-secondary, .nav-button-primary { padding: 8px 16px; border-radius: var(--border-radius); text-decoration: none; font-weight: 500; transition: all 0.2s ease; }
.nav-button-secondary { background-color: transparent; color: var(--text-color); }
.nav-button-secondary:hover { background-color: var(--light-gray); }
.nav-button-primary { background-color: var(--primary-color); color: #fff !important; }
.nav-button-primary:hover { background-color: var(--primary-hover); text-decoration: none; }
.public-header .hamburger-button { display: none; }

.hero-section { background: #ffffff; padding: 80px 0; text-align: center; }
.hero-title { font-size: 2.8rem; font-weight: 700; line-height: 1.2; max-width: 800px; margin: 0 auto 20px auto; }
.subtitle { font-size: 1.2rem; color: var(--text-muted); max-width: 650px; margin: 0 auto 30px auto; }

.features-section, .how-it-works-section, .testimonials-section { padding: 60px 0; }
.how-it-works-section { background-color: var(--light-gray); }
.section-title { font-size: 2.2rem; margin-bottom: 50px; }

.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }
.feature-item { background-color: #fff; padding: 30px; border-radius: var(--border-radius); text-align: center; border: 1px solid var(--medium-gray); transition: transform 0.2s ease, box-shadow 0.2s ease; }
.feature-item:hover { transform: translateY(-5px); box-shadow: 0 4px 15px rgba(0,0,0,0.08); }
.feature-icon { font-size: 2.5rem; line-height: 1; margin-bottom: 20px; }

.steps-container { display: flex; justify-content: space-between; position: relative; gap: 40px; }
.steps-container::before { content: ''; position: absolute; top: 35px; left: 5%; right: 5%; height: 2px; background-color: var(--medium-gray); z-index: 0; }
.step-item { display: flex; align-items: flex-start; gap: 20px; flex: 1; background-color: var(--light-gray); z-index: 1; }
.step-number { flex-shrink: 0; width: 70px; height: 70px; border-radius: 50%; background-color: var(--primary-color); color: #fff; font-size: 2rem; font-weight: 600; display: flex; align-items: center; justify-content: center; border: 5px solid #fff; }
.step-text h4 { margin: 0 0 5px 0; font-size: 1.2rem; }
.step-text p { margin: 0; color: var(--text-muted); }

.testimonial-text { font-style: italic; color: var(--text-muted); flex-grow: 1; }
.testimonial-author { font-weight: 600; margin-top: 20px; color: var(--text-color); }

.final-cta-section { background-color: var(--primary-color); color: #fff; padding: 80px 0; }
.final-cta-section .section-title, .final-cta-section .subtitle { color: #fff; }
.final-cta-section .button.primary { background-color: #fff; color: var(--primary-color) !important; }
.final-cta-section .button.primary:hover { background-color: var(--light-gray); }

.pricing-section { padding: 60px 0; background-color: #f4f7f9; }
.pricing-header { margin-bottom: 50px; }
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; align-items: start; max-width: 900px; margin: 0 auto; }
.pricing-plan { background: #fff; border: 1px solid var(--medium-gray); border-radius: var(--border-radius); padding: 30px; text-align: center; display: flex; flex-direction: column; height: 100%; position: relative; transition: transform 0.2s ease, box-shadow 0.2s ease; }
.pricing-plan.featured { border-color: var(--primary-color); border-width: 2px; transform: scale(1.05); }
.featured-badge { position: absolute; top: -15px; left: 50%; transform: translateX(-50%); background: var(--primary-color); color: #fff; padding: 5px 15px; border-radius: 20px; font-size: 0.9rem; font-weight: 600; }
.plan-header { padding-bottom: 20px; border-bottom: 1px solid var(--medium-gray); }
.plan-name { font-size: 1.5rem; font-weight: 600; }
.plan-price { font-size: 2.5rem; font-weight: 700; margin: 10px 0; }
.price-period { font-size: 1rem; font-weight: 400; color: var(--text-muted); }
.plan-features { list-style: none; padding: 20px 0; margin: 0; text-align: left; flex-grow: 1; }
.plan-features li { padding: 10px 0 10px 30px; position: relative; }
.plan-features li::before { content: '✔'; position: absolute; left: 0; color: var(--success-color); font-weight: bold; }
.plan-cta { margin-top: 20px; }

/* ---= 7. Mobile Responsiveness =--- */
@media (max-width: 768px) {
    .logo-text { font-size: 1.2rem; }
    h1 { font-size: 1.8rem; }
    h2 { font-size: 1.4rem; }
    
    .nav-right, .nav-link-desktop, .public-header .nav-links-desktop { display: none; }
    .hamburger-button, .public-header .hamburger-button { display: block; }
    .mobile-menu, .public-header .mobile-menu { display: flex; }
    
    .hamburger-button { padding: 10px; background-color: transparent; border: none; cursor: pointer; z-index: 1010; }
    .hamburger-box { width: 30px; height: 24px; display: inline-block; position: relative; }
    .hamburger-inner { display: block; top: 50%; margin-top: -1px; }
    .hamburger-inner, .hamburger-inner::before, .hamburger-inner::after { width: 30px; height: 2px; background-color: #333; border-radius: 4px; position: absolute; transition: transform 0.2s ease-in-out; }
    .hamburger-inner::before, .hamburger-inner::after { content: ''; display: block; }
    .hamburger-inner::before { top: -10px; }
    .hamburger-inner::after { bottom: -10px; }
    .hamburger-button.is-active .hamburger-inner { transform: rotate(45deg); }
    .hamburger-button.is-active .hamburger-inner::before { top: 0; transform: rotate(90deg); }
    .hamburger-button.is-active .hamburger-inner::after { bottom: 0; opacity: 0; }
    
    .mobile-menu { flex-direction: column; background-color: #fff; border-top: 1px solid var(--medium-gray); position: absolute; top: 60px; left: 0; width: 100%; max-height: 0; overflow: hidden; transition: max-height 0.3s ease-in-out; }
    .mobile-menu.is-open { max-height: 300px; border-bottom: 1px solid var(--medium-gray); }
    .mobile-menu a { padding: 15px 20px; border-bottom: 1px solid var(--light-gray); color: var(--text-color); }
    .mobile-menu a:last-child { border-bottom: none; }
    .mobile-menu a:hover { background-color: var(--light-gray); }

    .my-lessons-container, .page-grid, .features-grid, .steps-container { grid-template-columns: 1fr; flex-direction: column; }
    .sidebar { flex-basis: auto; width: 100%; margin-bottom: 25px;}
    .page-grid .sidebar-form .card {
        border-radius: 0;
        border-left: none;
        border-right: none;
        box-shadow: none;
        /* Optional: adjust padding if needed */
        padding-left: 0;
        padding-right: 0;
    }
    .bulk-actions-bar { flex-direction: column; align-items: stretch; gap: 15px;}
    .bulk-actions-right { justify-content: space-between; margin-top: 0; flex-wrap: wrap; gap: 10px; }
    
    .lessons-table thead { display: none; }
    .lessons-table tr { display: block; margin-bottom: 20px; border: 1px solid var(--medium-gray); border-radius: var(--border-radius); padding: 15px; box-shadow: var(--box-shadow-sm); position: relative;}
    .lessons-table td {
        display: flex;
        /* MODIFICATION: Change flex-direction to column for better alignment */
        flex-direction: column;
        align-items: flex-start; /* Align items to the left */
        justify-content: center;
        padding: 10px 0; /* MODIFICATION: Adjust padding */
        border-bottom: 1px solid #f1f3f5;
        text-align: left; /* MODIFICATION: Change text-align to left */
    }
    .lessons-table tr td:last-child { border-bottom: none; }
    .lessons-table td::before {
        content: attr(data-label);
        font-weight: bold;
        padding-right: 0; /* MODIFICATION: Remove right padding */
        margin-bottom: 5px; /* NEW: Add space between label and value */
        color: var(--text-color);
        font-size: 0.8em; /* NEW: Make the label a bit smaller */
        text-transform: uppercase; /* NEW: Differentiate the label */
        color: var(--text-muted); /* NEW: Mute the label color slightly */
    }
    .lessons-table td[data-label="Select"]::before {
        display: none; /* Hide the "Select" label */
    }
    .lessons-table .lesson-actions-cell::before {
       display: none; /* Hide the "Actions" label as it's obvious */
    }
    .lessons-table .lesson-name-cell .edit-icon {
        display: inline; /* Make edit icon always visible on mobile */
        font-size: 1em; /* Make it slightly larger */
        padding: 5px; /* Increase tap area */
        opacity: 0.5;
    }

    .status-cell { align-items: flex-start; }
    .progress-lights { flex-direction: column; align-items: flex-start; gap: 6px; justify-content: flex-start; }
    .progress-lights .progress-label { display: none; }

    .hero-section { padding: 50px 0; }
    .hero-title { font-size: 2.2rem; }
    .subtitle { font-size: 1.1rem; }
    
    .steps-container { align-items: flex-start; }
    .steps-container::before { top: 5%; bottom: 5%; left: 35px; width: 2px; height: auto; right: auto; }
    .step-item { background-color: transparent; }
    
    .pricing-plan.featured { transform: scale(1); }

    .record-controls {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        margin-bottom: 20px;
    }
    .record-controls .button {
        width: 100%;
        padding: 12px;
    }
    .volume-control {
        margin-top: 15px;
        display: flex;
        flex-direction: column; /* Stack elements vertically */
        align-items: flex-start; /* Align them to the left */
        gap: 10px;
    }

    /* Ensures the slider and progress bar use the full width. */
    .volume-control input[type="range"],
    .volume-control progress {
        width: 100%;
    }
    .create-folder-form button {
        padding: 0 15px;
    }

    .student-card-new {
        grid-template-columns: 1fr; /* A single column for mobile */
        grid-template-areas:
            "info"
            "toggle"
            "actions";
        padding: 20px 0;
    }
    .sc-toggle {
        flex-direction: row; /* Place toggle and label side-by-side */
        justify-content: flex-start;
        padding: 15px 0;
        border-top: 1px solid var(--light-gray);
        border-bottom: 1px solid var(--light-gray);
        margin-top: 15px;
    }
    .analysis-nav {
        overflow-x: auto; /* Allow horizontal scrolling if needed */
        -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
        scrollbar-width: none; /* Hide scrollbar on Firefox */
    }

    .analysis-nav::-webkit-scrollbar {
        display: none; /* Hide scrollbar on Chrome/Safari */
    }
    #vocabulary-table .action-buttons-container {
    flex-direction: column; /* Stack buttons vertically */
    align-items: flex-start;
    width: 100%;
    gap: 10px;
    }

    #vocabulary-table .button-link,
    #vocabulary-table .button-link-danger {
        padding: 8px 12px;
        text-decoration: none;
        border-radius: var(--border-radius);
        font-size: 0.9rem;
        font-weight: 500;
        width: 100%; /* Make them full-width within the cell */
        text-align: center;
        border: 1px solid;
    }

    #vocabulary-table .button-link {
        background-color: var(--light-gray);
        border-color: var(--medium-gray);
        color: var(--text-color);
    }

    #vocabulary-table .button-link-danger {
        background-color: #f8d7da;
        border-color: #f5c2c7;
        color: #842029;
    }

}
.analysis-nav {
    display: flex;
    margin-bottom: -1px; /* Overlaps the top border of the card below */
    z-index: 1;
    position: relative;
}

.analysis-nav a {
    padding: 12px 20px;
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    border: 1px solid transparent;
    border-bottom: 1px solid var(--medium-gray);
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    background-color: transparent;
    transition: all 0.2s ease-in-out;
}

.analysis-nav a:hover {
    background-color: var(--light-gray);
    color: var(--text-color);
}

.analysis-nav a.active {
    color: var(--primary-color);
    border-color: var(--medium-gray) var(--medium-gray) #fff var(--medium-gray);
    background-color: #fff;
    border-bottom-color: #fff; /* Hide the bottom border to blend with the card */
}

.analysis-content {
    border-top-left-radius: 0;
}
.student-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-end;
}

.student-password-form {
    display: flex;
    gap: 5px;
}

.student-password-form input {
    font-size: 0.9em;
    padding: 5px 8px;
    max-width: 180px; /* Or whatever fits your design */
}
/* Add this to your styles for consistency */
.editable-student-name {
    position: relative;
    cursor: pointer;
    display: inline-block; /* Makes the clickable area fit the text */
    padding-right: 25px; /* Space for the pencil icon */
}
.editable-student-name .edit-icon {
    display: none;
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.7em; /* Make it smaller than the h3 text */
    opacity: 0.6;
}
.editable-student-name:hover .edit-icon {
    display: inline;
}
.inline-edit-input {
    font-size: 1em; /* Inherit font size from parent (h3) */
    padding: 6px;
    border: 1px solid var(--primary-color);
    border-radius: 4px;
    width: 100%;
}
/* Language Selector Form */
.lang-select-form {
    display: inline-block;
    margin: 0;
}
.lang-select-form select {
    background-color: var(--light-gray);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 5px 8px;
    font-size: 0.9em;
    cursor: pointer;
}
/* Add to the bottom of static/style.css */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}
.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 28px;
}
.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}
input:checked + .slider {
    background-color: var(--success-color);
}
input:checked + .slider:before {
    transform: translateX(22px);
}
.email-toggle-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
}
/* --- Account Page Tabs --- */
.tabs-nav {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 25px;
}
.tab-link {
    padding: 12px 20px;
    cursor: pointer;
    border: none;
    background: none;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-muted);
    border-bottom: 3px solid transparent;
    margin-bottom: -1px; /* Overlaps the container border */
}
.tab-link.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}
.tab-content-pane {
    display: none;
}
.tab-content-pane.active {
    display: block;
}
/* --- Flashcard Quiz Styles --- */
#flashcard-container {
    min-height: 350px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: background-color 0.3s ease;
}
.flashcard-question {
    width: 100%;
    text-align: center;
}
.question-prompt {
    font-size: clamp(1.8rem, 7vw, 2.5rem);
    font-weight: bold;
    margin-bottom: 0.5rem;
}
.example-sentence {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    font-style: italic;
}
.answer-options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}
.option-btn {
    display: block;
    width: 100%;
    padding: 15px;
    font-size: 1.1rem;
    text-align: left;
    background-color: #fff;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.2s ease;
}
.option-btn:hover:not(:disabled) {
    border-color: var(--primary-color);
    background-color: var(--light-gray);
}
.option-btn.correct {
    background-color: #d1e7dd; /* Success color */
    border-color: var(--success-color);
    color: #0f5132;
    font-weight: bold;
}
.option-btn.incorrect {
    background-color: #f8d7da; /* Danger color */
    border-color: var(--danger-color);
    color: #842029;
}
.option-btn:disabled {
    cursor: not-allowed;
}

/* Simple loading spinner */
.loading-spinner {
    border: 5px solid var(--light-gray);
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
/* --- Scramble Question Styles --- */
.scramble-prompt {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}
.scramble-answer-area {
    background-color: #fff;
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius);
    min-height: 50px;
    padding: 10px;
    margin-bottom: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: center;
}
.scramble-answer-area.correct {
    border-color: var(--success-color);
    background-color: #f0fff4;
}
.scramble-answer-area.incorrect {
    border-color: var(--danger-color);
    background-color: #fff0f1;
}
.tile-bank {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 1.5rem;
    padding: 10px;
}
.tile-btn {
    padding: 8px 15px;
    font-size: 1.1rem;
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-bottom-width: 3px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.1s ease;
}
.tile-btn:hover {
    transform: translateY(-2px);
    border-bottom-width: 5px;
}
.scramble-actions {
    margin-top: 1rem;
}
/* --- Listen & Choose Question Styles --- */
.audio-player-btn {
    display: block;
    width: 100px;
    height: 100px;
    margin: 0 auto 2.5rem auto;
    font-size: 3rem;
    border-radius: 50%;
    border: 3px solid var(--primary-color);
    background-color: var(--light-gray);
    color: var(--primary-color);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}
.audio-player-btn:hover {
    background-color: var(--primary-color);
    color: #fff;
}
.audio-player-btn:disabled {
    background-color: var(--medium-gray);
    border-color: var(--text-muted);
    color: var(--text-muted);
    cursor: not-allowed;
}
/* --- Simple Flip Question Styles --- */
.flip-card-front, .flip-card-back {
    width: 100%;
    text-align: center;
}
.flip-card-term {
    font-size: clamp(1.8rem, 7vw, 2.5rem);
    font-weight: bold;
    margin-bottom: 0.5rem;
}
.flip-card-divider {
    border: 0;
    border-top: 1px solid var(--border-color);
    margin: 1.5rem 0;
}
.flip-card-definition {
    font-size: 1.5rem;
}
.flip-card-translation {
    font-size: 1.1rem;
    color: var(--primary-color);
    font-weight: 500;
}
.rating-buttons {
    display: flex;
    justify-content: space-around;
    gap: 10px;
    margin-top: 2rem;
    width: 100%;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}
.rating-btn {
    flex: 1;
}
.timer-display {
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--text-color);
    background-color: var(--light-gray);
    padding: 5px 15px;
    border-radius: var(--border-radius);
    border: 1px solid var(--medium-gray);
    margin: 0;
    font-family: monospace;
}
@media (max-width: 768px) {
  .page-item .page-link {
    padding: 0.75rem 1rem; /* Increase padding for larger touch targets */
  }
}
.form-group-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.form-group-checkbox label {
  margin-bottom: 0; /* Override default label margin */
  font-weight: normal;
  cursor: pointer;
}
.form-group-checkbox input[type="checkbox"] {
  width: 1.15em;
  height: 1.15em;
  cursor: pointer;
}
/* --- Footer Styles --- */
.public-footer, .app-footer {
    padding: 20px 0;
    margin-top: 40px;
    background-color: #fff;
    border-top: 1px solid var(--border-color);
}
.public-footer {
    background-color: var(--text-color);
    color: #fff;
}
.public-footer p, .public-footer a {
    color: var(--medium-gray);
}
.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}
.footer-content p {
    margin: 0;
}
.footer-links {
    display: flex;
    gap: 20px;
}
.footer-links a {
    font-size: 0.9em;
    color: var(--text-muted);
}
@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
    }
}
/* --- Notification Dot for Action Center --- */
.notification-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: var(--danger-color);
    border-radius: 50%;
    margin-left: 6px;
    vertical-align: middle; /* Aligns it better with the text */

    /* Optional: Add a subtle pulsing animation to draw attention */
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(220, 53, 69, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0);
    }
}