/* ၁။ Layout အခြေခံ (Sepia Theme) */
body.sepia-mode {
    background-color: #f4ecd8;
    color: #1a1a1a;
    margin: 0;
    font-family: 'Pyidaungsu', sans-serif;
}

.container {
    max-width: 700px;
    margin: 0 auto;
    padding-bottom: 80px;
    padding-top: 70px; /* Top Bar နဲ့ မငြိစေရန် အပေါ်မှ နေရာချန်ထားခြင်း */
}

/* ၂။ Top Bar & Setting Controls (စာလုံးဆိုဒ်ကြီးလျှင် မရွေ့အောင် ပြင်ဆင်ထားသည်) */
.top-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px; /* ဘေး padding ကိုပဲ ထားသည် */
    background: #eadebc;
    position: fixed; /* စာဖတ်လျှင် အပေါ်မှာ အမြဲကပ်နေစေရန် sticky မှ fixed သို့ ပြောင်းသည် */
    top: 0;
    left: 0;
    width: 100%;
    height: 60px; /* အမြင့်ကို ပုံသေ သတ်မှတ်လိုက်သည် */
    z-index: 1000;
    border-bottom: 1px solid #d4c5a0;
    box-sizing: border-box;
}

.back-link {
    color: #443300;
    text-decoration: none;
    font-weight: bold;
}

.right-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.font-controls button, .setting-btn {
    background: #f4ecd8;
    color: #1a1a1a;
    border: 1px solid #443300;
    padding: 6px 12px;
    cursor: pointer;
    border-radius: 4px;
    font-weight: bold;
}

/* ၃။ Setting Menu Popup */
.setting-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    display: none;
    z-index: 1100;
}

.setting-content {
    background: #f4ecd8;
    width: 250px;
    position: absolute;
    top: 65px; right: 20px;
    padding: 20px;
    border-radius: 12px;
    border: 2px solid #443300;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.setting-item {
    display: block;
    width: 100%;
    padding: 12px;
    margin: 8px 0;
    background: #eadebc;
    border: 1px solid #443300;
    border-radius: 6px;
    color: #443300;
    font-weight: bold;
    cursor: pointer;
    text-align: center;
}


/* ၄။ Floating Buttons (Left Side) */
.floating-left-group {
    position: fixed;
    bottom: 25px;
    left: 20px;
    display: flex;
    flex-direction: column;
    align-items: center; 
    gap: 12px; 
    z-index: 999;
}

.toc-toggle-btn {
    background: #443300;
    color: #f4ecd8;
    border: none;
    padding: 12px 20px;
    border-radius: 25px; 
    cursor: pointer;
    font-weight: bold;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    text-align: center;
}

.top-btn {
    background: #443300;
    color: #f4ecd8;
    width: 35px;  
    height: 35px; 
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%; 
    text-decoration: none;
    font-weight: bold;
    font-size: 16px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    opacity: 0.8; 
    transition: 0.3s;
}

.top-btn:hover {
    opacity: 1;
    transform: scale(1.1); 
}



/* ၅။ မာတိကာ Popup Overlay */
.toc-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    display: none;
    z-index: 1050;
}

.toc-content {
    background: #f4ecd8;
    width: 85%; max-width: 400px;
    margin: 80px auto;
    padding: 25px;
    border-radius: 12px;
    border: 2px solid #443300;
    position: relative;
}

.toc-list { list-style: none; padding: 0; }

.toc-list li a {
    color: #1a1a1a;
    text-decoration: none;
    display: block;
    padding: 10px 0;
    border-bottom: 1px solid #d4c5a0;
}

.close-btn {
    position: absolute;
    right: 15px; top: 10px;
    font-size: 30px;
    color: #443300;
    cursor: pointer;
}

/* ၆။ စာဖတ်ခန်း Style */
.content-area { padding: 20px; line-height: 1.8; font-size: 19px; }
.book-header { text-align: center; padding: 40px 20px; }
.book-header h1 { color: #443300; }
.book-header h2 { color: #443300; }

.content-area {
    white-space: pre-line; 
}


@media print {
    .top-controls, 
    .floating-left-group, 
    .setting-overlay, 
    .toc-overlay,
    #modeToggle {
        display: none !important;
    }

    .container {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    body {
        background: white !important; 
        color: black !important;
    }
}

/* Fullscreen ခလုတ် Style */
.fullscreen-round-btn {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: 1px solid #443300;
    background: rgba(234, 222, 188, 0.4);
    color: #443300;
    cursor: pointer;
    position: fixed; /* နေရာ ပုံသေဖြစ်အောင် fixed သုံးပါ */
    top: 80px;
    left: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000; /* အားလုံးရဲ့ အပေါ်မှာ ရှိနေစေရန် */
    transition: 0.3s;
}

/* Focus Mode အသက်ဝင်ချိန် (Fullscreen ခလုတ်ကလွဲပြီး အကုန်ဖျောက်ရန်) */
body.focus-mode .top-controls .back-link,
body.focus-mode .top-controls .right-controls,
body.focus-mode .floating-left-group,
body.focus-mode .book-header {
    display: none !important;
}

/* Focus Mode မှာ အပေါ် Bar နောက်ခံကို ဖျောက်ခြင်း */
body.focus-mode .top-controls {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

/* မာတိကာတွင် လက်ရှိဖတ်နေသည့် အခန်းကို Highlight ပြရန် */
.toc-list li a.active-chapter {
    color: #b38b00 !important; /* ရွှေရောင် သို့မဟုတ် ခပ်တောက်တောက်အရောင် */
    font-weight: bold !important;
    border-left: 3px solid #443300;
    padding-left: 10px;
}

