/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: linear-gradient(135deg, #EBF4FF 0%, #C3DAFE 100%); /* Blue gradient background */
    color: #374151; /* Gray text from videos */
    font-family: Arial, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: background 0.3s ease, color 0.3s ease;
}

/* Dark Mode Styles */
body.dark-mode {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #e2e8f0;
}

body.dark-mode #controls {
    background: linear-gradient(135deg, #334155 0%, #1e293b 100%) !important;
    border-bottom: 1px solid rgba(71, 85, 105, 0.3);
}

body.dark-mode .control-group label {
    color: #e2e8f0;
}

body.dark-mode .control-group select {
    background-color: #1e293b;
    color: #e2e8f0;
    border-color: #475569;
}

body.dark-mode .control-group select:hover {
    border-color: #64748b;
}

body.dark-mode .settings-btn-inline {
    color: #e2e8f0;
}

body.dark-mode .logout-btn {
    background: linear-gradient(135deg, #991b1b 0%, #7f1d1d 100%);
}

/* Progress info styles moved to line ~582 */

body.dark-mode .bootcamp-summary {
    background-color: rgba(16, 185, 129, 0.15);
    border-bottom: 2px solid #10B981;
}

body.dark-mode .bootcamp-summary-content {
    color: #e2e8f0;
}

body.dark-mode .story-bar {
    background-color: rgba(59, 130, 246, 0.15);
    border-bottom: 2px solid #3B82F6;
}

body.dark-mode .story-bar-content {
    color: #e2e8f0;
}

body.dark-mode .toggle-label {
    color: #e2e8f0;
}

body.dark-mode .flashcard-text {
    color: #e2e8f0;
}

body.dark-mode .english-text {
    color: #94a3b8;
}

body.dark-mode .target-text {
    color: #e2e8f0;
}

/* Previous shadow: default light mode shadow - for easy reversion */
body.dark-mode .control-btn {
    background: rgba(45, 55, 72, 0.9);
    border-color: #475569;
    color: #e2e8f0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

body.dark-mode .control-btn:hover {
    background: rgba(55, 65, 81, 0.95);
    border-color: #64748b;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

body.dark-mode .control-btn:active {
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}

/* Dark mode: swap border emphasis - play button gets border, side buttons don't */
body.dark-mode .prev-btn,
body.dark-mode .next-btn {
    border: none;
}

body.dark-mode .play-btn {
    background: linear-gradient(to bottom, #475569, #334155) !important;
    box-shadow:
        inset 0 2px 4px rgba(255, 255, 255, 0.08),
        inset 0 -2px 4px rgba(0, 0, 0, 0.3),
        0 8px 24px rgba(0, 0, 0, 0.5) !important;
}

body.dark-mode .play-btn::before {
    background: linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0.08) 0%,
        rgba(255, 255, 255, 0.04) 40%,
        rgba(255, 255, 255, 0.01) 70%,
        transparent 100%
    ) !important;
}

body.dark-mode .play-btn::after {
    background: radial-gradient(
        circle at 30% 20%,
        rgba(255, 255, 255, 0.06),
        transparent 60%
    ) !important;
}

body.dark-mode .play-btn:hover {
    background: linear-gradient(to bottom, #64748b, #475569) !important;
    box-shadow:
        inset 0 2px 4px rgba(255, 255, 255, 0.1),
        inset 0 -2px 5px rgba(0, 0, 0, 0.35),
        0 10px 30px rgba(0, 0, 0, 0.6) !important;
}

body.dark-mode .play-btn:active {
    background: linear-gradient(to bottom, #334155, #1e293b) !important;
    box-shadow:
        inset 0 2px 6px rgba(0, 0, 0, 0.4),
        0 6px 20px rgba(0, 0, 0, 0.5) !important;
}

body.dark-mode #status {
    background-color: rgba(30, 41, 59, 0.95);
    color: #e2e8f0;
}

/* Dark Mode Toggle Button */
.dark-mode-toggle {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 10000;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    cursor: pointer;
    font-size: 24px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.dark-mode-toggle:hover {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

body.dark-mode .dark-mode-toggle {
    background: rgba(45, 55, 72, 0.9);
    border-color: #475569;
}

body.dark-mode .dark-mode-toggle:hover {
    background: rgba(55, 65, 81, 0.95);
}

/* Dark Mode - Modals */
body.dark-mode .modal-content {
    background-color: #1e293b;
    color: #e2e8f0;
}

body.dark-mode .modal-content h2 {
    color: #e2e8f0;
}

body.dark-mode .close-btn {
    color: #94a3b8;
}

body.dark-mode .close-btn:hover {
    color: #e2e8f0;
}

body.dark-mode .setting-item label {
    color: #e2e8f0;
}

body.dark-mode .setting-item select {
    background-color: #0f172a;
    color: #e2e8f0;
    border-color: #475569;
}

body.dark-mode .setting-item select:hover {
    border-color: #64748b;
}

/* Dark Mode - Completion Modal */
body.dark-mode .completion-modal-content {
    background-color: #1e293b;
}

body.dark-mode .completion-header {
    border-bottom-color: #334155;
}

body.dark-mode #completion-title {
    color: #e2e8f0;
}

body.dark-mode .progress-title {
    color: #e2e8f0;
}

body.dark-mode .stat-item {
    background: rgba(15, 23, 42, 0.5);
}

body.dark-mode .stat-item:hover {
    background: rgba(15, 23, 42, 0.8);
}

body.dark-mode .stat-value {
    color: #e2e8f0;
}

body.dark-mode .stat-label {
    color: #94a3b8;
}

body.dark-mode .stats-column {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border-color: #334155;
}

body.dark-mode .lesson-row {
    color: #e2e8f0;
}

body.dark-mode .lesson-label {
    color: #e2e8f0;
}

body.dark-mode .lesson-dots {
    color: #e2e8f0;
}

body.dark-mode .completion-message {
    background: linear-gradient(135deg, #1e3a5f 0%, #1e293b 100%);
    border-color: #3b82f6;
    color: #93c5fd;
}

body.dark-mode #mode-selection-title {
    color: #e2e8f0;
}

body.dark-mode .mode-selection {
    background: #0f172a;
    border-color: #334155;
}

body.dark-mode .mode-selection h3 {
    color: #e2e8f0;
}

body.dark-mode .mode-option {
    color: #e2e8f0;
}

body.dark-mode .mode-option:hover {
    background: #1e293b;
}

body.dark-mode .mode-option span {
    color: #e2e8f0;
}

body.dark-mode .mode-radio-option {
    background: rgba(15, 23, 42, 0.5);
    border-color: #475569;
}

body.dark-mode .mode-radio-option:hover {
    background: rgba(15, 23, 42, 0.8);
}

body.dark-mode .mode-radio-option input:checked + label {
    background: rgba(59, 130, 246, 0.2);
    border-color: #3b82f6;
}

body.dark-mode #completion-continue-btn {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #ffffff;
}

body.dark-mode #completion-continue-btn:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

/* Dark Mode - Mobile Sheets */
body.dark-mode .mobile-sheet {
    background-color: #1e293b;
}

body.dark-mode .sheet-header {
    background-color: #0f172a;
    border-bottom-color: #334155;
    color: #e2e8f0;
}

body.dark-mode .sheet-body {
    color: #e2e8f0;
}

body.dark-mode .sheet-row label {
    color: #e2e8f0;
}

body.dark-mode .sheet-row select {
    background-color: #0f172a;
    color: #e2e8f0;
    border-color: #475569;
}

/* Dark Mode - Bootcamp Panel */
body.dark-mode .bootcamp-panel-container {
    background-color: #1e293b;
    border-color: #334155;
}

body.dark-mode .bootcamp-panel-header {
    border-bottom-color: #334155;
}

body.dark-mode .bootcamp-panel-header h2 {
    color: #e2e8f0;
}

body.dark-mode .bootcamp-panel-close {
    color: #94a3b8;
}

body.dark-mode .bootcamp-panel-close:hover {
    color: #e2e8f0;
}

body.dark-mode .bootcamp-panel-content {
    background-color: #1e293b;
}

body.dark-mode .bootcamp-plan {
    background-color: rgba(245, 158, 11, 0.15);
    border-color: #f59e0b;
    color: #fbbf24;
}

body.dark-mode .bootcamp-stats {
    background-color: #0f172a;
}

body.dark-mode .bootcamp-stat-label {
    color: #94a3b8;
}

body.dark-mode .bootcamp-stat-value {
    color: #e2e8f0;
}

body.dark-mode .bootcamp-suggestion {
    background-color: rgba(59, 130, 246, 0.15);
    border-color: #3b82f6;
    color: #93c5fd;
}

body.dark-mode .bootcamp-lesson-card {
    background-color: #0f172a;
    border-color: #334155;
}

body.dark-mode .bootcamp-lesson-card.completed {
    background-color: rgba(16, 185, 129, 0.15);
    border-color: #10b981;
}

body.dark-mode .bootcamp-lesson-title {
    color: #e2e8f0;
}

body.dark-mode .bootcamp-lesson-progress {
    color: #94a3b8;
}

body.dark-mode .lesson-name {
    color: #e2e8f0;
}

body.dark-mode .lesson-formats {
    color: #94a3b8;
}

body.dark-mode .lesson-status {
    color: #e2e8f0;
}

/* Controls Section */
#controls {
    background: linear-gradient(135deg, #EBF4FF 0%, #C3DAFE 100%) !important;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    flex-wrap: wrap;
    border-bottom: 1px solid rgba(59, 130, 246, 0.15);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.control-group label {
    font-weight: 600;
    font-size: 14px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.control-group select {
    padding: 6px 12px;
    border: 1px solid #D1D5DB;
    border-radius: 6px;
    background-color: white;
    color: #374151;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.control-group select:hover {
    border-color: #9CA3AF;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.control-group select:focus {
    outline: none;
    border-color: #3B82F6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.top-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.logout-btn {
    padding: 6px 16px;
    background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.25);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.logout-btn:hover {
    background: linear-gradient(135deg, #F87171 0%, #EF4444 100%);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
    transform: translateY(-1px);
}

/* Settings button in control buttons */
.settings-btn-inline {
    font-family: Arial, 'Segoe UI Symbol', 'Apple Color Emoji', sans-serif;
    font-size: 40px !important;
    background: none !important;
    border: none !important;
    padding: 0 !important;
    cursor: pointer;
    transition: opacity 0.3s;
    color: #374151;
    line-height: 1;
    box-shadow: none !important;
    border-radius: 0 !important;
}

.settings-btn-inline::before {
    display: none !important;
}

.settings-btn-inline:hover {
    opacity: 0.7;
    background: none !important;
    box-shadow: none !important;
    transform: none !important;
}

/* Modern Playback Controls (Below Flashcard) */
.playback-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    padding: 20px 20px;
    max-width: 400px;
    margin: 0 auto;
}

.control-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 10px;
    padding: 12px 20px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    color: #374151;
    font-size: 12px;
    font-weight: 600;
    width: 100px;
    height: 70px;
    box-sizing: border-box;
}

.control-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    background: rgba(255, 255, 255, 1);
}

.control-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.control-btn svg {
    flex-shrink: 0;
}

.play-btn svg,
.play-btn span {
    position: relative;
    z-index: 1;
}

.play-btn {
    position: relative;
    color: white;
    border: none;
    border-radius: 10px;
    background: linear-gradient(to bottom, #34D399, #10b981);
    box-shadow:
        inset 0 2px 4px rgba(255, 255, 255, 0.2),
        inset 0 -2px 4px rgba(0, 0, 0, 0.15),
        0 8px 24px rgba(0, 0, 0, 0.12);
    overflow: hidden;
    transition: all 0.25s ease;
}

/* subtle glossy top highlight */
.play-btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 60%;
    border-radius: inherit;
    background: linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0.15) 0%,
        rgba(255, 255, 255, 0.08) 40%,
        rgba(255, 255, 255, 0.02) 70%,
        transparent 100%
    );
    pointer-events: none;
    z-index: 0;
}

/* very subtle sheen overlay */
.play-btn::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(
        circle at 30% 20%,
        rgba(255, 255, 255, 0.12),
        transparent 60%
    );
    opacity: 0.5;
    pointer-events: none;
    z-index: 0;
}

/* Hover */
.play-btn:hover {
    transform: translateY(-2px);
    box-shadow:
        inset 0 2px 4px rgba(255, 255, 255, 0.25),
        inset 0 -2px 5px rgba(0, 0, 0, 0.18),
        0 10px 30px rgba(0, 0, 0, 0.15);
    background: linear-gradient(to bottom, #6ee7b7, #34d399);
}

/* Active */
.play-btn:active {
    transform: translateY(0px);
    box-shadow:
        inset 0 2px 6px rgba(0, 0, 0, 0.25),
        0 6px 20px rgba(0, 0, 0, 0.12);
    background: linear-gradient(to bottom, #10b981, #059669);
}

.prev-btn:hover svg,
.next-btn:hover svg {
    color: #3B82F6;
}

.play-btn .pause-icon {
    display: none;
}

.play-btn.playing .play-icon {
    display: none;
}

.play-btn.playing .pause-icon {
    display: block;
}

.progress-info-container {
    position: fixed;
    top: 120px;
    right: 0;
    display: flex;
    flex-direction: row;
    gap: 0;
    z-index: 1000;
}

.progress-info-card {
    font-weight: 600;
    font-size: 14px;
    display: flex;
    gap: 6px;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #374151;
    background: rgba(255, 255, 255, 0.95);
    padding: 6px 10px;
    border-radius: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.card-counter {
    border-radius: 8px 0 0 8px;
    font-size: 16px;
}

.time-display {
    font-size: 14px;
    color: #6B7280;
}

body.dark-mode .progress-info-card {
    color: #e2e8f0;
    background: rgba(30, 41, 59, 0.95);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

body.dark-mode .time-display {
    color: #94a3b8;
}

/* Progress Bar */
.progress-bar-container {
    width: 100%;
    height: 4px;
    background-color: rgba(0, 0, 0, 0.1);
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background-color: #10B981;
    transition: width 0.1s linear;
}

/* Flashcard Display */
#flashcard-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

.flashcard-card {
    background: #F0F7FF;
    border-radius: 16px;
    padding: 60px 80px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    width: 1200px;
    max-width: 90vw;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 40px;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

body.dark-mode .flashcard-card {
    background: #1e293b;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.flashcard-text {
    text-align: left;
    width: 100%;
    line-height: 1.4;
}

.english-text {
    font-size: 36px; /* English font size */
    color: #475569; /* Darker for better contrast on blue */
}

.target-text {
    font-size: 48px; /* Target font size - larger */
    font-weight: bold;
    color: #1e293b; /* Dark blue-gray for contrast */
}

/* Hide text when not in use */
.flashcard-text.hidden {
    opacity: 0;
}

/* Status indicator */
#status {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: rgba(55, 65, 81, 0.8);
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    display: none;
}

#status.visible {
    display: block;
}

/* Logo - Desktop default */
#app-logo {
    position: fixed;
    bottom: 10px;
    right: 20px;
    height: 160px;
    width: auto;
    opacity: 0.5;
    z-index: 500;
    pointer-events: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    /* Hide bootcamp on mobile - can add separate mobile UI later */
    .bootcamp-wrapper {
        display: none;
    }

    /* Compact controls */
    #controls {
        padding: 10px;
        gap: 8px;
        flex-wrap: wrap;
        /* Keep gradient from main styles */
    }

    .control-group {
        flex: 0 0 auto;
        font-size: 13px;
    }

    .control-group label {
        font-size: 11px;
        margin-right: 4px;
    }

    .control-group select {
        font-size: 13px;
        padding: 4px 6px;
    }

    .top-buttons {
        margin-left: 0;
        width: 100%;
        justify-content: center;
        gap: 8px;
    }

    .settings-btn-inline {
        font-size: 24px !important;
        max-width: 50px;
    }

    /* Progress info - more compact */
    .progress-info {
        width: 100%;
        justify-content: center;
        font-size: 12px;
        gap: 8px;
    }

    .time-display {
        font-size: 11px;
    }

    /* Progress bar - thinner */
    .progress-bar-container {
        height: 3px;
    }

    /* FLASHCARD - MUCH BIGGER, more space */
    #flashcard-container {
        padding: 15% 8%;
        gap: 12%;
    }

    .english-text {
        font-size: 36px !important;
        line-height: 1.3;
    }

    .target-text {
        font-size: 52px !important;
        font-weight: 700;
        line-height: 1.2;
    }
}

@media (max-width: 480px) {
    /* Even more compact controls on small phones */
    #controls {
        padding: 8px;
        gap: 6px;
    }

    .control-group {
        width: 100%;
        justify-content: space-between;
    }

    .control-group label {
        font-size: 10px;
    }

    .control-group select {
        flex: 1;
        font-size: 12px;
        padding: 4px 6px;
        margin-left: 6px;
    }

    .playback-controls {
        gap: 12px;
        padding: 18px 15px;
    }

    .control-btn {
        padding: 10px 16px;
        font-size: 11px;
        width: 85px;
    }

    .settings-btn-inline {
        font-size: 20px !important;
    }

    .progress-info {
        font-size: 11px;
    }

    .time-display {
        font-size: 10px;
    }

    /* Flashcard - still big on small screens */
    #flashcard-container {
        padding: 12% 6%;
        gap: 10%;
    }

    .english-text {
        font-size: 30px !important;
    }

    .target-text {
        font-size: 44px !important;
    }
}

/* Settings Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: slideIn 0.3s;
}

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

.modal-content h2 {
    margin-bottom: 20px;
    color: #374151;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    transition: color 0.3s;
}

.close-btn:hover {
    color: #374151;
}

.setting-item {
    margin-bottom: 20px;
}

.setting-item label {
    display: block;
    font-weight: bold;
    margin-bottom: 8px;
    color: #374151;
}

.setting-item select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: white;
    color: #374151;
    font-size: 14px;
}

/* Bootcamp Wrapper */
.bootcamp-wrapper {
    position: relative;
}

/* Bootcamp Summary Bar */
.bootcamp-summary {
    background-color: rgba(16, 185, 129, 0.1);
    border-bottom: 2px solid #10B981;
    padding-top: 14px;
    padding-bottom: 14px;
    padding-left: 15px;
    padding-right: 15px;
    cursor: pointer;
    transition: background-color 0.2s;
    position: relative;
    z-index: 1001;
    box-sizing: border-box;
    display: flex;
    align-items: center;
}

.bootcamp-summary:hover {
    background-color: rgba(16, 185, 129, 0.15);
}

.bootcamp-summary-content {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 20px;
    font-size: 15px;
    color: #374151;
    font-weight: 500;
    line-height: 1;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.progress-dots {
    font-size: 10px;
    letter-spacing: -1px;
}

#bootcamp-summary-text {
    display: flex;
    align-items: center;
    gap: 15px;
    line-height: 1;
}

/* Bootcamp Mode Toggle */
.bootcamp-mode-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
}

.toggle-label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #10B981;
    transition: 0.3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: #3B82F6;
}

input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

.toggle-slider:hover {
    opacity: 0.9;
}

/* Story Chapter Bar (Stories Mode) */
.story-wrapper {
    position: relative;
}

.story-bar {
    background-color: rgba(59, 130, 246, 0.1);
    border-bottom: 2px solid #3B82F6;
    padding-top: 14px;
    padding-bottom: 14px;
    padding-left: 15px;
    padding-right: 15px;
    transition: background-color 0.2s;
    position: relative;
    z-index: 1001;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.story-bar-content {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #374151;
    font-weight: 500;
    font-size: 14px;
    flex-grow: 1;
}

/* Chapter functionality removed - stories load directly without chapters */

/* Bootcamp Panel Overlay */
.bootcamp-panel {
    position: relative;
    z-index: 2000;
    display: none;
}

.bootcamp-panel.show {
    display: block;
}

.bootcamp-panel-overlay {
    display: none;
}

.bootcamp-panel-container {
    position: absolute;
    top: 0;
    left: 0;
    background-color: white;
    width: 320px;
    max-width: 90vw;
    max-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid #E5E7EB;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: max-height 0.3s ease-out;
    z-index: 1000;
}

.bootcamp-panel.show .bootcamp-panel-container {
    max-height: 480px;
}

.bootcamp-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #E5E7EB;
}

.bootcamp-panel-header h2 {
    margin: 0;
    color: #374151;
    font-size: 20px;
}

.bootcamp-panel-close {
    background: none;
    border: none;
    font-size: 32px;
    color: #9CA3AF;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.bootcamp-panel-close:hover {
    color: #374151;
}

.bootcamp-panel-content {
    padding: 15px;
    overflow-y: auto;
    flex: 1;
}

/* Bootcamp Panel Content Styles */
.bootcamp-plan {
    background-color: #FEF3C7;
    border-left: 3px solid #F59E0B;
    padding: 8px 10px;
    margin-bottom: 10px;
    font-size: 12px;
    line-height: 1.5;
    color: #92400E;
}

.bootcamp-plan small {
    font-size: 11px;
    opacity: 0.9;
}

.bootcamp-stats {
    background-color: #F3F4F6;
    padding: 8px 10px;
    border-radius: 5px;
    margin-bottom: 10px;
    font-size: 12px;
}

.bootcamp-stat-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 13px;
}

.bootcamp-stat-label {
    color: #6B7280;
    font-weight: 500;
}

.bootcamp-stat-value {
    color: #374151;
    font-weight: 600;
}

.bootcamp-suggestion {
    background-color: #DBEAFE;
    border-left: 3px solid #3B82F6;
    padding: 8px 10px;
    border-radius: 4px;
    margin-top: 10px;
    font-size: 12px;
    color: #1E40AF;
}

.suggestion-options {
    display: flex;
    gap: 6px;
    margin-top: 6px;
}

.suggestion-btn {
    background-color: #10B981;
    color: white;
    border: none;
    padding: 8px 14px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.15s;
    flex: 1;
    text-align: center;
    animation: suggestGlow 2s ease-in-out infinite;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

.suggestion-btn:hover {
    background-color: #059669;
    transform: translateY(-1px);
    animation: none;
}

@keyframes suggestGlow {
    0%, 100% {
        box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
    }
    50% {
        box-shadow: 0 0 16px rgba(16, 185, 129, 0.8);
    }
}

.bootcamp-lessons-grid {
    display: grid;
    gap: 15px;
}

.bootcamp-lesson-card {
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    padding: 15px;
    background-color: white;
}

.bootcamp-lesson-card.completed {
    background-color: #F0FDF4;
    border-color: #10B981;
}

.bootcamp-lesson-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.bootcamp-lesson-title {
    font-weight: 600;
    color: #374151;
    font-size: 16px;
}

.bootcamp-lesson-badge {
    background-color: #10B981;
    color: white;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.bootcamp-lesson-badge.incomplete {
    background-color: #9CA3AF;
}

.bootcamp-lesson-progress {
    font-size: 13px;
    color: #6B7280;
    margin-bottom: 8px;
}

.bootcamp-formats {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.bootcamp-format-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #D1D5DB;
    display: inline-block;
}

.bootcamp-format-dot.completed {
    background-color: #10B981;
}

.bootcamp-format-label {
    font-size: 12px;
    color: #6B7280;
}

/* Toast Notification */
.bootcamp-toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: #10B981;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    display: none;
    animation: slideInRight 0.3s ease-out;
    z-index: 3000;
}

.bootcamp-toast.show {
    display: block;
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive adjustments for bootcamp */
@media (max-width: 768px) {
    .bootcamp-panel-container {
        width: 300px;
    }

    .bootcamp-panel-content {
        padding: 12px;
    }

    .bootcamp-toast {
        right: 15px;
        bottom: 15px;
        font-size: 13px;
    }

    #bootcamp-summary-text {
        font-size: 13px;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .bootcamp-panel-container {
        width: 280px;
        max-width: calc(100vw - 20px);
    }

    .bootcamp-panel-content {
        padding: 10px;
    }

    .bootcamp-stat-row {
        font-size: 11px;
    }

    .bootcamp-lesson-title {
        font-size: 13px;
    }

    .bootcamp-plan {
        font-size: 11px;
    }

    .suggestion-btn {
        font-size: 11px;
        padding: 7px 10px;
    }
}

/* ==========================================
   MOBILE UI - ONLY SHOWS ON MOBILE
   ========================================== */

/* DESKTOP: Hide all mobile elements */
@media (min-width: 769px) {
    .mobile-only,
    .mobile-sheet,
    .sheet-backdrop {
        display: none !important;
    }
}

/* MOBILE: Show mobile UI, hide some desktop elements */
@media (max-width: 768px) {
    /* Prevent scrolling on mobile */
    body {
        overflow: hidden;
        position: fixed;
        width: 100%;
        height: 100vh;
    }

    /* Hide desktop-only elements on mobile */
    #controls,
    .bootcamp-wrapper {
        display: none !important;
    }

    /* Hide logo on mobile */
    #app-logo {
        display: none !important;
    }

    /* Show mobile elements */
    .mobile-only {
        display: flex !important;
    }

    /* Mobile Status Bar */
    #mobile-status-bar {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 44px;
        background: white;
        border-bottom: 1px solid #E5E7EB;
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0 16px;
        z-index: 100;
    }

    #mobile-status-text {
        font-size: 15px;
        font-weight: 600;
        color: #374151;
    }

    #mobile-settings-btn {
        font-size: 22px;
        background: none;
        border: none;
        padding: 8px;
        cursor: pointer;
    }

    /* Flashcard - centered and properly sized */
    #flashcard-container {
        margin-top: 44px; /* Account for fixed status bar */
        margin-bottom: 88px; /* Account for bottom nav + bootcamp bar */
        padding: 8% 5%;
        gap: 8%;
        justify-content: center;
        align-items: center;
    }

    .english-text {
        font-size: 28px !important;
        text-align: center;
    }

    .target-text {
        font-size: 36px !important;
        font-weight: bold;
        text-align: center;
    }

    /* Mobile Bottom Nav */
    #mobile-bottom-nav {
        position: fixed;
        bottom: 32px; /* Above bootcamp bar */
        left: 0;
        right: 0;
        height: 56px;
        background: white;
        border-top: 1px solid #E5E7EB;
        display: flex;
        z-index: 100;
    }

    .mobile-nav-btn {
        flex: 1;
        background: white;
        border: none;
        font-size: 20px;
        cursor: pointer;
        transition: background 0.2s;
    }

    .mobile-nav-btn:active {
        background: #F3F4F6;
    }

    .mobile-nav-btn.mobile-play {
        color: #10B981;
        font-size: 24px;
        font-weight: bold;
    }

    /* Mobile Bootcamp Bar */
    #mobile-bootcamp-bar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 32px;
        background: rgba(16, 185, 129, 0.1);
        border-top: 2px solid #10B981;
        display: flex;
        align-items: center;
        padding: 0 16px;
        cursor: pointer;
        z-index: 100;
    }

    .mobile-bootcamp-content {
        display: flex;
        justify-content: space-between;
        width: 100%;
        font-size: 12px;
        font-weight: 600;
        color: #374151;
    }

    /* Bottom Sheets */
    .mobile-sheet {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: white;
        border-radius: 16px 16px 0 0;
        max-height: 80vh;
        transform: translateY(100%);
        transition: transform 0.3s ease-out;
        z-index: 1000;
        overflow-y: auto;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.2);
    }

    .mobile-sheet.open {
        transform: translateY(0);
    }

    .sheet-header {
        padding: 20px;
        border-bottom: 1px solid #E5E7EB;
        display: flex;
        justify-content: space-between;
        align-items: center;
        position: sticky;
        top: 0;
        background: white;
    }

    .sheet-header h3 {
        margin: 0;
        font-size: 18px;
        color: #374151;
    }

    .sheet-close {
        font-size: 28px;
        background: none;
        border: none;
        color: #9CA3AF;
        cursor: pointer;
        padding: 0;
        width: 32px;
        height: 32px;
    }

    .sheet-body {
        padding: 20px;
    }

    .sheet-row {
        margin-bottom: 20px;
    }

    .sheet-row label {
        display: block;
        font-weight: 600;
        margin-bottom: 8px;
        font-size: 14px;
        color: #374151;
    }

    .sheet-row select {
        width: 100%;
        padding: 12px;
        font-size: 16px; /* Prevents iOS zoom */
        border: 1px solid #D1D5DB;
        border-radius: 8px;
    }

    .sheet-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s;
        z-index: 999;
    }

    .sheet-backdrop.active {
        opacity: 1;
        pointer-events: auto;
    }

    /* Hide progress bar on mobile */
    .progress-bar-container {
        display: none;
    }
}

/* Small phones */
@media (max-width: 480px) {
    #mobile-status-text {
        font-size: 13px;
    }

    .english-text {
        font-size: 26px !important;
    }

    .target-text {
        font-size: 40px !important;
    }

    .mobile-nav-btn {
        font-size: 18px;
    }

    .mobile-nav-btn.mobile-play {
        font-size: 22px;
    }
}

/* Landscape mode on mobile */
@media (max-width: 768px) and (orientation: landscape) {
    #flashcard-container {
        padding: 4% 8%;
        gap: 4%;
    }

    .english-text {
        font-size: 20px !important;
    }

    .target-text {
        font-size: 24px !important;
    }
}

/* ==========================================
   LOGIN MODAL STYLES
   ========================================== */

#login-modal {
    display: none;
    position: fixed;
    z-index: 998; /* Below bootcamp panel (999-2000) */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    align-items: flex-end; /* Align to bottom */
    justify-content: center;
}

#login-modal[style*="display: flex"] {
    display: flex !important;
}

.login-modal-content {
    width: 100%;
    max-width: 500px;
    padding: 40px;
    margin: 0 auto;
    background: linear-gradient(135deg, #FFE4E6 0%, #FFD1DC 100%);
    border-radius: 20px 20px 0 0; /* Rounded top corners only */
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    max-height: 85vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.login-logo-container {
    text-align: center;
    margin-bottom: 20px;
}

.login-logo {
    height: 80px;
    width: auto;
    opacity: 0.9;
}

#login-title {
    text-align: center;
    color: #374151;
    margin-bottom: 10px;
    font-size: 24px;
}

#login-subtitle {
    text-align: center;
    color: #6B7280;
    margin-bottom: 25px;
    font-size: 14px;
}

.login-message {
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
    text-align: center;
}

.login-error {
    background-color: #FEE2E2;
    color: #991B1B;
    border: 1px solid #FCA5A5;
}

.login-success {
    background-color: #D1FAE5;
    color: #065F46;
    border: 1px solid #6EE7B7;
}

.login-field {
    margin-bottom: 20px;
}

.login-field label {
    display: block;
    margin-bottom: 8px;
    color: #374151;
    font-weight: 500;
    font-size: 14px;
}

.login-field input {
    width: 100%;
    padding: 12px;
    border: 2px solid #E5E7EB;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.login-field input:focus {
    outline: none;
    border-color: #10B981;
}

.login-field input[type="text"][inputmode="numeric"] {
    text-align: center;
    letter-spacing: 4px;
    font-size: 20px;
    font-weight: bold;
}

.login-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.login-btn {
    padding: 14px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.login-btn-primary {
    background-color: #10B981;
    color: white;
}

.login-btn-primary:hover {
    background-color: #059669;
    transform: translateY(-1px);
}

.login-btn-secondary {
    background-color: white;
    color: #374151;
    border: 2px solid #E5E7EB;
}

.login-btn-secondary:hover {
    background-color: #F9FAFB;
    border-color: #D1D5DB;
}

.login-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.login-forgot {
    text-align: center;
    margin-top: 15px;
}

.login-forgot a {
    color: #10B981;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.login-forgot a:hover {
    text-decoration: underline;
}

/* Mobile adjustments for login modal */
@media (max-width: 768px) {
    .login-modal-content {
        max-width: 100%;
        padding: 30px 20px;
        border-radius: 20px 20px 0 0;
    }

    .login-logo {
        height: 60px;
    }

    #login-title {
        font-size: 20px;
    }

    .login-field input {
        padding: 10px;
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .login-btn {
        padding: 12px;
        font-size: 15px;
    }

    /* Add handle bar for mobile */
    .login-modal-content::before {
        content: '';
        position: absolute;
        top: 10px;
        left: 50%;
        transform: translateX(-50%);
        width: 40px;
        height: 4px;
        background-color: rgba(0, 0, 0, 0.2);
        border-radius: 2px;
    }
}

/* Completion Modal Styles */
.completion-modal-content {
    max-width: 550px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 16px 20px;
    position: relative;
}

.completion-header {
    text-align: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e5e7eb;
}

.completion-icon {
    display: none;
}

#completion-title {
    font-size: 26px;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.stat-item {
    text-align: center;
    padding: 8px 4px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.5);
    transition: background 0.2s;
}

.stat-item:hover {
    background: rgba(255, 255, 255, 0.8);
}

.stat-value {
    font-size: 20px;
    font-weight: 700;
    color: #1f2937;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.stat-label {
    font-size: 11px;
    color: #6b7280;
    margin-top: 3px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.progress-title {
    margin: 8px 0 6px 0;
    color: #374151;
    font-size: 15px;
    font-weight: 600;
}

.completion-grid {
    display: flex;
    gap: 15px;
    margin: 4px 0 8px 0;
    align-items: flex-start;
}

.lesson-column {
    flex: 1;
}

.stats-column {
    flex: 0 0 auto;
    min-width: 110px;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    border-radius: 12px;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.lesson-row {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 8px;
    padding: 3px 0;
    font-size: 16px;
    color: #374151;
}

.lesson-label {
    font-weight: 700;
    min-width: 75px;
}

.lesson-dots {
    font-size: 17px;
    letter-spacing: 0px;
}

/* Add subtle animation for completed dots */
@keyframes dotPulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

.lesson-row:hover .lesson-dots {
    animation: dotPulse 1.5s ease-in-out infinite;
}

.completion-message {
    margin: 8px 0;
    padding: 10px 12px;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-radius: 10px;
    border: 1px solid #93c5fd;
    color: #1e40af;
    font-size: 14px;
    line-height: 1.5;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.08);
}

.mode-selection {
    margin: 8px 0;
    padding: 10px;
    background: #f9fafb;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

.mode-selection h3 {
    margin-bottom: 8px;
    color: #374151;
    font-size: 15px;
    font-weight: 600;
}

.mode-options {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mode-option {
    display: flex;
    align-items: center;
    padding: 4px 6px;
    cursor: pointer;
    border-radius: 3px;
    transition: background 0.2s;
}

.mode-option:hover {
    background: #f3f4f6;
}

.mode-option input[type="radio"] {
    margin-right: 8px;
    cursor: pointer;
}

.mode-option span {
    font-size: 14px;
    color: #374151;
}

.completion-actions {
    display: flex;
    justify-content: center;
    margin-top: 8px;
}

#completion-continue-btn {
    padding: 12px 28px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    background: #3b82f6;
    color: white;
}

#completion-continue-btn:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

/* Mobile responsive for completion modal */
@media (max-width: 768px) {
    .completion-modal-content {
        max-width: 95%;
        padding: 20px;
        margin: 20px auto;
    }

    .completion-icon {
        font-size: 36px;
    }

    #completion-title {
        font-size: 22px;
    }

    .completion-stats {
        flex-direction: column;
        gap: 15px;
    }

    #completion-grid-content {
        grid-template-columns: repeat(5, 1fr);
        gap: 5px;
    }

    .grid-lesson {
        padding: 5px 3px;
        font-size: 10px;
    }

    .completion-actions {
        flex-direction: column;
        gap: 10px;
    }

    .completion-actions button {
        width: 100%;
    }
}
