/* Learning Mode Styles - Modern Redesign (Phase 3) */
.learning-mode-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 51, 1);
    /* Deep Blue Theme - Fully Opaque */
    z-index: 10001;
    /* Above mobile nav (10000) */
    display: none;
    flex-direction: column;
    color: white;
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.learning-mode-container.active {
    display: flex;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Start Page: Character List */
.learning-start-page {
    flex: 1;
    overflow-y: auto;
    /* Kept from original for scrolling */
    padding: 20px;
    /* Kept from original */
    display: none;
    /* Kept from original, activated by .active */
    flex-direction: column;
    /* Kept from original */
    align-items: center;
    /* Kept from original */
    padding-top: 40px;
    /* Add top padding since header is gone */
}

.learning-start-page.active {
    display: flex;
    flex-direction: column;
}

.learning-char-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 20px;
    width: 100%;
    max-width: 1000px;
    padding-bottom: 120px;
    /* Space for bottom buttons */
}

.learning-char-item {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 15px;
    text-align: center;
    position: relative;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    cursor: pointer;
    /* Indicate clickable */
}

.learning-char-item:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.learning-char-item.learned {
    background: rgba(76, 175, 80, 0.2);
    border-color: rgba(76, 175, 80, 0.5);
}

/* Mastery Level Styles */
.learning-char-item.mastery-new {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.1);
}

.learning-char-item.mastery-learning {
    background: rgba(33, 150, 243, 0.15);
    border-color: rgba(33, 150, 243, 0.4);
}

.learning-char-item.mastery-reviewing {
    background: rgba(255, 193, 7, 0.15);
    border-color: rgba(255, 193, 7, 0.4);
    position: relative;
}

.learning-char-item.mastery-reviewing::after {
    content: '';
    position: absolute;
    top: 8px;
    left: 8px;
    width: 8px;
    height: 8px;
    background: #FFC107;
    border-radius: 50%;
    box-shadow: 0 0 6px rgba(255, 193, 7, 0.6);
}

.learning-char-item.mastery-mastered {
    background: rgba(76, 175, 80, 0.2);
    border-color: rgba(76, 175, 80, 0.5);
}

/* Review page items */
.learning-review-item.review-item-failed {
    border-color: rgba(255, 75, 43, 0.5) !important;
    background: rgba(255, 75, 43, 0.1) !important;
}

.learning-review-level {
    font-size: 12px;
    font-weight: 600;
    margin-left: 8px;
    padding: 2px 6px;
    border-radius: 10px;
}

.mastery-badge-new {
    color: rgba(255, 255, 255, 0.4);
}

.mastery-badge-learning {
    color: #2196F3;
    background: rgba(33, 150, 243, 0.15);
}

.mastery-badge-reviewing {
    color: #FFC107;
    background: rgba(255, 193, 7, 0.15);
}

.mastery-badge-mastered {
    color: #4CAF50;
    background: rgba(76, 175, 80, 0.15);
}

.learning-char-text {
    font-size: 36px;
    font-weight: bold;
    display: block;
    margin-bottom: 5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.learning-char-pinyin {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 8px;
    font-weight: 500;
}

.learning-char-search {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    font-size: 14px;
}

.learning-char-search:hover {
    background: #2196F3;
}

.learning-char-status {
    position: absolute;
    bottom: 5px;
    right: 5px;
    font-size: 18px;
    color: rgba(255, 255, 255, 0.5);
    transition: color 0.2s;
}

.learning-char-item.learned .learning-char-status {
    color: #4CAF50;
}

.learning-start-actions {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 30px 20px;
    background: rgba(0, 0, 51, 0.95);
    /* Match container bg */
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    gap: 20px;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.3);
    z-index: 3001;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.learning-btn {
    padding: 15px 40px;
    border: none;
    border-radius: 30px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 140px;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.learning-btn:active {
    transform: scale(0.95);
}

.learning-btn-primary {
    background: linear-gradient(45deg, #11998e, #38ef7d);
    color: white;
}

.learning-btn-primary:hover {
    box-shadow: 0 6px 20px rgba(56, 239, 125, 0.4);
}

.learning-btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.learning-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Game Page */
.learning-game-page {
    flex: 1;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
}

.learning-game-page.active {
    display: flex;
}

.game-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    color: white;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.game-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.learning-progress-bar {
    position: absolute;
    top: 20px;
    left: 20px;
    /* Move to left to avoid close button */
    right: 80px;
    /* Leave space for close button */
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.learning-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #11998e, #38ef7d);
    width: 0%;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 10px rgba(56, 239, 125, 0.5);
}

.learning-target-char {
    font-size: 160px;
    font-weight: bold;
    margin-bottom: 60px;
    text-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    background: linear-gradient(to bottom, #fff, #e0e0e0);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
    animation: learning-bounce-pulse 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.learning-pinyin-input-area {
    display: flex;
    gap: 15px;
    margin-bottom: 50px;
    min-height: 80px;
}

.learning-pinyin-char {
    width: 60px;
    height: 80px;
    border-bottom: 4px solid rgba(255, 255, 255, 0.3);
    font-size: 48px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    transition: all 0.2s;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.learning-pinyin-char.correct {
    border-bottom-color: #38ef7d;
    color: #38ef7d;
    transform: scale(1.1);
}

.learning-pinyin-char.incorrect {
    border-bottom-color: #ff4b2b;
    color: #ff4b2b;
    animation: learning-shake 0.4s ease-in-out;
}

@keyframes learning-shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

.learning-confirm-btn {
    padding: 20px 80px;
    font-size: 24px;
    background: linear-gradient(45deg, #2196F3, #21CBF3);
    color: white;
    border: none;
    border-radius: 40px;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(33, 203, 243, 0.4);
    transition: all 0.2s;
    font-weight: bold;
    letter-spacing: 1px;
}

.learning-confirm-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(33, 203, 243, 0.5);
}

.learning-confirm-btn:active {
    transform: scale(0.98);
}

/* Skip / Don't Know button */
.learning-skip-btn {
    padding: 10px 32px;
    font-size: 15px;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 10px;
}

.learning-skip-btn:hover {
    background: rgba(255, 80, 80, 0.2);
    color: white;
    border-color: rgba(255, 80, 80, 0.4);
}

.learning-skip-btn:active {
    transform: scale(0.96);
}

/* Review Page */
.learning-review-page {
    flex: 1;
    display: none;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px;
    justify-content: center;
}

.learning-review-page.active {
    display: flex;
}

.learning-review-list {
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
    justify-content: center;
    margin-bottom: 60px;
    width: 100%;
    max-width: 900px;
}

.learning-review-item {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 25px;
    text-align: center;
    min-width: 120px;
    transition: transform 0.3s;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.learning-review-item:hover {
    transform: translateY(-5px) scale(1.05);
    background: rgba(255, 255, 255, 0.2);
}

.learning-review-char {
    font-size: 56px;
    font-weight: bold;
    display: block;
    margin-bottom: 15px;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.learning-review-pinyin {
    font-size: 28px;
    color: #38ef7d;
    font-weight: 500;
}

/* Progress Container */
.learning-progress-container {
    padding: 25px;
    /* Increased from 20px */
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    margin: 15px;
    margin-bottom: 20px;
}

/* Mobile: Full width progress container */
@media (max-width: 768px) {
    .learning-progress-container {
        margin: 10px;
        padding: 20px;
        border-radius: 12px;
    }
}

.learning-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

.learning-progress-bar-bg {
    height: 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.learning-progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #11998e, #38ef7d);
    border-radius: 10px;
    transition: width 0.5s ease;
    width: 0%;
}

.learning-progress-stats {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
}

.learning-progress-stats span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.learning-review-actions {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    max-width: 350px;
}

/* Animations */
@keyframes learning-bounce-pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

.learning-pinyin-slot {
    width: 60px;
    height: 80px;
    border-bottom: 4px solid rgba(255, 255, 255, 0.6);
    font-size: 48px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    transition: all 0.2s;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    margin: 0 5px;
    /* Add spacing between slots */
}

.learning-pinyin-slot.correct {
    color: #38ef7d;
    border-bottom-color: #38ef7d;
    transform: scale(1.1);
}

.learning-pinyin-slot.incorrect {
    color: #ff4b2b;
    border-bottom-color: #ff4b2b;
    animation: learning-shake 0.4s ease-in-out;
}

/* Tone Slot — distinct blue underline */
.learning-tone-slot {
    border-bottom-color: #21CBF3;
    color: #21CBF3;
    font-size: 40px;
    letter-spacing: 0;
    min-width: 44px;
    margin-left: 10px;
    /* slight gap from letter slots */
}

.learning-tone-slot.correct {
    color: #38ef7d;
    border-bottom-color: #38ef7d;
}

.learning-tone-slot.incorrect {
    color: #ff4b2b;
    border-bottom-color: #ff4b2b;
    animation: learning-shake 0.4s ease-in-out;
}

/* Shake hint — used when user tries to submit without entering a tone */
@keyframes shake-hint {

    0%,
    100% {
        transform: translateX(0);
    }

    20% {
        transform: translateX(-8px);
    }

    40% {
        transform: translateX(8px);
    }

    60% {
        transform: translateX(-6px);
    }

    80% {
        transform: translateX(4px);
    }
}

.shake-hint {
    animation: shake-hint 0.5s ease-in-out;
}

/* Dedicated Learning Keyboard - Apple iOS Style */
.learning-keyboard {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(28, 28, 30, 0.9);
    /* iOS Dark Mode Background */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 8px 3px;
    /* Tighter padding */
    z-index: 10002;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    flex-direction: column;
    gap: 15px;
    /* Increased from 10px to 15px for visible vertical spacing */
    box-sizing: border-box;
    padding-bottom: 30px;
    /* Home indicator space */
}

.learning-keyboard.visible {
    transform: translateY(0);
}

.learning-keyboard-row {
    display: flex;
    justify-content: center;
    gap: 6px;
    /* Key gap */
    padding: 0 3px;
    margin-bottom: 12px;
    /* Explicit margin for vertical spacing */
}

.learning-keyboard-row:last-child {
    margin-bottom: 0;
}

.learning-keyboard-row.bottom-row {
    margin-top: 5px;
    padding: 0 3px;
}

.learning-key {
    background: rgba(255, 255, 255, 0.3);
    /* Light gray for keys */
    border: none;
    border-radius: 5px;
    /* iOS rounded corners */
    padding: 0;
    /* Height controlled by height property or flex */
    height: 46px;
    /* Increased height from 42px to 46px */
    width: 32px;
    /* Base width */
    flex: 1;
    max-width: 100%;
    /* Let flex handle width */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 22px;
    /* Larger font */
    font-weight: 400;
    color: #fff;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.3);
    /* Subtle drop shadow */
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.learning-key:active,
.learning-key.active {
    background: rgba(255, 255, 255, 0.5);
    /* Lighter on press */
    transform: none;
    /* No scale on iOS */
    box-shadow: none;
}

.learning-key-spacer {
    flex: 0;
    /* Default no flex */
}

.learning-key-spacer.half {
    flex: 0.5;
}

.learning-key-spacer.one-and-half {
    flex: 1.5;
}

.learning-key-special {
    background: rgba(100, 100, 100, 0.5);
    /* Darker gray for special keys */
    font-size: 18px;
    flex: 1.5;
}

.learning-key-enter {
    background: #007AFF;
    /* iOS Blue */
    color: white;
    flex: 1;
    font-size: 18px;
    font-weight: 600;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.3);
    height: 50px;
    /* Increased height from 46px to 50px */
}

.learning-key-enter:active,
.learning-key-enter.active {
    background: #0051a8;
    transform: none;
}

/* Tone symbol keys (ˉ ˊ ˇ ˋ) */
.learning-key-tone {
    background: rgba(33, 150, 243, 0.35);
    color: #fff;
    font-size: 26px;
    font-weight: 700;
    flex: 1;
    letter-spacing: 0;
    border-radius: 8px;
}

.learning-key-tone:active,
.learning-key-tone.active {
    background: rgba(33, 150, 243, 0.7);
    box-shadow: none;
}

/* Tone row layout */
.tone-row {
    gap: 10px;
    padding: 0 10px;
    margin-bottom: 14px;
}

/* Success Card Overlay */
.learning-success-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.learning-success-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.learning-success-card {
    background: rgba(28, 28, 30, 0.95);
    border-radius: 20px;
    padding: 30px;
    width: 80%;
    max-width: 320px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.learning-success-overlay.visible .learning-success-card {
    transform: scale(1);
}

.success-content {
    margin-bottom: 25px;
}

.success-character {
    font-size: 80px;
    color: #fff;
    font-weight: bold;
    margin-bottom: 10px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.success-pinyin {
    font-size: 32px;
    color: #4CAF50;
    font-weight: 500;
}

.success-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.success-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
    color: white;
}

.success-btn:active {
    transform: scale(0.9);
}

.search-btn {
    background: rgba(255, 255, 255, 0.2);
}

.audio-btn {
    background: #FFC107;
    /* Amber/Yellow for audio */
    color: #000;
    /* Dark icon for contrast */
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.4);
}

.replay-btn {
    background: #4CAF50;
    /* Green for replay */
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
}

.continue-btn {
    background: #007AFF;
    box-shadow: 0 4px 15px rgba(0, 122, 255, 0.4);
}

/* ── Mistake Review Card ─────────────────────────── */
.learning-mistake-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.learning-mistake-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.learning-mistake-card {
    background: rgba(28, 28, 30, 0.97);
    border-radius: 20px;
    padding: 30px;
    width: 80%;
    max-width: 320px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(255, 75, 43, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid rgba(255, 75, 43, 0.4);
}

.learning-mistake-overlay.visible .learning-mistake-card {
    transform: scale(1);
}

.mistake-label {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #ff4b2b;
    margin-bottom: 16px;
    opacity: 0.85;
}

.mistake-content {
    margin-bottom: 25px;
}

.mistake-character {
    font-size: 80px;
    color: #fff;
    font-weight: bold;
    margin-bottom: 10px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.mistake-pinyin {
    font-size: 32px;
    color: #ff6b4e;
    font-weight: 500;
}

.mistake-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.mistake-continue-btn {
    background: #ff4b2b;
    box-shadow: 0 4px 15px rgba(255, 75, 43, 0.45);
}



/* Mobile Adjustments */
@media screen and (max-width: 768px) {
    .learning-char-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 15px;
        padding-bottom: 200px;
    }

    .learning-char-text {
        font-size: 28px;
    }

    .learning-char-pinyin {
        font-size: 14px;
    }

    /* Game Page Layout Optimization for Keyboard */
    .learning-game-page.active {
        justify-content: flex-start;
        /* Push to top */
        padding-top: 60px;
        /* Increased from 20px to 60px to shift elements down */
    }

    .learning-target-char {
        font-size: 70px;
        /* Smaller */
        margin-bottom: 15px;
    }

    .learning-pinyin-slot {
        width: 32px;
        height: 45px;
        font-size: 24px;
        border-bottom-width: 3px;
        margin: 0 3px;
    }

    .learning-tone-slot {
        min-width: 32px;
        font-size: 26px;
        height: 45px;
        margin-left: 6px;
    }

    .learning-pinyin-input-area {
        margin-bottom: 15px;
        min-height: 50px;
    }


    /* Hide default confirm button as keyboard has one */
    #learningConfirmBtn {
        display: none;
    }

    /* Review Page Adaptation */
    .learning-review-list {
        gap: 15px;
        margin-bottom: 30px;
    }

    .learning-review-item {
        padding: 15px;
        min-width: 80px;
    }

    .learning-review-char {
        font-size: 36px;
        margin-bottom: 5px;
    }

    .learning-review-pinyin {
        font-size: 18px;
    }

    .learning-review-actions {
        padding-bottom: 40px;
        /* Space for scrolling */
    }

    .learning-start-actions {
        padding: 20px;
        flex-direction: column;
        gap: 15px;
        background: rgba(0, 0, 51, 0.98);
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        box-sizing: border-box;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    .learning-btn {
        width: 100%;
        padding: 15px;
        font-size: 16px;
    }
}

/* Info Button */
.learning-info-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.5);
    font-size: 18px;
    padding: 4px;
    margin-left: 6px;
    vertical-align: middle;
    transition: color 0.2s;
    line-height: 1;
}

.learning-info-btn:hover {
    color: rgba(255, 255, 255, 0.9);
}

.learning-info-btn ion-icon {
    vertical-align: middle;
}

/* Mastery Info Popup */
.mastery-info-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10005;
    animation: fadeIn 0.2s ease;
}

.mastery-info-modal {
    background: #1a1a2e;
    border-radius: 16px;
    padding: 28px 24px;
    max-width: 400px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.mastery-info-modal h2 {
    margin: 0 0 20px 0;
    font-size: 20px;
    color: #fff;
    text-align: center;
}

.mastery-info-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
}

.mastery-info-close:hover {
    color: #fff;
}

.mastery-info-levels {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 20px;
}

.mastery-info-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.mastery-info-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.mastery-info-item ion-icon {
    font-size: 22px;
    flex-shrink: 0;
}

.mastery-info-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.mastery-info-text strong {
    color: #fff;
    font-size: 14px;
}

.mastery-info-text span {
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    line-height: 1.4;
}

.mastery-info-srs {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.mastery-info-srs h3 {
    margin: 0 0 8px 0;
    font-size: 15px;
    color: #fff;
}

.mastery-info-srs p {
    margin: 0;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.5;
}

.mastery-info-help-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    margin-top: 16px;
    background: rgba(9, 132, 227, 0.15);
    border: 1px solid rgba(9, 132, 227, 0.3);
    border-radius: 10px;
    color: #74b9ff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.mastery-info-help-btn:hover {
    background: rgba(9, 132, 227, 0.25);
    border-color: rgba(9, 132, 227, 0.5);
}

.mastery-info-help-btn ion-icon {
    font-size: 18px;
}

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