/* ==========================================================================
   EN_MARCHA — Eye-Friendly Soft Sage & Cream Gold Glassmorphism Theme
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700;800&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

:root {
    --font-heading: 'Outfit', -apple-system, sans-serif;
    --font-body: 'Plus Jakarta Sans', -apple-system, sans-serif;

    /* Backgrounds: Lighter, Rich Sage-Emerald Glass Theme (Comfortable & Luminous) */
    --bg-dark: #16241e;
    --bg-dark-gradient: radial-gradient(circle at 50% -10%, #20362c 0%, #172720 50%, #111c17 100%);
    --bg-card: rgba(30, 48, 39, 0.65);
    --bg-card-hover: rgba(40, 64, 52, 0.75);

    /* Borders & Glass Glow (Crisp, Translucent & Luminous) */
    --border-glass: rgba(255, 255, 255, 0.15);
    --border-glass-bright: rgba(134, 239, 172, 0.35);
    --border-glow: rgba(253, 224, 71, 0.35);
    --shadow-glass: 0 16px 40px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);

    /* Text Hierarchy (High contrast & crisp on mobile) */
    --text-primary: #ffffff;
    --text-secondary: #a7f3d0;
    --text-muted: #cbd5e1;
    --text-spanish: #fef08a;

    /* Soft Pastel Accent Palette */
    --accent-lemon: #fef08a;
    --accent-lime: #86efac;
    --accent-gold: #fde047;
    --accent-amber: #fbbf24;
    --accent-emerald: #34d399;
    --accent-green-bright: #10b981;
    --accent-indigo: #a7f3d0;
    --gradient-citrus: linear-gradient(135deg, #fde047 0%, #86efac 100%);
    --gradient-mint: linear-gradient(135deg, #86efac 0%, #34d399 50%, #10b981 100%);

    /* Radii */
    --radius-sm: 12px;
    --radius-md: 18px;
    --radius-lg: 26px;
    --radius-full: 9999px;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-dark);
    background-image: var(--bg-dark-gradient);
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.5;
    position: relative;
    overflow-x: hidden;
}

/* Ambient Glow Effects (Lighter & Radiant Aura) */
.bg-glow-pink, .bg-glow-citrus {
    position: fixed;
    top: -15vh;
    right: -10vw;
    width: 65vw;
    height: 65vh;
    background: radial-gradient(circle, rgba(134, 239, 172, 0.18) 0%, rgba(253, 224, 71, 0.12) 45%, transparent 75%);
    filter: blur(90px);
    pointer-events: none;
    z-index: 0;
}

.bg-glow-bottom {
    position: fixed;
    bottom: -15vh;
    left: -10vw;
    width: 55vw;
    height: 55vh;
    background: radial-gradient(circle, rgba(52, 211, 153, 0.15) 0%, rgba(134, 239, 172, 0.10) 50%, transparent 75%);
    filter: blur(100px);
    pointer-events: none;
    z-index: 0;
}

/* Glass Panel Base with Light Edge Shine */
.glass-panel {
    background: var(--bg-card);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-glass);
}

/* App Container */
.app-container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    position: relative;
    z-index: 1;
}

/* Header */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 2rem;
    background: rgba(28, 44, 36, 0.75);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    margin-bottom: 2.5rem;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.brand-name {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.45rem;
    background: linear-gradient(135deg, #ffffff 0%, #fef08a 40%, #86efac 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
    filter: drop-shadow(0 2px 8px rgba(134, 239, 172, 0.2));
}

.header-progress {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    max-width: 380px;
    margin: 0 2rem;
}

.progress-track {
    flex: 1;
    height: 10px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: var(--radius-full);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #34d399 0%, #86efac 60%, #fde047 100%);
    border-radius: var(--radius-full);
    box-shadow: 0 0 12px rgba(134, 239, 172, 0.6);
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-pct {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-secondary);
}

.xp-badge {
    background: linear-gradient(135deg, rgba(253, 224, 71, 0.2) 0%, rgba(250, 204, 21, 0.1) 100%);
    border: 1px solid rgba(253, 224, 71, 0.4);
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius-full);
    font-weight: 800;
    color: #fde047;
    box-shadow: 0 0 15px rgba(253, 224, 71, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Grid of 10 Units */
.units-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.75rem;
    margin-bottom: 3rem;
}

/* Unit Card */
.unit-card {
    padding: 1.75rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 280px;
    position: relative;
    background: var(--bg-card);
}

.unit-card:hover:not(.locked) {
    transform: translateY(-4px);
    background: var(--bg-card-hover);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.35);
    border-color: rgba(134, 239, 172, 0.25);
}

.unit-card.locked {
    opacity: 0.45;
    cursor: not-allowed;
    filter: grayscale(0.5);
}

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

.unit-card-num {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.unit-card-title {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 800;
    margin-bottom: 0.4rem;
    color: var(--text-primary);
}

.unit-card-subtitle {
    font-size: 0.88rem;
    color: #cbd5e1;
    line-height: 1.45;
}

.unit-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    margin-top: 1.5rem;
}

.unit-card-progress {
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.unit-card-progress-bar {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width 0.3s ease;
}

/* Button & Interactive Component Styles */
.btn-primary {
    background: var(--gradient-mint);
    color: #062419;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 0.98rem;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    box-shadow: 0 6px 20px rgba(52, 211, 153, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.5);
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px) scale(1.02);
    background: linear-gradient(135deg, #a7f3d0 0%, #34d399 100%);
    box-shadow: 0 8px 25px rgba(52, 211, 153, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.btn-primary:active {
    transform: translateY(0) scale(0.97);
}

.btn-icon {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    padding: 8px 14px;
    border-radius: 14px;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.btn-icon:hover {
    background: rgba(134, 239, 172, 0.2);
    border-color: var(--accent-lime);
    color: #fff;
    box-shadow: 0 0 15px rgba(134, 239, 172, 0.35);
}

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

.option-btn {
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: var(--text-primary);
    padding: 13px 20px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 1.02rem;
    font-weight: 700;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.option-btn:hover:not(:disabled) {
    background: rgba(134, 239, 172, 0.18);
    border-color: rgba(134, 239, 172, 0.45);
    box-shadow: 0 6px 20px rgba(134, 239, 172, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

.option-btn:active:not(:disabled) {
    transform: translateY(0) scale(0.98);
}

.option-btn.correct {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.35) 0%, rgba(52, 211, 153, 0.25) 100%) !important;
    border-color: #10b981 !important;
    color: #ffffff !important;
    box-shadow: 0 0 25px rgba(16, 185, 129, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
}

.option-btn.wrong {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.35) 0%, rgba(220, 38, 38, 0.25) 100%) !important;
    border-color: #ef4444 !important;
    color: #ffffff !important;
    box-shadow: 0 0 25px rgba(239, 68, 68, 0.45) !important;
}

/* Modals & Scroll Lock */
body.modal-open {
    overflow: hidden !important;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(12, 22, 17, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    padding: 1.5rem 1rem;
    overflow-y: auto;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: rgba(22, 36, 29, 0.92);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border-glass-bright);
    border-radius: var(--radius-lg);
    padding: 1.75rem 2rem;
    width: 100%;
    max-width: 840px;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.25);
    position: relative;
    margin: auto;
}

/* Custom Modal Scrollbar */
.modal-content::-webkit-scrollbar {
    width: 6px;
}
.modal-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 4px;
}
.modal-content::-webkit-scrollbar-thumb {
    background: rgba(134, 239, 172, 0.35);
    border-radius: 4px;
}
.modal-content::-webkit-scrollbar-thumb:hover {
    background: rgba(134, 239, 172, 0.55);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.close-modal {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.8rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s ease;
}

.close-modal:hover {
    color: var(--accent-lime);
}

/* Compact Vocab WordBank Card UI (Radiant & Light) */
.wordbank-header-card {
    background: linear-gradient(135deg, rgba(134, 239, 172, 0.16) 0%, rgba(253, 224, 71, 0.12) 100%);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(134, 239, 172, 0.35);
    border-radius: var(--radius-md);
    padding: 1.35rem 1.65rem;
    margin-bottom: 1.35rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.wordbank-word-title {
    font-size: 1.9rem;
    font-weight: 800;
    color: #ffffff;
    margin: 0;
    line-height: 1.2;
    background: linear-gradient(135deg, #ffffff 40%, #fef08a 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.3));
}

.wordbank-translation {
    font-size: 1.15rem;
    font-weight: 700;
    color: #86efac;
    font-style: italic;
    margin-top: 2px;
}

.example-row-card {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.04) 100%);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-left: 4px solid rgba(134, 239, 172, 0.75) !important;
    padding: 14px 18px;
    border-radius: var(--radius-md);
    margin-bottom: 0.85rem;
    transition: all 0.25s ease;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.example-row-card:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.06) 100%);
    border-color: rgba(134, 239, 172, 0.4);
    box-shadow: 0 8px 22px rgba(134, 239, 172, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.example-row-text {
    width: 100% !important;
    text-align: left !important;
}

.example-row-actions {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
    align-items: center !important;
    margin-top: 4px !important;
    width: 100% !important;
}

.example-es-text {
    font-size: 1.05rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
    line-height: 1.4;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.example-ru-text {
    font-size: 0.9rem;
    color: #86efac;
    font-style: italic;
    font-weight: 600;
    margin-top: 5px;
    display: none;
}

.example-ru-text.visible {
    display: block;
}

.btn-icon-sm {
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #ffffff;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 700;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-icon-sm:hover {
    background: rgba(134, 239, 172, 0.25);
    border-color: var(--accent-lime);
    color: #ffffff;
    box-shadow: 0 0 15px rgba(134, 239, 172, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.btn-icon-sm:active {
    transform: scale(0.94);
}

.btn-icon-sm.active {
    background: rgba(134, 239, 172, 0.35);
    border-color: var(--accent-lime);
    color: #ffffff;
    box-shadow: 0 0 15px rgba(134, 239, 172, 0.5);
}

/* Toast Container */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 2000;
}

.toast {
    background: #16241e;
    border: 1px solid var(--border-glass);
    color: #fff;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-weight: 700;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.toast-success {
    border-color: #10b981;
}

.toast-error {
    border-color: #ef4444;
}

/* Dashboard Footer */
.dashboard-footer {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border-glass);
}

.footer-link {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.footer-link:hover {
    color: var(--text-primary);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .app-header {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    .header-progress {
        width: 100%;
        max-width: none;
        margin: 0;
    }
}
