/* CSS Variables & Theme Setup - Colorful Premium Dark Mode */
:root {
    --bg-main: #080b11; /* Deep Space Obsidian */
    --bg-card: rgba(17, 24, 39, 0.55);
    --bg-card-hover: rgba(26, 36, 59, 0.75);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.18);
    
    --text-primary: #f8fafc; /* Slate 50 */
    --text-secondary: #94a3b8; /* Slate 400 */
    --text-muted: #64748b; /* Slate 500 */
    
    --color-accent: #6366f1; /* Indigo */
    --color-cyan: #06b6d4; /* Cyan */
    --color-pink: #ec4899; /* Pink */
    --color-purple: #a855f7; /* Purple */
    --color-success: #10b981; /* Green */
    --color-danger: #ef4444; /* Red */
    --color-amber: #f59e0b; /* Amber */
    
    --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-quick: all 0.15s ease-out;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-body);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
    position: relative;
}

/* Ambient Neon Background Lights */
body::before {
    content: "";
    position: fixed;
    top: -150px;
    left: -150px;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.14) 0%, transparent 70%);
    pointer-events: none;
    z-index: -1;
}

body::after {
    content: "";
    position: fixed;
    bottom: -150px;
    right: -150px;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.14) 0%, transparent 70%);
    pointer-events: none;
    z-index: -1;
}

/* Additional glowing spheres */
.bg-glow-pink {
    position: fixed;
    top: 40%;
    left: 70%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(236, 72, 153, 0.08) 0%, transparent 70%);
    pointer-events: none;
    z-index: -1;
}

.bg-glow-amber {
    position: fixed;
    top: 15%;
    left: 40%;
    width: 550px;
    height: 550px;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.07) 0%, transparent 70%);
    pointer-events: none;
    z-index: -1;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 800;
    letter-spacing: -0.02em;
}

code {
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    color: var(--color-cyan);
}

/* Layout App Container */
.app-container {
    display: block;
    min-height: 100vh;
}

/* Sidebar Layout - Desktop (Hidden) */
.sidebar {
    display: none !important;
}

/* Bottom Navigation - Mobile (Hidden) */
.bottom-nav {
    display: none !important;
}

/* Header Progress Bar & Settings Icon */
.header-progress {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-grow: 1;
    max-width: 400px;
    margin: 0 20px;
}

.header-progress .progress-track {
    flex-grow: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    overflow: hidden;
}

.header-progress .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-cyan), var(--color-accent));
    border-radius: 4px;
    width: 0%;
    transition: width 0.5s ease-in-out;
}

.header-progress .progress-pct {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 0.9rem;
    color: var(--color-cyan);
    min-width: 35px;
    text-align: right;
}

.btn-settings {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 44px;
    height: 44px;
    border-radius: 12px;
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}

.btn-settings:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--border-hover);
    transform: rotate(45deg);
}

/* Main Content Area */
.main-content {
    flex-grow: 1;
    margin: 0 auto;
    padding: 2.5rem 1.5rem;
    max-width: 1000px;
    width: 100%;
}

/* Header styling */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
}

.header-title h1 {
    font-size: 2.25rem;
    font-weight: 855;
    margin-bottom: 4px;
    background: linear-gradient(135deg, #ffffff 40%, #a5b4fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 16px;
}

.xp-badge {
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    padding: 6px 14px;
    border-radius: 20px;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.9rem;
    color: #a5b4fc;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.15);
}

.avatar {
    width: 44px;
    height: 44px;
    background: radial-gradient(circle, var(--color-purple) 0%, var(--color-accent) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

/* Glassmorphism Panel */
.glass-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 2rem;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    transition: var(--transition-smooth);
}

.glass-panel:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
    box-shadow: 0 12px 45px rgba(0, 0, 0, 0.55), 0 0 15px rgba(99, 102, 241, 0.12);
}

/* Welcome Card style */
.welcome-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    position: relative;
    overflow: hidden;
}

.welcome-text {
    z-index: 1;
    max-width: 70%;
}

.welcome-text h2 {
    font-size: 1.8rem;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #ffffff 40%, #c084fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.welcome-text p {
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.welcome-badge {
    font-size: 5rem;
    z-index: 1;
    animation: float 4s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 1.5rem;
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    position: relative;
}

.pink-glow {
    background: rgba(236, 72, 153, 0.15);
    box-shadow: 0 0 12px rgba(236, 72, 153, 0.2);
}

.purple-glow {
    background: rgba(168, 85, 247, 0.15);
    box-shadow: 0 0 12px rgba(168, 85, 247, 0.2);
}

.cyan-glow {
    background: rgba(6, 182, 212, 0.15);
    box-shadow: 0 0 12px rgba(6, 182, 212, 0.2);
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.8rem;
    font-family: var(--font-heading);
    font-weight: 800;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
}

/* Screens toggling */
.screen {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

.screen.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Progress Section details */
.progress-bar-container {
    margin-top: 2rem;
}

.progress-bar-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 600;
}

.progress-track {
    width: 100%;
    height: 12px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 6px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-accent), var(--color-cyan));
    border-radius: 6px;
    transition: width 0.5s ease-in-out;
}

.progress-bar-percentage {
    text-align: right;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 0.9rem;
    color: var(--color-cyan);
}

/* Settings Select styles */
.settings-container h3 {
    margin-bottom: 1.5rem;
}

.settings-group {
    margin-bottom: 2rem;
}

.settings-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
}

.custom-select {
    width: 100%;
    max-width: 400px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px;
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.custom-select:focus {
    border-color: var(--color-accent);
}

.custom-select option {
    color: #1e293b;
    background-color: #ffffff;
}

.settings-desc {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 6px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: 14px;
    font-family: var(--font-heading);
    font-weight: 600;
    cursor: pointer;
    font-size: 0.95rem;
    transition: var(--transition-smooth);
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-accent) 0%, rgba(99, 102, 241, 0.8) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.35);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.55);
    transform: translateY(-1px);
}

.btn-success {
    background: linear-gradient(135deg, var(--color-success) 0%, rgba(16, 185, 129, 0.8) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.35);
}

.btn-success:hover {
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.55);
    transform: translateY(-1px);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #fca5a5;
}

.btn-danger:hover {
    background: var(--color-danger);
    color: white;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.45);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-outline:hover {
    border-color: var(--border-hover);
    background: rgba(255, 255, 255, 0.04);
}

.btn-audio {
    background: rgba(6, 182, 212, 0.12);
    border: 1px solid rgba(6, 182, 212, 0.25);
    color: var(--color-cyan);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-audio:hover {
    background: var(--color-cyan);
    color: white;
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.35);
}

.btn-nav {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}

.btn-nav:hover {
    border-color: var(--border-hover);
    background: rgba(255, 255, 255, 0.08);
}

/* === Roadmap & Unit Cards === */
.units-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.unit-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    cursor: pointer;
    position: relative;
    border-radius: 24px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
    transition: var(--transition-smooth);
}

.unit-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.unit-card-num {
    font-size: 0.85rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.unit-lock-badge {
    font-size: 1.1rem;
}

.unit-card-title {
    font-size: 1.3rem;
    font-weight: 800;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.unit-card-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.unit-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 1.5rem;
}

.unit-card-tags .tag {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 3px 8px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.unit-card-footer {
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.unit-card-goal {
    color: var(--color-success);
    font-weight: 600;
}

.unit-card-progress {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
}

.unit-card-progress-bar {
    height: 100%;
    width: 0%;
    transition: width 0.3s ease;
}

/* === Flippable Flashcards === */
.flashcard {
    perspective: 1000px;
    width: 100%;
    max-width: 380px;
    height: 240px;
    cursor: pointer;
}

.flashcard-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}

.flashcard.flipped .flashcard-inner {
    transform: rotateY(180deg);
}

.flashcard-front, .flashcard-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 24px;
    border: 1px solid var(--border-color);
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.flashcard-front {
    background: linear-gradient(135deg, rgba(23, 28, 41, 0.95) 0%, rgba(13, 17, 26, 0.95) 100%);
    color: var(--text-primary);
}

.flashcard-back {
    background: linear-gradient(135deg, rgba(13, 17, 26, 0.95) 0%, rgba(23, 28, 41, 0.95) 100%);
    border-color: rgba(6, 182, 212, 0.25);
    color: var(--color-cyan);
    transform: rotateY(180deg);
}

.card-lang {
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.card-word {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 8px;
    text-align: center;
    background: linear-gradient(135deg, #ffffff 40%, #a5b4fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.card-translation {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 800;
    text-align: center;
}

.card-hint {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 1.25rem;
    max-width: 90%;
    text-align: center;
}

/* === Word Matching Grid === */
.match-btn {
    background: rgba(99, 102, 241, 0.05);
    border: 1px solid rgba(99, 102, 241, 0.22);
    padding: 16px;
    border-radius: 14px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.08);
    transition: var(--transition-smooth);
    text-align: center;
}

.match-btn:hover {
    border-color: rgba(99, 102, 241, 0.45);
    background: rgba(99, 102, 241, 0.12);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.15);
}

.match-btn.selected {
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--color-accent);
    color: #a5b4fc;
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.35);
}

.match-btn.correct {
    background: rgba(16, 185, 129, 0.2);
    border-color: var(--color-success);
    color: #6ee7b7;
    pointer-events: none;
    opacity: 0.65;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.35);
}

.match-btn.wrong {
    background: rgba(239, 68, 68, 0.2);
    border-color: var(--color-danger);
    color: #fca5a5;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.35);
}

.completion-badge {
    padding: 6px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.completion-badge.complete {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.25);
    color: #6ee7b7 !important;
}

/* === Responsive Overrides === */
@media (max-width: 900px) {
    .vocab-layout {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }
}

@media (max-width: 767px) {
    .sidebar {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
        padding: 1.5rem 1rem 2rem 1rem !important;
    }
    
    .bottom-nav {
        display: none !important;
    }
    
    .app-header {
        margin-bottom: 1.5rem;
    }
    
    .header-title h1 {
        font-size: 1.8rem;
    }
    
    .welcome-card {
        flex-direction: column-reverse;
        align-items: flex-start;
        gap: 1rem;
        padding: 1.5rem;
    }
    
    .welcome-text {
        max-width: 100%;
    }
    
    .welcome-badge {
        font-size: 3.5rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .glass-panel {
        padding: 1.5rem;
    }

    .vocab-layout {
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .unit-action-footer {
        flex-direction: column;
        align-items: stretch !important;
        gap: 1.5rem !important;
        text-align: center;
    }
    
    .footer-status {
        flex-direction: column;
        align-items: stretch !important;
    }
}

.category-tabs-container .btn.active {
    background: var(--color-cyan) !important;
    border-color: var(--color-cyan) !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.35) !important;
}

.feedback-box.correct {
    background: rgba(16, 185, 129, 0.15) !important;
    border: 1px solid rgba(16, 185, 129, 0.25) !important;
    color: #a7f3d0 !important;
}

.feedback-box.wrong {
    background: rgba(239, 68, 68, 0.15) !important;
    border: 1px solid rgba(239, 68, 68, 0.25) !important;
    color: #fca5a5 !important;
}

.grammar-option-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    padding: 12px 20px;
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    font-family: var(--font-heading);
    font-weight: 600;
}

.grammar-option-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border-hover);
}

.grammar-option-btn.selected {
    background: var(--color-accent) !important;
    border-color: var(--color-accent) !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35) !important;
}

.grammar-input {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 6px 12px;
    color: var(--text-primary);
    font-size: 1.1rem;
    font-family: var(--font-heading);
    font-weight: 700;
    width: 140px;
    text-align: center;
    outline: none;
    transition: var(--transition-smooth);
}

.grammar-input:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.3);
}

.grammar-input.correct {
    border-color: var(--color-success) !important;
    background: rgba(16, 185, 129, 0.1) !important;
    color: #a7f3d0 !important;
}

.grammar-input.wrong {
    border-color: var(--color-danger) !important;
    background: rgba(239, 68, 68, 0.1) !important;
    color: #fca5a5 !important;
}

.sound-chip {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: var(--transition-smooth);
    font-weight: 600;
    user-select: none;
}

.sound-chip:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border-hover);
}

.sound-chip.selected {
    border-color: var(--color-purple) !important;
    background: rgba(147, 51, 234, 0.1) !important;
    box-shadow: 0 0 10px rgba(147, 51, 234, 0.25);
}

.sound-chip.correct {
    border-color: var(--color-success) !important;
    background: rgba(16, 185, 129, 0.1) !important;
}

.sound-chip.wrong {
    border-color: var(--color-danger) !important;
    background: rgba(239, 68, 68, 0.1) !important;
}

.sound-play-icon {
    font-size: 1.1rem;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.sound-chip:hover .sound-play-icon {
    opacity: 1;
}

.chat-bubble {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 0.95rem;
    line-height: 1.5;
    animation: bubbleFadeIn 0.3s ease-out;
}

@keyframes bubbleFadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

.chat-bubble.left {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom-left-radius: 4px;
    color: var(--text-primary);
}

.chat-bubble.right {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--color-success) 0%, rgba(22, 163, 74, 0.8) 100%) !important;
    color: white !important;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.25);
}

.advice-chip {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 0.9rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition-smooth);
    font-weight: 600;
}

.advice-chip:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border-hover);
}

.advice-chip.active-slot {
    background: var(--color-success) !important;
    border-color: var(--color-success) !important;
    color: white !important;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.advice-slot.filled {
    border-color: var(--color-success) !important;
    background: rgba(16, 185, 129, 0.08) !important;
    color: var(--color-success) !important;
    font-weight: 700;
}

/* === Vocab progress pill dots === */
.progress-dot-pill {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: var(--transition-smooth);
    user-select: none;
}

.progress-dot-pill.active {
    color: white;
    background: rgba(6, 182, 212, 0.15) !important;
    border-color: var(--color-cyan) !important;
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.2);
}

.progress-dot-pill.completed {
    color: var(--color-success) !important;
    background: rgba(16, 185, 129, 0.08) !important;
    border-color: rgba(16, 185, 129, 0.2) !important;
}

/* === Shake animation for incorrect answers === */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

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

/* === Pronunciation practice mic and feedback styles === */
.btn-mic {
    border-color: var(--color-accent) !important;
    color: var(--color-accent) !important;
    background: transparent;
    transition: var(--transition-smooth);
}

.btn-mic:hover {
    background: rgba(244, 63, 94, 0.08);
    border-color: var(--color-accent-hover) !important;
}

.btn-mic.recording {
    background: var(--color-accent) !important;
    color: white !important;
    border-color: var(--color-accent) !important;
    animation: pulse-mic 1.2s infinite ease-in-out;
}

@keyframes pulse-mic {
    0% {
        box-shadow: 0 0 0 0 rgba(244, 63, 94, 0.6);
    }
    70% {
        box-shadow: 0 0 0 8px rgba(244, 63, 94, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(244, 63, 94, 0);
    }
}

.speech-feedback {
    width: 100%;
    font-size: 0.85rem;
    padding: 10px 14px;
    border-radius: 12px;
    text-align: left;
    margin-top: 6px;
    line-height: 1.4;
    transition: opacity 0.3s ease, transform 0.3s ease;
    border: 1px solid transparent;
}

.speech-feedback.info {
    background: rgba(6, 182, 212, 0.08);
    border-color: rgba(6, 182, 212, 0.2);
    color: var(--color-cyan);
}

.speech-feedback.success {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.2);
    color: var(--color-success);
}

.speech-feedback.warning {
    background: rgba(244, 63, 94, 0.08);
    border-color: rgba(244, 63, 94, 0.2);
    color: var(--color-accent);
}

/* Red blink animation for wrong multiple choice answers */
@keyframes blink-red {
    0%, 100% {
        background: transparent;
        border-color: var(--border-color);
        color: var(--text-primary);
    }
    50% {
        background: rgba(239, 68, 68, 0.2) !important;
        border-color: var(--color-danger) !important;
        color: #fca5a5 !important;
    }
}

.blink-red {
    animation: blink-red 0.3s ease-in-out 2;
}

/* === REVISED PRACTICE AESTHETICS === */

/* Color-coded matching buttons (Phase 1 & 3) */
.match-btn.col-spanish {
    background: rgba(168, 85, 247, 0.05); /* Purple tinted */
    border: 1px solid rgba(168, 85, 247, 0.22);
}
.match-btn.col-spanish:hover {
    border-color: rgba(168, 85, 247, 0.45);
    background: rgba(168, 85, 247, 0.12);
}
.match-btn.col-spanish.selected {
    background: rgba(168, 85, 247, 0.2);
    border-color: var(--color-purple);
    color: #e9d5ff;
    box-shadow: 0 0 12px rgba(168, 85, 247, 0.35);
}

.match-btn.col-russian {
    background: rgba(6, 182, 212, 0.05); /* Cyan tinted */
    border: 1px solid rgba(6, 182, 212, 0.22);
}
.match-btn.col-russian:hover {
    border-color: rgba(6, 182, 212, 0.45);
    background: rgba(6, 182, 212, 0.12);
}
.match-btn.col-russian.selected {
    background: rgba(6, 182, 212, 0.2);
    border-color: var(--color-cyan);
    color: #a5f3fc;
    box-shadow: 0 0 12px rgba(6, 182, 212, 0.35);
}

/* Force correct and wrong styling override for matching states */
.match-btn.col-spanish.correct,
.match-btn.col-russian.correct {
    background: rgba(16, 185, 129, 0.2) !important;
    border: 1px solid var(--color-success) !important;
    color: #6ee7b7 !important;
    pointer-events: none;
    opacity: 0.65;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.35) !important;
}

.match-btn.col-spanish.wrong,
.match-btn.col-russian.wrong {
    background: rgba(239, 68, 68, 0.2) !important;
    border: 1px solid var(--color-danger) !important;
    color: #fca5a5 !important;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.35) !important;
}

/* Choice Grid (Phase 2) */
.choice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.2rem;
    margin: 2rem 0;
}

/* Tactile 3D Magnetic Letter Tiles (Phase 4) */
.magnetic-tile {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.03) 100%);
    border: 1px solid var(--border-color);
    border-bottom: 4px solid rgba(0, 0, 0, 0.45) !important; /* Bevel depth */
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 700;
    font-size: 1.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 48px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1), background 0.15s ease;
    user-select: none;
}

.magnetic-tile:hover {
    transform: translateY(-2px);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.06) 100%);
}

.magnetic-tile:active {
    transform: translateY(1px);
    border-bottom-width: 1px !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Magnetic Tiles Palette Colors */
.magnetic-tile.tile-amber {
    border-color: rgba(245, 158, 11, 0.35);
    background: linear-gradient(180deg, rgba(245, 158, 11, 0.15) 0%, rgba(245, 158, 11, 0.06) 100%);
    color: #fef08a;
}
.magnetic-tile.tile-amber:hover {
    border-color: rgba(245, 158, 11, 0.6);
    background: linear-gradient(180deg, rgba(245, 158, 11, 0.22) 0%, rgba(245, 158, 11, 0.1) 100%);
}

.magnetic-tile.tile-pink {
    border-color: rgba(236, 72, 153, 0.35);
    background: linear-gradient(180deg, rgba(236, 72, 153, 0.15) 0%, rgba(236, 72, 153, 0.06) 100%);
    color: #fbcfe8;
}
.magnetic-tile.tile-pink:hover {
    border-color: rgba(236, 72, 153, 0.6);
    background: linear-gradient(180deg, rgba(236, 72, 153, 0.22) 0%, rgba(236, 72, 153, 0.1) 100%);
}

.magnetic-tile.tile-cyan {
    border-color: rgba(6, 182, 212, 0.35);
    background: linear-gradient(180deg, rgba(6, 182, 212, 0.15) 0%, rgba(6, 182, 212, 0.06) 100%);
    color: #a5f3fc;
}
.magnetic-tile.tile-cyan:hover {
    border-color: rgba(6, 182, 212, 0.6);
    background: linear-gradient(180deg, rgba(6, 182, 212, 0.22) 0%, rgba(6, 182, 212, 0.1) 100%);
}

.magnetic-tile.tile-purple {
    border-color: rgba(168, 85, 247, 0.35);
    background: linear-gradient(180deg, rgba(168, 85, 247, 0.15) 0%, rgba(168, 85, 247, 0.06) 100%);
    color: #e9d5ff;
}
.magnetic-tile.tile-purple:hover {
    border-color: rgba(168, 85, 247, 0.6);
    background: linear-gradient(180deg, rgba(168, 85, 247, 0.22) 0%, rgba(168, 85, 247, 0.1) 100%);
}

/* === CIRCULAR CONTROLS FOR VOICE PRACTICE (Phases 2 & 4) === */
.control-circle-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
    transition: var(--transition-smooth);
    user-select: none;
    outline: none;
}
.control-circle-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border-hover);
    transform: scale(1.08);
}
.control-circle-btn.btn-play {
    color: var(--color-success);
    border-color: rgba(16, 185, 129, 0.25);
}
.control-circle-btn.btn-play:hover {
    border-color: var(--color-success);
    background: rgba(16, 185, 129, 0.1);
}
.control-circle-btn.btn-slow {
    color: var(--color-cyan);
    border-color: rgba(6, 182, 212, 0.25);
    font-size: 0.95rem;
}
.control-circle-btn.btn-slow:hover {
    border-color: var(--color-cyan);
    background: rgba(6, 182, 212, 0.1);
}
.control-circle-btn.btn-mic {
    color: var(--color-pink);
    border-color: rgba(236, 72, 153, 0.25);
}
.control-circle-btn.btn-mic:hover {
    border-color: var(--color-pink);
    background: rgba(236, 72, 153, 0.1);
}
.control-circle-btn.btn-mic.recording {
    background: rgba(239, 68, 68, 0.25) !important;
    border-color: var(--color-danger) !important;
    color: #fff !important;
    animation: pulse-red-mic 1.5s infinite;
}

@keyframes pulse-red-mic {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

.shake-error {
    animation: shake 0.4s ease-in-out !important;
    border-color: var(--color-danger) !important;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.4) !important;
}


