/* YKI Finnish Theme - Shared Styling */

/* ------------------- */
/* THEME & VARIABLES   */
/* ------------------- */
:root {
    /* Colors - Finnish Theme */
    --primary-color: #003580;  /* Finnish blue */
    --primary-color-light: #e6f0ff;
    --secondary-color: #0066cc;
    --text-color: #212529;
    --text-color-light: #6c757d;
    --bg-color: #f8f9fa;
    --card-bg-color: #ffffff;
    --border-color: #dee2e6;
    --success-color: #198754;
    --success-bg-color: #d1e7dd;
    --help-color: #125f3b;        /* Dark green for help/scaffolding sections */
    --danger-color: #dc3545;
    --danger-bg-color: #f8d7da;

    /* Layout & Sizing */
    --border-radius: 8px;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    --max-width-small: 400px;    /* Home features, listening preview */
    --max-width-medium: 800px;   /* Speaking tasks, standard content */
    --max-width-large: 960px;    /* Home page, main content */
    --max-width-wide: 1400px;    /* Writing area */
    --max-width-modal: 500px;    /* Modals, progress dialogs */
    --max-width-layout: 2000px;  /* Main layout container */

    /* Responsive Breakpoints */
    --breakpoint-tablet: 768px;
    --breakpoint-desktop: 992px;

    /* Z-Index Layers */
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-sidebar: 1000;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-progress-overlay: 1060;
    --z-notification: 2000;
}

/* ------------------- */
/* BASE & LAYOUT       */
/* ------------------- */
.page-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    padding: 1.5rem;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.page-header h1 {
    font-size: 1.75rem;
    font-weight: 600;
    margin: 0;
    color: var(--primary-color);
}

.controls-bar {
    display: flex;
    align-items: stretch;
    gap: 0.75rem;
}

/* Consistent height for all controls-bar items */
.controls-bar .btn,
.controls-bar .difficulty-dropdown,
.controls-bar .dropdown-label,
.controls-bar .energy-indicator {
    height: 42px;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
}

.task-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    height: calc(100vh - 150px);
}

.task-layout.has-content {
    grid-template-columns: 1fr 1fr;
}

/* ------------------- */
/* CARDS               */
/* ------------------- */
.card {
    padding: 1.5rem;
    background-color: var(--card-bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow-y: auto;
}

.card-header {
    margin-top: 0;
    margin-bottom: 1.25rem;
    font-size: 1.2rem;
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ------------------- */
/* BUTTONS             */
/* ------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    font-size: 0.95rem;
    font-weight: 600;
    border: 1px solid var(--border-color);
    background-color: var(--card-bg-color);
    color: var(--text-color);
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s, box-shadow 0.2s;
    text-decoration: none;
}

.btn:hover:not(:disabled) {
    background-color: var(--bg-color);
    color: var(--text-color);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.btn.btn-primary:hover:not(:disabled) {
    background-color: var(--secondary-color);
    color: white;
}

.btn.btn-secondary {
    background-color: var(--card-bg-color);
    color: var(--text-color);
    border-color: var(--border-color);
}

.btn.btn-secondary:hover:not(:disabled) {
    background-color: var(--bg-color);
    color: var(--text-color);
    border-color: var(--text-color-light);
}

.btn.btn-danger {
    background-color: var(--danger-color);
    color: white;
    border-color: var(--danger-color);
}

.btn.btn-danger:hover:not(:disabled) {
    background-color: #c82333;
    color: white;
    border-color: #bd2130;
}

.btn.btn-success {
    background-color: var(--success-color);
    color: white;
    border-color: var(--success-color);
}

.btn.btn-success:hover:not(:disabled) {
    background-color: #157347;
    color: white;
    border-color: #146c43;
}

/* ------------------- */
/* FORMS & INPUTS      */
/* ------------------- */
.form-control, .text-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-control:focus, .text-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 53, 128, 0.1);
}

/* ------------------- */
/* FEEDBACK            */
/* ------------------- */
.feedback {
    margin-top: 0.75rem;
    padding: 0.75rem;
    border-radius: var(--border-radius);
    font-weight: 500;
}

.feedback.correct {
    background-color: var(--success-bg-color);
    color: var(--success-color);
    border: 1px solid var(--success-color);
}

.feedback.incorrect {
    background-color: var(--danger-bg-color);
    color: var(--danger-color);
    border: 1px solid var(--danger-color);
}

/* ------------------- */
/* ERROR MESSAGES & ALERTS */
/* ------------------- */
.error-message {
    background-color: var(--danger-bg-color);
    border: 1px solid var(--danger-color);
    color: var(--danger-color);
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
}

.alert {
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: .25rem;
}

.alert-danger {
    color: var(--danger-color);
    background-color: var(--danger-bg-color);
    border-color: #f5c6cb;
}

/* ------------------- */
/* PLACEHOLDER VIEW    */
/* ------------------- */
.placeholder-view {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--text-color-light);
    height: 100%;
    padding: 2rem;
}

.placeholder-view h2 {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.placeholder-view p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

/* ------------------- */
/* SPINNER             */
/* ------------------- */
.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-left-color: var(--primary-color);
    border-radius: 50%;
    width: 18px;
    height: 18px;
    animation: spin 1s linear infinite;
    display: inline-block;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ------------------- */
/* MODAL STYLES        */
/* ------------------- */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: var(--z-modal-backdrop);
}

.modal-dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: var(--z-modal);
    width: 90%;
    max-width: var(--max-width-modal);
}

.modal-content {
    background-color: var(--card-bg-color);
    border-radius: var(--border-radius);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    margin: 0;
    color: var(--primary-color);
    font-weight: 600;
}

.btn-close {
    border: none;
    background: transparent;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-color-light);
}

.modal-body {
    padding: 1rem;
}

.form-group {
    margin-bottom: 1rem;
}

.modal-footer {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.validation-message {
    color: var(--danger-color);
    font-size: 0.8em;
    margin-top: 0.25rem;
}

/* ------------------- */
/* VOCABULARY/MATCHING GAMES */
/* ------------------- */
.match-grid-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 20px auto;
}

.word-column {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.verb-button {
    width: 100%;
    padding: 10px;
    font-size: 1.1rem;
    border: 2px solid var(--border-color);
    background-color: var(--card-bg-color);
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 6px;
    text-align: center;
    font-weight: 500;
    color: var(--text-color);
}

.verb-button:hover:not(:disabled) {
    background-color: var(--bg-color);
    border-color: var(--text-color-light);
}

.verb-button:disabled {
    cursor: default;
    opacity: 0.6;
}

.verb-button.selected {
    background-color: var(--primary-color-light);
    border-color: var(--primary-color);
    font-weight: 600;
}

.verb-button.correct {
    background-color: var(--success-bg-color);
    border-color: var(--success-color);
    font-weight: 600;
}

.verb-button.incorrect {
    background-color: var(--danger-bg-color);
    border-color: var(--danger-color);
    font-weight: 600;
}

.feedback-message {
    text-align: center;
    font-size: 1.2rem;
    margin-top: 20px;
    font-weight: bold;
    color: var(--text-color);
}

.component-header {
    margin-top: 1.5rem;
}

.component-header h4 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

/* ------------------- */
/* RESPONSIVE DESIGN   */
/* ------------------- */
@media (max-width: var(--breakpoint-desktop)) {
    .page-header {
        flex-direction: column;
        align-items: center;
    }

    .controls-bar {
        flex-wrap: wrap;
    }

    .task-layout.has-content {
        grid-template-columns: 1fr;
    }

    .match-grid-container {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .controls-bar {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.75rem;
    }

    .difficulty-option, .model-option {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        width: 100%;
    }

    .dropdown-label, .checkbox-label {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
    }

    .controls-bar > .btn {
        align-self: stretch;
    }
}

/* ===================== */
/* CONTROLS BAR LAYOUT   */
/* ===================== */
.controls-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* ===================== */
/* DIFFICULTY DROPDOWN   */
/* ===================== */
.difficulty-option {
    display: flex;
    align-items: center;
}

.dropdown-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-color);
    user-select: none;
}

.difficulty-dropdown {
    padding: 0.6rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--card-bg-color);
    color: var(--text-color);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 80px;
}

.difficulty-dropdown:hover {
    background-color: var(--bg-color);
}

.difficulty-dropdown:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 53, 128, 0.1);
}

/* ===================== */
/* MODEL OPTION          */
/* ===================== */
.model-option {
    display: flex;
    align-items: center;
}

/* ===================== */
/* MOBILE IMPROVEMENTS   */
/* ===================== */
@media (max-width: 768px) {
    /* Better mobile typography */
    body {
        font-size: 16px;
        overflow-x: hidden;
    }

    /* Tighter page padding - lock horizontal */
    .page-container {
        padding: 1rem;
        overflow-x: hidden;
        max-width: 100vw;
    }

    .page-header h1 {
        font-size: 1.4rem;
    }

    /* Card adjustments */
    .card {
        padding: 1rem;
        overflow-x: hidden;
        max-width: 100%;
    }

    .card-header {
        font-size: 1.1rem;
        position: relative;
        overflow: hidden;
    }

    /* Touch-friendly buttons */
    .btn {
        min-height: 44px;
        padding: 0.75rem 1rem;
    }

    /* Task layout spacing */
    .task-layout {
        gap: 1rem;
        height: auto;
    }

    /* Text pane mobile - restructure for sticky header */
    .text-pane {
        max-height: 45vh;
        overflow-y: auto;
        overflow-x: hidden;
        padding: 0;
    }

    .text-pane .card-header {
        position: sticky;
        top: 0;
        background: var(--card-bg-color);
        z-index: 2;
        padding: 0.875rem 1rem;
        margin: 0;
        border-bottom: 1px solid var(--border-color);
        min-height: 3.25rem;
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .text-pane .text-content {
        padding: 1rem;
    }

    /* ===================== */
    /* ICON-ONLY BUTTONS     */
    /* ===================== */
    /* Hide button text, show only icons */
    .controls-bar .btn > span {
        display: none;
    }

    /* Hide difficulty label text on mobile, keep only dropdown */
    .dropdown-label .label-text {
        display: none;
    }
}

/* ===================== */
/* SHARED FORM CONTROLS  */
/* ===================== */

/* Custom Checkbox */
.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-color);
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.checkmark {
    height: 18px;
    width: 18px;
    background-color: var(--card-bg-color);
    border: 2px solid var(--border-color);
    border-radius: 3px;
    margin-right: 0.5rem;
    position: relative;
    transition: all 0.2s ease;
}

.checkbox-label:hover .checkmark {
    border-color: var(--primary-color);
}

.checkbox-label input:checked ~ .checkmark {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 5px;
    top: 1px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-label input:checked ~ .checkmark:after {
    display: block;
}

/* Custom Radio Button */
.custom-radio {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.custom-radio:hover {
    background-color: var(--bg-color);
}

.custom-radio input {
    display: none;
}

.radio-check {
    width: 20px;
    height: 20px;
    min-width: 20px;
    min-height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    margin-right: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: border-color 0.2s;
}

.radio-check::after {
    content: '';
    width: 10px;
    height: 10px;
    background-color: var(--primary-color);
    border-radius: 50%;
    transform: scale(0);
    transition: transform 0.2s;
}

.custom-radio input:checked + .radio-check {
    border-color: var(--primary-color);
}

.custom-radio input:checked + .radio-check::after {
    transform: scale(1);
}

/* Feature Preview Box */
.feature-preview {
    background-color: var(--card-bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    text-align: left;
    max-width: 400px;
    box-shadow: var(--box-shadow);
}

.feature-preview h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.feature-preview ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.feature-preview li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.feature-preview li:last-child {
    border-bottom: none;
}

/* Feedback Section */
.feedback-section {
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
    margin-top: 1rem;
}

.feedback-section h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.feedback-content {
    background-color: var(--bg-color);
    padding: 1rem;
    border-radius: var(--border-radius);
    line-height: 1.6;
}

/* Response Textarea */
.response-textarea {
    width: 100%;
    border: 1px solid var(--border-color);
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.response-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-color-light);
}

/* Control Button (recording/playback) */
.control-button {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    min-width: 140px;
    padding: 0.8rem 1.2rem;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.control-button:hover:not(:disabled) {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

/* Icon Button (circular) */
.icon-button {
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.icon-button.edit {
    background: rgba(0, 53, 128, 0.1);
    color: var(--primary-color);
}

.icon-button.edit:hover {
    background: var(--primary-color);
    color: white;
}

.icon-button.delete {
    background: rgba(220, 53, 69, 0.1);
    color: var(--danger-color);
}

.icon-button.delete:hover {
    background: var(--danger-color);
    color: white;
}

/* Model Option */
.model-option {
    margin-left: 1rem;
}

/* Generate Section */
.generate-section {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
}

/* ===================== */
/* SHARED RESPONSIVE     */
/* ===================== */
@media (max-width: 992px) {
    .generate-section {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .model-option {
        margin-left: 0;
        margin-top: 0.5rem;
    }

    .feature-preview {
        max-width: 100%;
    }
}

/* ================================ */
/* GLOBAL NAV STYLES (CSS Isolation Fix) */
/* ================================ */

.page {
    position: relative;
    min-height: 100vh;
    background-color: #f8f9fa;
}

.main-content {
    min-height: 100vh;
    transition: margin-left 0.3s ease;
    position: relative;
}

.nav-toggle-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: calc(var(--z-sidebar) + 1);
    width: 48px;
    height: 48px;
    background-color: #002F6C !important;
    background: #002F6C !important;
    border: none !important;
    border-radius: 12px;
    cursor: pointer;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important;
}

.nav-toggle-btn:hover {
    background-color: #003d87 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
}

.hamburger-line {
    width: 20px;
    height: 2px;
    background: white !important;
    border-radius: 2px;
    display: block !important;
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: calc(var(--z-sidebar) - 1);
    touch-action: none;
    overscroll-behavior: contain;
}

/* Prevent background scroll when sidebar is open (mobile) */
body:has(.sidebar-overlay) {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

.content {
    padding: 100px 20px 20px;
    margin: 0 auto;
}

/* Sidebar styles */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 300px;
    height: 100vh;
    background-color: #ffffff !important;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: var(--z-sidebar);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow-y: auto;
    padding: 0;
}

.sidebar.open {
    transform: translateX(0);
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 30px 25px 25px;
    background: linear-gradient(135deg, #002F6C 0%, #003d87 100%) !important;
    color: #ffffff;
    margin-bottom: 20px;
}

.brand-logo {
    width: 45px;
    height: 45px;
    background: rgba(255,255,255,0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    border: 2px solid rgba(255,255,255,0.3);
}

.brand-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0;
}

.nav-section {
    margin-bottom: 30px;
    padding: 0 25px;
    background-color: #ffffff !important;
}

.section-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary-color);
    margin: 0 0 12px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background-color: #ffffff !important;
}

.nav-btn {
    display: block !important;
    padding: 12px 16px !important;
    background-color: #ffffff !important;
    border: 2px solid #dee2e6 !important;
    border-radius: 10px !important;
    color: #2c3e50 !important;
    text-decoration: none !important;
    font-weight: 500;
    font-size: 0.95rem;
    text-align: center;
    transition: all 0.3s ease;
}

.nav-btn:hover {
    background-color: #E8F0FF !important;
    border-color: #002F6C !important;
    color: #002F6C !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,47,108,0.15) !important;
}

.nav-btn.active {
    background-color: #002F6C !important;
    border-color: #002F6C !important;
    color: #ffffff !important;
    font-weight: 600;
}

.logout-btn {
    background-color: #dc3545 !important;
    border-color: #dc3545 !important;
    color: #ffffff !important;
    border: none;
    cursor: pointer;
    padding: 12px 16px;
    width: 100%;
    text-align: left;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 500;
}

.logout-btn:hover {
    background-color: #c82333 !important;
}

/* Desktop styles */
@media (min-width: 1024px) {
    .main-content.sidebar-open {
        margin-left: 300px;
    }

    .sidebar-overlay {
        display: none;
    }

    .nav-toggle-btn {
        top: 30px;
        left: 30px;
    }

    .content {
        padding: 100px 40px 40px;
    }
}

/* Loading spinner */
.loading-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
    gap: 1.5rem;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e9ecef;
    border-top: 4px solid #002F6C;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    font-size: 1.1rem;
    color: #6c757d;
    font-weight: 500;
    margin: 0;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ================================ */
/* TEXT PANE & QUESTIONS (Shared)   */
/* ================================ */

.word-count {
    font-size: 0.85rem;
    font-weight: normal;
    color: var(--primary-color);
    margin-left: 0.75rem;
    padding: 0.25rem 0.5rem;
    background-color: var(--primary-color-light);
    border-radius: 4px;
}

.text-content {
    line-height: 1.7;
    font-size: 1.05rem;
}

.question-block {
    margin-bottom: 2rem;
}

.question-text {
    font-size: 1.1rem;
    line-height: 1.5;
    margin-bottom: 0.75rem;
}

/* ================================ */
/* HEADER ACTIONS & BUTTONS         */
/* ================================ */

/* Container for header action buttons - pushes to the right via flexbox */
.header-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.copy-text-btn,
.fullscreen-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 6px 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color-light);
    transition: all 0.2s;
}

.copy-text-btn:hover,
.fullscreen-btn:hover {
    background: var(--bg-color);
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.close-fullscreen-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background: var(--card-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    transition: all 0.2s;
}

.close-fullscreen-btn:hover {
    background: var(--danger-color);
    color: white;
    border-color: var(--danger-color);
}

.text-pane.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: var(--z-modal);
    max-height: none;
    overflow-y: auto;
    border-radius: 0;
    margin: 0;
    background: var(--card-bg-color);
}

.text-pane.fullscreen .card-header {
    position: sticky;
    top: 0;
    background: var(--card-bg-color);
    z-index: 1;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 4rem 1rem 1.5rem;
}

.text-pane.fullscreen .text-content {
    font-size: 1.25rem;
    line-height: 2;
    padding: 2rem;
    max-width: 750px;
    margin: 0 auto;
}

/* ------------------- */
/* ENERGY INDICATOR    */
/* ------------------- */
.energy-indicator {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0 0.75rem;
    background: var(--card-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-color);
    margin-left: auto;
}

.energy-indicator .battery-icon {
    flex-shrink: 0;
}

.energy-indicator .battery-icon.battery-full {
    color: var(--success-color);
}

.energy-indicator .battery-icon.battery-medium {
    color: #f0ad4e;
}

.energy-indicator .battery-icon.battery-low {
    color: var(--danger-color);
}

.energy-indicator .energy-count {
    min-width: 1.2em;
    text-align: center;
}

@media (max-width: 768px) {
    .controls-bar .btn,
    .controls-bar .difficulty-dropdown,
    .controls-bar .dropdown-label,
    .controls-bar .energy-indicator {
        height: 38px;
    }

    .energy-indicator {
        padding: 0 0.5rem;
        font-size: 0.8rem;
    }

    .energy-indicator .battery-icon {
        width: 18px;
        height: 18px;
    }
}

/* ================================ */
/* NOTIFICATION TOASTS              */
/* ================================ */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: var(--z-notification);
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
    pointer-events: none;
}

.notification-toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background-color: var(--card-bg-color);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-left: 4px solid var(--border-color);
    pointer-events: auto;
    animation: notification-slide-in 0.3s ease-out;
}

@keyframes notification-slide-in {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification-toast.info {
    border-left-color: var(--primary-color);
}

.notification-toast.success {
    border-left-color: var(--success-color);
}

.notification-toast.warning {
    border-left-color: #f0ad4e;
}

.notification-toast.error {
    border-left-color: var(--danger-color);
}

.notification-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.notification-toast.info .notification-icon {
    color: var(--primary-color);
}

.notification-toast.success .notification-icon {
    color: var(--success-color);
}

.notification-toast.warning .notification-icon {
    color: #f0ad4e;
}

.notification-toast.error .notification-icon {
    color: var(--danger-color);
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-message {
    font-size: 0.95rem;
    line-height: 1.4;
    color: var(--text-color);
    word-wrap: break-word;
}

.notification-close {
    padding: 2px 6px;
    font-size: 1.1rem;
    line-height: 1;
    border: none;
    background: transparent;
    color: var(--text-color-light);
    cursor: pointer;
    transition: color 0.2s;
}

.notification-close:hover {
    color: var(--text-color);
}

@media (max-width: 768px) {
    .notification-container {
        top: 80px;
        right: 10px;
        left: 10px;
        max-width: none;
    }

    .notification-toast {
        padding: 12px 14px;
    }
}

/* ================================ */
/* DASHBOARD STYLES                 */
/* ================================ */

.dashboard-page {
    max-width: 1200px;
    margin: 0 auto;
}

.dashboard-page .subtitle {
    color: var(--text-color-light);
    margin-top: 0.5rem;
}

.dashboard-section {
    background: var(--card-bg-color);
    border-radius: var(--border-radius);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.dashboard-section h2 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

.section-subtitle {
    color: var(--text-color-light);
    margin-top: -1rem;
    margin-bottom: 1.5rem;
}

/* Topic Rotation Timeline */
.topic-rotation-section {
    background: linear-gradient(135deg, var(--card-bg-color) 0%, var(--primary-color-light) 100%);
}

.topic-timeline {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 1.5rem 0;
    overflow-x: auto;
    gap: 0;
}

.timeline-point {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 70px;
    position: relative;
    cursor: pointer;
}

.timeline-point:hover .point-marker {
    transform: scale(1.15);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.timeline-point:hover .point-label {
    color: var(--primary-color);
}

.point-marker {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-color);
    border: 3px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.2s ease;
    z-index: 2;
}

.point-number {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-color-light);
}

.timeline-point.past .point-marker {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.timeline-point.past .point-number {
    color: white;
}

.timeline-point.active .point-marker {
    background: var(--primary-color);
    border-color: var(--primary-color);
    transform: scale(1.2);
    box-shadow: 0 0 0 4px var(--primary-color-light);
}

.timeline-point.active .point-number {
    color: white;
}

.pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--primary-color);
    opacity: 0.4;
    animation: pulse-animation 2s infinite;
}

@keyframes pulse-animation {
    0% { transform: scale(1); opacity: 0.4; }
    50% { transform: scale(1.5); opacity: 0; }
    100% { transform: scale(1); opacity: 0; }
}

.point-label {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-color-light);
    text-align: center;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.timeline-point.active .point-label {
    color: var(--primary-color);
    font-weight: 600;
}

.timeline-connector {
    flex: 1;
    height: 3px;
    background: var(--border-color);
    margin-top: 16px;
    min-width: 20px;
    transition: background 0.3s ease;
}

.timeline-connector.past {
    background: var(--primary-color);
}

/* Current Topic Card - Chips Style */
.current-topic-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
    background: var(--bg-color);
    border: 2px solid var(--primary-color);
    border-radius: var(--border-radius);
    padding: 1.25rem 1.5rem;
    margin-top: 1rem;
}

.topic-header-row {
    width: 100%;
}

.topic-value-large {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary-color);
}

.subtopic-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    width: 100%;
}

.subtopic-chip {
    padding: 0.5rem 1rem;
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-color-light);
    transition: all 0.2s ease;
    cursor: pointer;
}

.subtopic-chip:hover {
    border-color: var(--primary-color);
    background: var(--primary-color-light);
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.subtopic-chip.past {
    border-color: var(--primary-color);
    background: var(--primary-color-light);
    color: var(--primary-color);
}

.subtopic-chip.active {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 102, 204, 0.3);
}

.subtopic-chip.active:hover {
    transform: none;
    box-shadow: 0 2px 8px rgba(0, 102, 204, 0.3);
}

/* Writing Scenarios Section */
.writing-scenarios-section {
    background: linear-gradient(135deg, var(--card-bg-color) 0%, #f0f4f8 100%);
}

.writing-scenarios-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.writing-scenario-card {
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1rem 1.25rem;
    transition: all 0.2s ease;
}

.writing-scenario-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.scenario-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.scenario-type {
    font-weight: 700;
    font-size: 1rem;
    color: var(--primary-color);
}

.scenario-stepper {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.stepper-btn {
    width: 24px;
    height: 24px;
    border: none;
    background: var(--card-bg-color);
    color: var(--text-color-light);
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    transition: all 0.15s ease;
    padding: 0;
}

.stepper-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.1);
}

.stepper-btn:active {
    transform: scale(0.95);
}

.scenario-index {
    font-size: 0.75rem;
    color: var(--text-color-light);
    background: var(--card-bg-color);
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    min-width: 45px;
    text-align: center;
}

.scenario-content {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.scenario-context {
    font-size: 0.8rem;
    color: var(--text-color-light);
    font-style: italic;
}

.scenario-topic {
    font-size: 0.95rem;
    color: var(--text-color);
    font-weight: 500;
}

.scenario-recipient {
    font-size: 0.95rem;
    color: var(--text-color);
    font-weight: 600;
}

.scenario-situation {
    font-size: 0.9rem;
    color: var(--text-color);
}

.scenario-register {
    font-size: 0.75rem;
    color: var(--text-color-light);
    background: var(--card-bg-color);
    padding: 0.15rem 0.5rem;
    border-radius: 8px;
    width: fit-content;
    margin-top: 0.25rem;
}

.scenario-translation {
    font-size: 0.8rem;
    color: var(--text-color-light);
    font-style: italic;
    margin-top: 0.25rem;
}

/* Speaking Scenarios Section */
.speaking-scenarios-section {
    background: linear-gradient(135deg, var(--card-bg-color) 0%, #e8f5f2 100%);
}

.speaking-scenarios-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.speaking-scenario-card {
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1rem 1.25rem;
    transition: all 0.2s ease;
}

.speaking-scenario-card:hover {
    border-color: #009688;
    box-shadow: 0 2px 8px rgba(0, 150, 136, 0.15);
}

.speaking-scenario-card .scenario-type {
    color: #009688;
}

/* Weakness Cards */
.weakness-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.weakness-card {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
}

.weakness-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1rem;
}

.weakness-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-color);
}

.severity-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.severity-minor {
    background: #e3f2fd;
    color: #1976d2;
}

.severity-moderate {
    background: #fff3e0;
    color: #f57c00;
}

.severity-critical {
    background: #ffebee;
    color: #c62828;
}

.weakness-stats {
    display: flex;
    gap: 2rem;
    margin-bottom: 1rem;
}

.weakness-context {
    background: var(--primary-color-light);
    padding: 0.75rem;
    border-radius: 6px;
    font-size: 0.9rem;
    margin-top: 1rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    text-align: center;
}

.stat-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 0.5rem;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
}

.stat-card h3 {
    margin: 0.5rem 0;
    font-size: 1rem;
    color: var(--text-color-light);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-card .stat-label {
    color: var(--text-color-light);
    font-size: 0.9rem;
}

.stat-score {
    margin-top: 0.5rem;
    color: var(--success-color);
    font-weight: 600;
}

/* Activity List */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.activity-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
}

.activity-icon {
    width: 36px;
    height: 36px;
    min-width: 36px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
}

.activity-content {
    flex: 1;
}

.activity-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.25rem;
}

.activity-difficulty {
    padding: 0.125rem 0.5rem;
    background: var(--primary-color-light);
    color: var(--primary-color);
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.activity-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--text-color-light);
}

.activity-score {
    color: var(--success-color);
    font-weight: 600;
}

.activity-issues {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.issue-tag {
    padding: 0.25rem 0.5rem;
    background: #f5f5f5;
    border-radius: 4px;
    font-size: 0.75rem;
    color: #666;
}

.issue-tag-more {
    padding: 0.25rem 0.5rem;
    color: var(--primary-color);
    font-size: 0.75rem;
    font-weight: 600;
}

/* Improved Topics */
.improved-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.improved-item {
    display: flex;
    gap: 1rem;
    align-items: center;
    padding: 0.75rem;
    background: #f0f9ff;
    border-left: 4px solid #0ea5e9;
    border-radius: 6px;
}

.improved-icon {
    width: 32px;
    height: 32px;
    background: #0ea5e9;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.improved-content {
    display: flex;
    flex-direction: column;
}

.improved-meta {
    font-size: 0.85rem;
    color: var(--text-color-light);
}

/* Summary Section */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.summary-item {
    text-align: center;
}

.summary-number {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
}

.summary-label {
    color: var(--text-color-light);
    margin-top: 0.5rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-color-light);
}

.empty-state p {
    font-size: 1.1rem;
}

/* Dashboard Responsive */
@media (max-width: 768px) {
    .dashboard-section {
        padding: 1.5rem;
    }

    .weakness-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .summary-grid {
        grid-template-columns: 1fr;
    }

    /* Timeline mobile */
    .topic-timeline {
        padding: 1rem 0;
    }

    .timeline-point {
        min-width: 50px;
    }

    .point-marker {
        width: 28px;
        height: 28px;
    }

    .point-number {
        font-size: 0.75rem;
    }

    .point-label {
        font-size: 0.65rem;
    }

    .timeline-connector {
        min-width: 10px;
        margin-top: 12px;
    }

    .current-topic-card {
        text-align: center;
        align-items: center;
    }

    .subtopic-chips {
        justify-content: center;
    }
}

/* ================================ */
/* SPELLING GAME                    */
/* ================================ */

/* Spelling page container override */
.spelling-page {
    max-width: 500px;
    margin: 0 auto;
}

/* Spelling list selection */
.spelling-list-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.spelling-list-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: var(--card-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 100px;
}

.spelling-list-btn:hover {
    background: var(--bg-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.spelling-list-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
}

.spelling-list-count {
    font-size: 0.85rem;
    color: var(--text-color-light);
    margin-top: 5px;
}

/* Spelling game header */
.spelling-game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    margin-bottom: 10px;
}

.spelling-progress {
    font-weight: 600;
    color: var(--primary-color);
}

.spelling-score {
    font-weight: 500;
    color: var(--text-color-light);
}

/* Spelling prompt card */
.spelling-prompt {
    text-align: center;
    padding: 1.5rem;
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    background: var(--card-bg-color);
    margin-bottom: 20px;
}

.spelling-prompt-label {
    font-size: 0.9rem;
    color: var(--text-color-light);
    margin-bottom: 8px;
}

.spelling-prompt-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
}

/* Spelling answer area */
.spelling-answer {
    background: var(--bg-color);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 20px;
}

.spelling-slots {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.spelling-slot {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 600;
    border: 2px dashed var(--border-color);
    border-radius: 6px;
    background: var(--card-bg-color);
    color: var(--text-color);
    text-transform: lowercase;
}

.spelling-slot.filled {
    border-style: solid;
    border-color: var(--primary-color);
    background: var(--primary-color-light);
}

/* Spelling letter chips */
.spelling-chips-area {
    margin-bottom: 20px;
}

.spelling-chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.spelling-chip {
    width: 48px;
    height: 48px;
    font-size: 1.4rem;
    font-weight: 600;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--card-bg-color);
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.2s;
    text-transform: lowercase;
}

.spelling-chip:hover:not(:disabled) {
    background: var(--primary-color-light);
    border-color: var(--primary-color);
}

.spelling-chip.used {
    opacity: 0.3;
    cursor: default;
}

.spelling-chip.shake {
    animation: spelling-shake 0.3s;
}

@keyframes spelling-shake {
    0%, 100% {
        transform: translateX(0);
        background: var(--card-bg-color);
    }
    25% {
        transform: translateX(-4px);
        background: var(--danger-bg-color);
    }
    75% {
        transform: translateX(4px);
        background: var(--danger-bg-color);
    }
}

/* Spelling action buttons */
.spelling-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.spelling-skip-btn,
.spelling-hint-btn {
    min-width: 100px;
    justify-content: center;
    text-align: center;
}

/* Spelling results */
.spelling-results {
    text-align: center;
    padding: 2rem 1rem;
    background: var(--card-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-top: 20px;
}

.spelling-final-score {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.spelling-results-subtitle {
    color: var(--text-color-light);
    margin-bottom: 20px;
}

.spelling-results-list {
    text-align: left;
    margin-top: 20px;
}

.spelling-result-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    border-radius: 6px;
    margin-bottom: 8px;
}

.spelling-result-row.correct {
    background: var(--success-bg-color);
}

.spelling-result-row.incorrect {
    background: var(--danger-bg-color);
}

.spelling-result-finnish {
    font-weight: 600;
    flex: 1;
}

.spelling-result-separator {
    color: var(--text-color-light);
}

.spelling-result-english {
    flex: 1;
}

.spelling-result-icon {
    font-weight: bold;
    width: 24px;
    text-align: center;
}

.spelling-result-row.correct .spelling-result-icon {
    color: var(--success-color);
}

.spelling-result-row.incorrect .spelling-result-icon {
    color: var(--danger-color);
}

/* Spelling mobile adjustments */
@media (max-width: 768px) {
    .spelling-chip {
        width: 44px;
        height: 44px;
        font-size: 1.2rem;
    }

    .spelling-slot {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    .spelling-prompt-text {
        font-size: 1.3rem;
    }
}

/* ================================ */
/* VOCABULARY HUB PAGE              */
/* ================================ */

.vocabulary-page {
    max-width: 800px;
    margin: 0 auto;
}

.vocabulary-list-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.vocabulary-list-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: var(--card-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 100px;
}

.vocabulary-list-btn:hover {
    background: var(--bg-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.vocabulary-list-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
}

.vocabulary-list-count {
    font-size: 0.85rem;
    color: var(--text-color-light);
    margin-top: 5px;
}

.vocabulary-list-translated {
    font-size: 0.75rem;
    color: var(--success-color);
    margin-top: 3px;
}

/* Word list table for edit mode */
.word-list-table {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 20px;
}

.word-list-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--card-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.word-finnish {
    flex: 1;
    font-weight: 600;
    color: var(--text-color);
}

.word-separator {
    color: var(--text-color-light);
}

.word-english {
    flex: 1;
    color: var(--text-color);
}

.word-needs-translation {
    color: var(--text-color-light);
    font-style: italic;
    cursor: pointer;
}

.word-needs-translation:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.word-editable {
    cursor: pointer;
    border-radius: 4px;
    padding: 2px 4px;
    margin: -2px -4px;
    transition: background-color 0.15s;
}

.word-editable:hover {
    background-color: var(--primary-color-light);
}

.word-delete-btn {
    width: 32px;
    height: 32px;
    min-width: 32px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-color-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.word-delete-btn:hover {
    background: rgba(220, 53, 69, 0.1);
    border-color: var(--danger-color);
    color: var(--danger-color);
}

/* Move to List Button */
.word-move-btn {
    width: 32px;
    height: 32px;
    min-width: 32px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-color-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.word-move-btn:hover {
    background: rgba(0, 53, 128, 0.1);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Move Popup */
.move-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: var(--z-modal);
    background: var(--card-bg-color);
    border-radius: var(--border-radius);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    min-width: 280px;
    max-width: 350px;
    overflow: hidden;
}

.move-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-color);
}

.move-popup-title {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.move-popup-title > span:first-child {
    font-size: 0.85rem;
    color: var(--text-color-light);
    text-transform: uppercase;
}

.move-popup-word {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.move-popup-lists {
    display: flex;
    flex-direction: column;
    max-height: 300px;
    overflow-y: auto;
}

.move-list-btn {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.875rem 1rem;
    background: var(--card-bg-color);
    border: none;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.95rem;
    color: var(--text-color);
    cursor: pointer;
    transition: background-color 0.2s;
    text-align: left;
}

.move-list-btn:last-child {
    border-bottom: none;
}

.move-list-btn:hover {
    background: var(--primary-color-light);
}

.move-list-count {
    color: var(--text-color-light);
    font-size: 0.8rem;
}

.move-popup-empty {
    padding: 1.5rem 1rem;
    text-align: center;
    color: var(--text-color-light);
    margin: 0;
    font-style: italic;
}

/* ================================ */
/* VOCABULARY MANAGE PAGE           */
/* ================================ */

.vocabulary-manage-page {
    max-width: 700px;
    margin: 0 auto;
}

.manage-sections {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-top: 20px;
}

.manage-section {
    background: var(--card-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
}

.manage-section .section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 16px 0;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.section-content {
    margin-top: 12px;
}

.section-hint {
    margin-top: 12px;
    font-size: 0.85rem;
    color: var(--text-color-light);
}

.create-list-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-row {
    display: flex;
    gap: 10px;
}

.form-row .form-control {
    flex: 1;
}

.backup-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.lists-table {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.list-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.list-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.list-info-clickable {
    background: transparent;
    border: none;
    padding: 0;
    text-align: left;
    cursor: pointer;
    flex: 1;
    min-width: 0;
    border-radius: 4px;
    padding: 4px 8px;
    margin: -4px -8px;
    transition: background-color 0.15s ease;
}

.list-info-clickable:hover {
    background-color: var(--hover-bg-color, rgba(0, 0, 0, 0.05));
}

.list-info-clickable:hover .list-name {
    color: var(--primary-color);
}

.list-row .list-name {
    font-weight: 600;
    color: var(--text-color);
}

.list-stats {
    font-size: 0.85rem;
    color: var(--text-color-light);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
}

.empty-hint {
    color: var(--text-color-light);
    font-style: italic;
    text-align: center;
    padding: 20px;
}

/* ================================ */
/* VOCABULARY ACTION MODAL          */
/* ================================ */

.action-modal {
    max-width: 400px;
}

.action-modal-body {
    padding: 1.5rem;
}

.action-modal-subtitle {
    text-align: center;
    color: var(--text-color-light);
    margin-bottom: 1.5rem;
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 1.25rem;
    background: var(--card-bg-color);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.action-btn:hover:not(:disabled) {
    border-color: var(--primary-color);
    background: var(--primary-color-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.action-btn svg {
    color: var(--primary-color);
}

.action-btn:disabled svg {
    color: var(--text-color-light);
}

.action-label {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
}

.action-desc {
    font-size: 0.85rem;
    color: var(--text-color-light);
}

.action-desc.disabled-hint {
    color: var(--danger-color);
    font-style: italic;
}

/* ================================ */
/* SHARED HEADER STYLES             */
/* ================================ */

.back-btn {
    padding: 8px 12px;
}

.header-title-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-title-group h3 {
    margin: 0;
}

.header-title-group p {
    margin: 0;
    color: var(--text-color-light);
    font-size: 0.9rem;
}

/* ================================ */
/* NAV BUTTONS GRID                 */
/* ================================ */

.nav-buttons.nav-buttons-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

/* ================================ */
/* ACCOUNT PAGE STYLES              */
/* ================================ */

.account-container {
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    background-color: var(--bg-color);
    padding: 2rem 1rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.account-card {
    width: 100%;
    max-width: 500px;
    background-color: var(--card-bg-color);
    border-radius: var(--border-radius);
    box-shadow: 0 8px 25px rgba(0, 53, 128, 0.1);
    overflow: hidden;
}

.account-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 2rem 1.5rem;
    text-align: center;
}

.account-avatar {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 auto 1rem;
    border: 3px solid rgba(255, 255, 255, 0.3);
}

.account-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 0.75rem 0;
}

.account-role-badge {
    display: inline-block;
    padding: 0.25rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.account-role-badge.role-admin {
    background: rgba(220, 53, 69, 0.9);
}

.account-role-badge.role-teacher {
    background: rgba(40, 167, 69, 0.9);
}

.account-role-badge.role-student {
    background: rgba(255, 255, 255, 0.2);
}

.account-content {
    padding: 1.5rem;
}

.account-info-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.account-info-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.account-section-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-color-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 1rem 0;
}

.account-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.account-info-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.account-info-item.full-width {
    grid-column: 1 / -1;
}

.account-info-label {
    font-size: 0.85rem;
    color: var(--text-color-light);
}

.account-info-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
}

.account-info-value.highlight {
    color: var(--primary-color);
    font-size: 1.25rem;
}

.account-info-value.status-active {
    color: var(--success-color);
}

.account-info-value.status-inactive {
    color: var(--danger-color);
}

.account-usage-bar-container {
    height: 8px;
    background-color: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    margin: 1rem 0 0.5rem;
}

.account-usage-bar {
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.account-usage-hint {
    font-size: 0.85rem;
    color: var(--text-color-light);
    margin: 0.75rem 0 0 0;
    font-style: italic;
}

.account-no-data {
    text-align: center;
    color: var(--text-color-light);
    padding: 2rem 0;
}

.account-action-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.btn-account {
    flex: 1;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-account.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: #ffffff;
}

.btn-account.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 53, 128, 0.3);
}

.btn-account.btn-logout {
    background-color: var(--danger-color);
    color: #ffffff;
}

.btn-account.btn-logout:hover {
    background-color: #c82333;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

@media (max-width: 480px) {
    .account-container {
        padding: 1rem 0.5rem;
    }

    .account-info-grid {
        grid-template-columns: 1fr;
    }

    .account-avatar {
        width: 60px;
        height: 60px;
        font-size: 2rem;
    }
}

/* ================================ */
/* COLLAPSIBLE SECTIONS             */
/* ================================ */

.collapsible-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s;
}

.collapsible-header:hover {
    background-color: var(--primary-color-light);
}

.collapse-icon {
    flex-shrink: 0;
    transition: transform 0.3s ease;
    color: var(--text-color-light);
}

.collapse-icon.rotated {
    transform: rotate(-90deg);
}

.collapsible-content {
    overflow: hidden;
    max-height: 2000px;
    transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
    opacity: 1;
}

.collapsible-content.hidden {
    max-height: 0;
    opacity: 0;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

.card.collapsed {
    padding-bottom: 0;
}

.card.collapsed .card-header {
    margin-bottom: 0;
    border-radius: var(--border-radius);
}

/* ================================ */
/* LANDING PAGE                      */
/* ================================ */
.landing-container {
    width: 90%;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.landing-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.landing-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.landing-subtitle {
    font-size: 1.25rem;
    color: var(--text-color-light);
    margin-bottom: 1rem;
}

.landing-description {
    font-size: 1.05rem;
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto 1.5rem;
}

.landing-cta {
    font-size: 1.1rem;
    padding: 0.75rem 2rem;
}

.landing-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
}

.landing-footer {
    text-align: center;
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

/* Preview section styling */
.preview-section {
    padding: 0;
    overflow: visible;
    transition: box-shadow 0.2s ease;
}

.preview-section:hover {
    box-shadow: 0 4px 12px rgba(0, 53, 128, 0.1);
}

.preview-section .section-icon {
    display: flex;
    align-items: center;
    color: var(--primary-color);
}

.preview-section .section-icon svg {
    flex-shrink: 0;
}

/* Preview section collapsible header */
.preview-section.card > .card-header.collapsible-header {
    margin: 0;
    padding: 1rem 1.25rem;
    background-color: white;
    border-bottom: 1px solid var(--border-color);
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.15s ease;
}

.preview-section.card > .card-header.collapsible-header:hover {
    background-color: var(--primary-color-light);
}

.preview-section.collapsed.card > .card-header.collapsible-header {
    border-bottom: none;
    border-radius: var(--border-radius);
}

.preview-section.card > .card-header.collapsible-header > span:not(.section-icon) {
    flex-grow: 1;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
}

.preview-section.card > .card-header.collapsible-header > .collapse-icon {
    flex-grow: 0;
    flex-shrink: 0;
    color: var(--text-color-light);
    transition: transform 0.2s ease;
}

.section-description {
    color: var(--text-color-light);
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

/* Preview section collapsible content spacing */
.preview-section > .collapsible-content {
    padding: 1.25rem;
}

.preview-section > .collapsible-content.hidden {
    padding: 0;
}

/* Preview mockup containers */
.preview-container {
    background-color: var(--bg-color);
    border-radius: var(--border-radius);
    padding: 1rem;
}

/* Controls bar spacing inside preview */
.preview-container .controls-bar {
    margin-bottom: 1rem;
}

.preview-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.preview-stack {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Nested card in preview (no shadow, simple border) */
.preview-container .card {
    box-shadow: none;
    border: 1px solid var(--border-color);
    overflow: hidden;
    background-color: var(--card-bg-color);
    border-radius: var(--border-radius);
}

.preview-container .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0;
    padding: 0.75rem 1rem;
    background-color: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--primary-color);
}

/* Text and questions pane in preview */
.preview-container .text-pane,
.preview-container .questions-pane {
    display: flex;
    flex-direction: column;
}

/* Audio player preview - matches real Listening page */
.audio-duration {
    font-size: 0.85rem;
    font-weight: normal;
    color: var(--primary-color);
    margin-left: 0.75rem;
    padding: 0.25rem 0.5rem;
    background-color: var(--primary-color-light);
    border-radius: 4px;
}

.audio-controls {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
    padding: 1.5rem 1rem;
}

.listening-test-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn.listening-control-btn {
    background-color: var(--primary-color);
    color: white;
    border: 1px solid var(--primary-color);
    min-width: 120px;
    padding: 0.7rem 1rem;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 53, 128, 0.2);
}

.btn.listening-control-btn:hover {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 53, 128, 0.3);
}

/* Legacy preview styles (keeping for backwards compat) */
.preview-audio-player {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background-color: var(--bg-color);
}

.preview-play-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background-color: var(--primary-color);
    color: white;
    cursor: default;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-progress-bar {
    flex: 1;
    height: 6px;
    background-color: var(--border-color);
    border-radius: 3px;
    overflow: hidden;
}

.preview-progress-fill {
    width: 65%;
    height: 100%;
    background-color: var(--primary-color);
}

/* Recording indicator preview */
.preview-recording {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background-color: var(--bg-color);
    color: var(--success-color);
}

.preview-recording-indicator {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.preview-recording-indicator.completed {
    color: var(--success-color);
}

.preview-mic-icon {
    font-size: 1.5rem;
}

/* Preview textarea styling */
.preview-textarea {
    padding: 1rem;
    font-size: 0.9rem;
    line-height: 1.6;
    white-space: pre-wrap;
    background-color: var(--card-bg-color);
    font-family: inherit;
}

/* Preview question styling */
.preview-question {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.preview-question:last-child {
    border-bottom: none;
}

.preview-question p {
    margin-bottom: 0.5rem;
}

.preview-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.9rem;
    background-color: var(--card-bg-color);
}

.preview-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.preview-radio {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: default;
}

.preview-radio.selected {
    background-color: var(--primary-color-light);
}

.preview-radio-mark {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    flex-shrink: 0;
}

.preview-radio-mark.checked {
    border-color: var(--primary-color);
    background: radial-gradient(circle, var(--primary-color) 40%, transparent 45%);
}

.preview-feedback {
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
}

.preview-feedback.correct {
    background-color: var(--success-bg-color);
    color: var(--success-color);
    border: 1px solid var(--success-color);
}

.preview-feedback.incorrect {
    background-color: var(--danger-bg-color);
    color: var(--danger-color);
    border: 1px solid var(--danger-color);
}

/* Grammar exercise styling */
.preview-exercise-instruction {
    padding: 0.75rem;
    background-color: var(--primary-color-light);
    border-left: 3px solid var(--primary-color);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.preview-exercise-items p {
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.preview-answer-filled {
    color: var(--primary-color);
    font-weight: 600;
    padding: 0.1rem 0.5rem;
    background-color: var(--primary-color-light);
    border-radius: 4px;
}

.preview-check-mark {
    color: var(--success-color);
    font-weight: 700;
}

/* Feedback card */
.preview-feedback-content {
    padding: 1rem;
}

.preview-feedback-section {
    margin-bottom: 0.75rem;
}

.preview-feedback-section:last-child {
    margin-bottom: 0;
}

/* Lesson section */
.preview-lesson-section {
    margin-bottom: 1rem;
}

.preview-lesson-section:last-child {
    margin-bottom: 0;
}

/* Word count badge */
.preview-word-count {
    font-weight: 400;
    font-size: 0.85rem;
    color: var(--text-color-light);
}

/* Duration badge */
.preview-duration {
    font-size: 0.85rem;
    color: var(--text-color-light);
}

/* Text content area */
.preview-text-content {
    padding: 1rem;
    font-size: 0.95rem;
    line-height: 1.6;
}

.preview-text-content.transcript {
    background-color: rgba(0, 53, 128, 0.03);
    font-style: italic;
}

/* ================================ */
/* WRITING SHARED STYLES            */
/* (Used by Writing page & Landing) */
/* ================================ */

/* Assisted Mode Checkbox */
.assisted-mode-option {
    display: flex;
    align-items: center;
}

.assisted-mode-option .checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--card-bg-color);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
}

.assisted-mode-option .checkbox-label:hover {
    border-color: var(--primary-color);
}

.assisted-mode-option .checkbox-label.checked {
    border-color: var(--help-color);
    background-color: rgba(18, 95, 59, 0.08);
}

.assisted-mode-option .checkmark {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-color);
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.7rem;
}

.assisted-mode-option .checkmark.checked {
    background-color: var(--help-color);
    border-color: var(--help-color);
    color: white;
}

/* Scaffolding Pane (Writing Help) */
.scaffolding-pane .card-header {
    color: var(--help-color);
}

.scaffolding-section {
    margin-bottom: 1rem;
}

.scaffolding-section:last-child {
    margin-bottom: 0;
}

.scaffolding-section h5 {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--help-color);
    margin-bottom: 0.5rem;
}

.scaffolding-section p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-color);
    margin: 0;
}

/* Sentence Starters - Inline horizontal layout */
.starters-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.starter-item {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    padding: 0.5rem 0.75rem;
    background-color: var(--card-bg-color);
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.starter-item .finnish {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-color);
}

.starter-item .english {
    font-size: 0.8rem;
    font-style: italic;
    color: var(--text-color-light);
}

/* Vocabulary Grid - Wide layout */
.vocabulary-grid-wide {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.5rem;
}

.vocab-item {
    display: flex;
    flex-direction: column;
    padding: 0.4rem 0.6rem;
    background-color: var(--card-bg-color);
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.vocab-item .finnish {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-color);
}

.vocab-item .english {
    font-size: 0.75rem;
    color: var(--text-color-light);
}

/* Task type selector */
.task-type-selector select {
    width: 160px;
    color: var(--text-color);
    background-color: var(--card-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.5rem 0.75rem;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 12px;
    padding-right: 2rem;
}

/* Word count in response header */
.preview-container .word-count {
    font-weight: 400;
    font-size: 0.85rem;
    color: var(--text-color-light);
}

/* ================================ */
/* SPEAKING SHARED STYLES           */
/* ================================ */

.speaking-task-card {
    border-left: 4px solid var(--primary-color);
}

.task-duration {
    font-size: 0.9rem;
    color: var(--text-color-light);
    font-weight: normal;
}

.task-prompt {
    background-color: var(--bg-color);
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    font-size: 1.05rem;
    line-height: 1.6;
}

.recording-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    align-items: center;
}

.recording-btn {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    min-width: 140px;
    padding: 0.7rem 1rem;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.recording-btn:hover:not(:disabled) {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.recording-status {
    margin-bottom: 1rem;
    font-size: 0.95rem;
    font-weight: 500;
}

.status-recorded {
    color: var(--success-color);
}

.status-ready {
    color: var(--text-color-light);
}

.feedback-section {
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
    margin-top: 1rem;
}

.feedback-section h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--primary-color);
}

@media (max-width: 768px) {
    .landing-container {
        width: 100%;
        padding: 1.5rem 1rem;
    }

    .landing-header h1 {
        font-size: 2rem;
    }

    .landing-subtitle {
        font-size: 1.1rem;
    }

    .preview-row {
        grid-template-columns: 1fr;
    }

    .preview-section.card > .card-header.collapsible-header {
        padding: 0.875rem 1rem;
    }

    .preview-section.card > .card-header.collapsible-header > span:not(.section-icon) {
        font-size: 1.05rem;
    }

    .vocabulary-grid-wide {
        grid-template-columns: repeat(2, 1fr);
    }

    .starters-inline {
        flex-direction: column;
    }

    .starter-item {
        width: 100%;
    }
}

/* ------------------- */
/* FEATURE LIST        */
/* ------------------- */
.feature-list {
    list-style: none;
    padding: 0;
    margin: 0 auto 1rem auto;
    max-width: 400px;
    text-align: left;
}

.feature-list li {
    position: relative;
    padding-left: 1.75rem;
    margin-bottom: 0.5rem;
    font-size: 1.05rem;
}

.feature-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #28a745;
    font-weight: 700;
    background-color: #e8f5e9;
    border-radius: 50%;
    width: 1.25rem;
    height: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

.beta-notice {
    font-size: 0.9rem;
    color: #6c757d;
    margin-top: 1.5rem;
    margin-bottom: 0;
}