/* ၁။ Theme Variables */
:root {
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(255, 255, 255, 0.6);
    --bg-grad: linear-gradient(135deg, #FF9933 0%, #fff7ed 50%, #138808 100%);
    --text-primary: #0f172a;
    /* Slate 900 */
    --text-secondary: #334155;
    /* Slate 700 */
    --primary: #1d4ed8;
    /* Blue 700 */
    --card-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.08);
}

.dark {
    --glass-bg: rgba(15, 23, 42, 0.85);
    /* ပိုမှောင်စေရန် */
    --glass-border: rgba(255, 255, 255, 0.08);
    --bg-grad: linear-gradient(135deg, #3f1e00 0%, #00003f 50%, #031802 100%);
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
}

.dark h3 span.opacity-50 {
    opacity: 0.5;
    /* Dark Mode မှာ 50% */
}

h3 span.text-sm {
    color: inherit;
    opacity: 0.6;
    /* Light Mode မှာ 60% အလိုအလျောက်ဖြစ်စေရန် */
}

/* ၂။ Base Styles */
* {
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body {
    background: var(--bg-grad) !important;
    background-attachment: fixed;
    color: var(--text-primary);
    font-family: 'Padauk', sans-serif;
    transition: background 0.5s ease, color 0.3s ease;
    min-height: 100vh;
    margin: 0;

    -webkit-user-select: none;
    /* Safari & Chrome Mobile */
    -moz-user-select: none;
    /* Firefox */
    -ms-user-select: none;
    /* IE 10+ */
    user-select: none;
    /* Standard syntax */

    /* Mobile တွင် ဖိထားပါက ပေါ်လာသော menu ကို ပိတ်ရန် */
    -webkit-touch-callout: none;
}

:root {
    --primary: #1d4ed8;
    /* Default color */
}

/* ခလုတ်တွေရဲ့ စာလုံးဖောင့်ကို ညှိရန် */
[data-lang] {
    font-family: 'Padauk', 'Noto Sans Hindi', sans-serif;
}

/* Input box များတွင် စာရိုက်၍ရအောင် ချွင်းချက်ထားပေးရန် */
input,
textarea {
    -webkit-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

/* ၃။ Glassmorphism Core (Nav & Cards) */
.menu-card,
.lesson-card {
    background: var(--glass-bg) !important;
    backdrop-filter: blur(15px) saturate(180%) !important;
    /*-webkit-backdrop-filter: blur(15px) saturate(180%) !important;*/
    border: 1px solid var(--glass-border) !important;
    border-radius: 24px;
    box-shadow: var(--card-shadow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.menu-card .w-16 {
    /* --primary-rgb ကို မူလ Blue အရောင်မှ ယူသုံးမည် */
    background: rgba(37, 99, 235, 0.1) !important;
    border: 1px solid rgba(37, 99, 235, 0.2) !important;
    color: var(--primary) !important;
    /* Icon အရောင်ကို Theme အရောင်ပေးခြင်း */
}

.menu-card:hover .w-16 {
    transform: scale(1.1) rotate(-5deg);
    /* Hover လုပ်ရင် Icon လေး နည်းနည်း စောင်းသွားစေရန် */
}

/* ၆။ Hover Effects */
.menu-card:hover,
.lesson-card:hover:not(.active-lesson) {
    transform: translateY(-5px);
    background: #ffffff !important;
    /* လုံးဝအဖြူရောင်ဖြစ်စေရန် */
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.12);
}

/* Light Mode (Dark မဟုတ်သော အခြေအနေ) မှာပဲ hover လုပ်ရင် အမည်းရောင်ပြောင်းမည် */
html:not(.dark) .menu-card:hover .myanmar-text,
html:not(.dark) .menu-card:hover h3,
html:not(.dark) .menu-card:hover .english-text {
    color: #000000 !important;
}

/* Dark Mode မှာ hover လုပ်ရင် စာသားတွေ အဖြူရောင် (သို့မဟုတ်) နဂိုအတိုင်းပဲ ရှိနေစေရန် */
.dark .menu-card:hover .myanmar-text,
.dark .menu-card:hover h3,
.dark .menu-card:hover .english-text {
    color: #f8fafc !important;
    /* သို့မဟုတ် var(--text-primary) */
}


/* Main Nav နဲ့ Bottom Nav နှစ်ခုလုံးအတွက် */
nav {
    /* ၁။ Position & Layering */
    position: sticky;
    top: 0;
    z-index: 100;
    /* မူလ HTML မှာ z-[100] လို့ ပေးထားတဲ့အတွက် ဒီမှာလည်း 100 ညှိထားတာ ပိုကောင်းပါတယ် */

    /* ၂။ Glassmorphism Effect */
    background: var(--glass-bg) !important;
    backdrop-filter: blur(15px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(15px) saturate(180%) !important;

    /* ၃။ Borders */
    border: none !important;
    border-bottom: 1px solid var(--glass-border) !important;

    /* ၄။ Sizing & Layout */
    height: 80px;
    width: 100% !important;
    max-width: none !important;
    display: flex;
    align-items: center;

    /* ၅။ Reset Styles */
    border-radius: 0 !important;
    margin: 0 !important;
    left: 0;
}

#nav-controls {
    border-top: 1px solid var(--glass-border) !important;
}

/* ၄။ Text Colors & Typography */
/* ၁။ Header နှင့် Telugu Text များအတွက် (အရောင်နှင့် Font ပေါင်းစပ်မှု) */
/* ၁။ Header နှင့် Telugu Text များအတွက် (အရောင်နှင့် Font ပေါင်းစပ်မှု) */
#header-title,
.telugu-text,
.telugu-text-large {
    font-family: 'Noto Sans Hindi', sans-serif;
    /* Font ထည့်သွင်းမှု */
    color: var(--primary) !important;
    transition: color 0.3s ease;
    line-height: 1.6;
    direction: ltr;
    unicode-bidi: isolate;
}

/* တစ်ခါတစ်ရံ စာလုံးအရွယ်အစား သေးနေတတ်သဖြင့် အနည်းငယ် ကြီးပေးခြင်း */
.telugu-container .telugu-text {
    font-size: 1.25em;
}

/* ၂။ မြန်မာစာသားအတွက် (Font, အရောင်နှင့် အထူအပါး) */
.myanmar-text {
    font-family: 'Padauk', sans-serif;
    /* Font ထည့်သွင်းမှု */
    color: var(--text-primary) !important;
    line-height: 1.8;
    font-weight: 600;
}

/* ၃။ အင်္ဂလိပ်စာသားအတွက် */
.english-text {
    color: var(--text-primary) !important;
    font-weight: 600;
    letter-spacing: 0.02em;
    opacity: 1 !important;
}

/* ၄။ Lesson တစ်ခုကို နှိပ်ထားစဉ် (Active ဖြစ်ချိန်) မှာပဲ အဖြူရောင်ဖြစ်စေရန် */
.active-lesson .myanmar-text {
    color: #ffffff !important;
}

/* Light Mode မှာ English စာသားကို ပိုသိသာစေရန် */


/* English Mode သီးသန့်ဖြစ်နေချိန် (Card ထဲမှာ တစ်ကြောင်းတည်းရှိချိန်) */
.lesson-card .english-text {
    font-size: 1.1rem;
    /* စာလုံးအရွယ်အစားကို အနည်းငယ်မြှင့်ခြင်း */
    line-height: 1.4;
}

/* ၅။ Active Lesson State (နှိပ်လိုက်ချိန် အသံထွက်နေစဉ်) */
.active-lesson {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    transform: scale(1.03) translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

/* Active ဖြစ်ချိန် စာသားအားလုံး အဖြူရောင်ပြောင်းရန် */
.active-lesson .telugu-text,
.active-lesson .telugu-text-large,
.active-lesson .myanmar-text,
.active-lesson .english-text,
.active-lesson svg {
    color: #ffffff !important;
    opacity: 1 !important;
}

.dark .menu-card:hover,
.dark .lesson-card:hover:not(.active-lesson) {
    background: rgba(30, 41, 59, 0.9) !important;
}

/* ၇။ Lesson Grid & Layout Adjustments */
#lesson-grid .lesson-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.8rem;
    position: relative;
}

.telugu-container,
.translation-row {
    padding-right: 2.5rem;
    width: 100%;
}

.telugu-text {
    font-size: 1.8rem;
    word-break: break-word;
}

@media (max-width: 480px) {
    .telugu-text {
        font-size: 1.5rem;
    }
}

/* ၈။ Player UI & Buttons */
.player-bg {
    border: 2px solid var(--primary) !important;
    background: var(--glass-bg) !important;
    backdrop-filter: blur(20px) saturate(180%);
    border-radius: 9999px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.play-pause-btn {
    background-color: var(--primary);
    color: white;
    border-radius: 50%;
}

.speed-slider {
    accent-color: var(--primary);
}

/* ၉။ Settings & Theme Dots */
.theme-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 3px solid white;
    cursor: pointer;
    transition: transform 0.2s;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.theme-dot:hover {
    transform: scale(1.2);
}

/* ၁၀။ Utilities */
.hidden {
    display: none !important;
}

.active-icon {
    position: absolute;
    right: 1.25rem;
    top: 1.25rem;
    opacity: 0.3;
}

/* === ၁။ Player အပြင်ဘောင် (Container) === */
#bottom-nav-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
    background-color: rgba(255, 255, 255, 0.98) !important;
    /* ပိုလင်းအောင် ထားပါ */
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(10px);
    /* ဖုန်းအောက်ခြေ bar များနှင့် မငြိစေရန် Safe Area Padding ပေးခြင်း */
    padding-bottom: env(safe-area-inset-bottom, 24px);
    padding-top: 12px;
    padding-left: 16px;
    padding-right: 16px;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.08);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: center;
}

.dark #bottom-nav-container {
    background-color: rgba(15, 23, 42, 0.98) !important;
    border-top-color: rgba(255, 255, 255, 0.05);
}

/* === ၂။ Child Elements - Nav Controls နှင့် Mini Player ပုံစံညှိခြင်း === */
#nav-controls,
#mini-player {
    background: transparent !important;
    backdrop-filter: none !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: 800px;
    height: 60px !important;
    /* အမြင့်ကို အနည်းငယ်လျှော့၍ 60px ထားခြင်းက ဖုန်းတွင် ပိုကြည့်ကောင်းပါသည် */
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0.5rem !important;
    transition: all 0.3s ease;
}

/* === ၃။ Navigation Buttons - Glassmorphism ခလုတ်များ === */
nav button,
#bottom-nav-container button,
#nav-controls button {
    /* Base Styles (Shared) */
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);

    /* Light Mode Styles */
    background: #ffffff !important;
    /* လုံးဝ အဖြူရောင် */
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    color: var(--primary, #1d4ed8) !important;
}

.dark nav button,
.dark #bottom-nav-container button,
.dark #nav-controls button {
    background: rgba(30, 41, 59, 0.8) !important;
    /* Slate 800ish */
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: #f8fafc !important;
    /* Slate 50 */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

/* === ၄။ Play All Button သီးသန့် Styling === */
#nav-play-all {
    width: auto !important;
    min-width: 120px;
    padding: 0 20px !important;
    background: var(--primary, #2563eb) !important;
    color: white !important;
    font-weight: bold;
    white-space: nowrap;
}

/* Hover Effect (Light Mode) */
nav button:hover,
#bottom-nav-container button:hover,
#nav-controls button:hover {
    background: var(--primary, #1d4ed8) !important;
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Hover Effect (Dark Mode) */
.dark nav button:hover,
.dark #bottom-nav-container button:hover,
.dark #nav-controls button:hover {
    background: var(--primary, #3b82f6) !important;
    /* Dark mode တွင် ပိုလင်းသော အပြာရောင် */
    color: #ffffff !important;
}

/* === ၆။ UI Panels (Settings & Search) === */
#modal-content,
#search-panel {
    background: #ffffff !important;
    /* Light Mode တွင် အဖြူစစ်စစ် */
    backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #1e293b;
}

/* Dark Mode အတွက် သီးသန့် ပြန်ခွဲပါ */
.dark #modal-content,
.dark #search-panel {
    background: rgba(15, 23, 42, 0.95) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: #f8fafc;
}

/* Modal Close Button - Light Mode */
#modal-content button[onclick="toggleSettings()"] {
    background: #f1f5f9 !important;
    /* ခဲဖျော့ရောင် */
    color: #475569 !important;
}

/* Modal Close Button - Dark Mode */
.dark #modal-content button[onclick="toggleSettings()"] {
    background: #334155 !important;
    color: #f8fafc !important;
}

/* Light Mode: Modal ထဲက Row အကန့်များ */
#modal-content .p-5,
#modal-content .p-4 {
    background: #f8fafc !important;
    /* အဖြူရောင်ပေါ်တွင် သိသာသော ခဲဖျော့ရောင် */
    border: 1px solid #e2e8f0 !important;
}

/* Dark Mode: Modal ထဲက Row အကန့်များ */
.dark #modal-content .p-5,
.dark #modal-content .p-4 {
    background: rgba(30, 41, 59, 0.6) !important;
    /* Dark mode အရောင်ရင့် */
    border-color: rgba(255, 255, 255, 0.1) !important;
}

/* Language Selection Box - Light Mode */
#lang-select {
    background: #ffffff !important;
    color: #0f172a !important;
    /* အနက်ရောင် စာသား */
    border: 1px solid #cbd5e1 !important;
}

/* Language Selection Box - Dark Mode */
.dark #lang-select {
    background: #1e293b !important;
    color: #ffffff !important;
    border-color: #475569 !important;
}

#search-panel iframe {
    background: white;
    transition: background 0.3s ease;
}

.dark #search-panel iframe {
    background: #0f172a;
}

/* === ၇။ Lesson Grid & Layout Adjustments === */
#lesson-grid {
    padding-bottom: 140px !important;
    /* Player ဖုံးမသွားစေရန် အောက်ခြေနေရာလွတ် */
}

#lesson-grid .lesson-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.8rem;
    position: relative;
}

/* === ၈။ Utilities === */
#nav-controls.hidden,
#mini-player.hidden {
    display: none !important;
}

.loader-finished {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* အဖြူရောင်မှ Navy Blue အဖျော့လေးဆီသို့ radial ပြေးထားခြင်း */
    background: radial-gradient(circle at center, #ffffff 0%, #f0f4f8 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Mode: နက်မှောင်သော Midnight Blue Gradient */
.dark #loading-screen {
    /* အလယ်တွင် Navy Blue ရင့်ရင့်မှ ဘေးဘက်တွင် လုံးဝ အမည်းရောင်သို့ ပြောင်းလဲခြင်း */
    background: radial-gradient(circle at center, #0a192f 0%, #020617 100%);
}

.loader-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100px;
    height: 100px;
}

.loader-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 5px solid rgba(0, 0, 0, 0.05);
    border-top: 5px solid #000080;
    /* သင့်ရဲ့ Navy Blue */
    border-radius: 50%;
    animation: spin 0.8s cubic-bezier(0.5, 0.1, 0.5, 0.9) infinite;
}

.dark .loader-ring {
    border: 5px solid rgba(255, 255, 255, 0.1);
    border-top: 4px solid #3b82f6;
    /* Dark mode တွင် ပိုလင်းသော အပြာရောင် */
}

.loader-logo {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 15px;
    z-index: 10;
    /* Logo ကို ပေါ်လွင်စေရန် Shadow အနည်းငယ်ထည့်ခြင်း */
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.loading-text {
    margin-top: 28px;
    font-family: 'Padauk', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: #475569;
    /* Slate grey */
    text-transform: uppercase;
    animation: pulse 1.5s ease-in-out infinite;
}

.dark .loading-text {
    color: #94a3b8;
}

/* Title Animation - စာသားလေး အောက်ကနေ ပေါ်လာမည့်ပုံစံ */
@keyframes titleSlideUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-title {
    animation: titleSlideUp 0.5s ease-out forwards;
}

/* Card Zoom-Fade Animation */
@keyframes cardEntrance {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes titleSlideUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-header-item {
    animation: titleSlideUp 0.5s ease-out forwards;
}

.lesson-card-animate {
    opacity: 0;
    /* စစချင်း ဖျောက်ထားမည် */
    animation: cardEntrance 0.4s ease-out forwards;
}

/* တစ်ကတ်ချင်းစီကို အစီအစဉ်လိုက် ပေါ်လာစေရန် Delay ပေးခြင်း */
.delay-1 {
    animation-delay: 0.1s;
}

.delay-2 {
    animation-delay: 0.15s;
}

.delay-3 {
    animation-delay: 0.2s;
}

.delay-4 {
    animation-delay: 0.25s;
}

/* Menu Card များအတွက် Animation */
@keyframes menuEntrance {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.menu-card-animate {
    animation: menuEntrance 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    opacity: 0;
}

/* Register Button styling */
[data-lang="register_btn"] {
    background-color: #f1f5f9 !important;
    /* slate-100 */
    color: #475569 !important;
    /* slate-600 */
    border: 1px solid #e2e8f0 !important;
    /* slate-200 */
}

/* Dark Mode ဝင်သွားတဲ့အခါ ပြောင်းမယ့်အရောင် */
.dark [data-lang="register_btn"] {
    background-color: #1e293b !important;
    /* slate-800 */
    color: #cbd5e1 !important;
    /* slate-300 */
    border-color: #334155 !important;
    /* slate-700 */
}

/* Premium Card Styling */
.premium-lock-card {
    /* Light Mode: Background အရောင်နဲ့ တစ်သားတည်းဖြစ်အောင် Glass Effect */
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* Light Mode မှာ စာသားတွေကို ဖတ်ရလွယ်အောင် (Contrast ချိန်ညှိခြင်း) */
.premium-lock-card h2 {
    color: #1e1b4b;
    /* Indigo-950: အလွန်ရင့်သော ခရမ်းရောင် (Light Mode အတွက်) */
}

.premium-lock-card p {
    color: #334155;
    /* Slate-700: ဖတ်ရလွယ်သော ခဲရောင် (Light Mode အတွက်) */
}

/* Dark Mode: Theme ပြောင်းသွားရင် အလိုအလျောက် ပြောင်းမယ့် အရောင်များ */
.dark .premium-lock-card {
    background-color: rgba(15, 23, 42, 0.6);
    /* Slate-900/60 */
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: none;
}

.dark .premium-lock-card h2 {
    color: #ffffff;
    /* အဖြူရောင် (Dark Mode) */
}

.dark .premium-lock-card p {
    color: #cbd5e1;
    /* Slate-300 (Dark Mode) */
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.animate-slide-up {
    animation: slideUp 0.3s ease-out forwards;
}