* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Pyidaungsu', serif; /* မြန်မာစာအတွက် သင့်တော်သော Font */
}

body {
    background-color: #f4f4f4;
    height: 100vh;
    overflow: hidden;
}

.main-container {
    display: flex;
    height: 100vh;
    gap: 5px;
    padding: 5px;
}

/* Section Common Styles */
.pali-section, .commentary-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}
/* ပါဠိတော် Section ကို ဘောင်ခတ်ထားခြင်း */
.pali-section {
    position: relative; /* ၎င်းအတွင်းမှာရှိတဲ့ absolute element တွေအတွက် မူသေဖြစ်စေရန် */
    overflow: hidden;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.header {
    padding: 10px;
    color: white;
    font-weight: bold;
    text-align: center;
}

.content, .tab-content {
    padding: 20px;
    overflow-y: auto;
    line-height: 1.8;
    font-size: 18px;
    text-align: justify;
}

/* Headers Colors */
.pali-header { background-color: #7d4b4b; }
.atthakatha-header { background-color: #4b7d4b; }
.tika-header { background-color: #4b4b7d; }
.nissaya-header { background-color: #7d7d4b; }

/* Tabs Logic */
.tabs-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.tab-header {
    display: flex;
    background: #e0e0e0;
    border-bottom: 1px solid #ccc;
}

.tab-link {
    flex: 1;
    padding: 10px;
    border: none;
    cursor: pointer;
    background: #eee;
    transition: 0.3s;
    font-weight: bold;
}

.tab-link:hover { background: #ddd; }

.tab-link.active {
    background: white;
    border-bottom: 3px solid #4b4b7d;
}

.tab-content {
    display: none;
    height: 100%;
}

.tab-content.active {
    display: block;
}

/* Navbar Styling */
.navbar {
    position: fixed; /* NavBar ကို အသေထားခြင်း */
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background-color: #2c3e50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 1000; /* အခြား element များထက် အပေါ်မှာရှိနေစေရန် */
    color: white;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 20px;
}

.nav-links a {
    color: white;
    text-decoration: none;
    font-size: 14px;
}

/* Main Container ကို NavBar အောက်ရောက်သွားအောင် ညှိခြင်း */
.main-container {
    display: flex;
    height: calc(100vh - 60px); /* စုစုပေါင်းအမြင့်ထဲက Navbar အမြင့်ကို နုတ်ပါ */
    margin-top: 60px; /* Navbar အောက်က စစေရန် */
    gap: 5px;
    padding: 5px;
}
/* Navbar Left Section (Logo + Search) */
.nav-left {
    display: flex;
    align-items: center;
    gap: 20px; /* Logo နဲ့ Search ကြား အကွာအဝေး */
}

/* Search Box Styling */
.search-container {
    display: flex;
    background: white;
    border-radius: 4px;
    overflow: hidden;
    padding: 2px;
}

.search-container input {
    border: none;
    padding: 8px 12px;
    outline: none;
    width: 250px; /* စိတ်ကြိုက် အကျယ်ထားနိုင်သည် */
    font-size: 14px;
}

.search-btn {
    background: #34495e;
    color: white;
    border: none;
    padding: 0 15px;
    cursor: pointer;
    transition: 0.3s;
}

.search-btn:hover {
    background: #1abc9c;
}

/* Responsive (Screen သေးသွားရင် Search Box ကို ချုံ့ရန်) */
@media (max-width: 768px) {
    .search-container input {
        width: 150px;
    }
}

/* Sidebar Style */
.sidebar {
    height: 100%;
    width: 0; /* အစမှာ ဖျောက်ထားမည် */
    position: fixed;
    z-index: 2000;
    top: 0;
    left: 0;
    background-color: #fff;
    overflow-x: hidden;
    transition: 0.4s;
    box-shadow: 2px 0 10px rgba(0,0,0,0.3);
}

.sidebar-header {
    background-color: #f8f9fa;
    padding: 15px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #ddd;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
}

/* Accordion Style */
.book-list { padding: 10px; }

.accordion { margin-bottom: 10px; }

.accordion-btn {
    background-color: #7d3c3c; /* ပုံထဲကအရောင် */
    color: white;
    cursor: pointer;
    padding: 12px 15px;
    width: 100%;
    border: none;
    text-align: left;
    outline: none;
    font-size: 15px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.accordion-btn:hover { background-color: #632e2e; }

.accordion-panel {
    padding: 0 18px;
    background-color: white;
    display: none; /* အစမှာ ဖျောက်ထားမည် */
    overflow: hidden;
}

.accordion-panel a {
    display: block;
    padding: 10px;
    text-decoration: none;
    color: #333;
    border-bottom: 1px solid #eee;
}

/* Overlay Style */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1500;
}

.menu-icon {
    font-size: 24px;
    cursor: pointer;
    margin-right: 15px;
}

/* Header ညှိခြင်း */
.pali-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
}

.toc-icon {
    cursor: pointer;
    font-size: 20px;
}

/* TOC Sidebar ကို Section ရဲ့ ညာဘက်မှာပဲ ကပ်ရန် */
.toc-sidebar {
    height: 100%;
    width: 0; /* အစမှာ ဖျောက်ထားမည် */
    position: absolute; /* Fixed အစား Absolute ပြောင်းပါ */
    z-index: 10;
    top: 0;
    right: 0; 
    background-color: #fff;
    border-left: 1px solid #ddd;
    transition: 0.3s ease;
    overflow-x: hidden;
    box-shadow: -2px 0 5px rgba(0,0,0,0.1);
}

.toc-header {
    padding: 15px;
    font-size: 18px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid #eee;
}

.toc-search {
    padding: 10px;
}

.toc-search input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.toc-list {
    list-style: none;
    padding: 0;
}

.toc-list li a {
    display: block;
    padding: 12px 15px;
    text-decoration: none;
    color: #333;
    border-bottom: 1px solid #f9f9f9;
}

.toc-list li a:hover {
    background-color: #f5f5f5;
}

/* Overlay ကို Sidebar နှစ်ခုလုံးအတွက် သုံးနိုင်သည် */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    z-index: 1500;
}
/* Sidebar ပွင့်သွားတဲ့အခါ အကျယ် (JS နဲ့ ချိတ်ဆက်ရန်) */
.toc-sidebar.open {
    width: 280px; /* စိတ်ကြိုက်အကျယ် ထားနိုင်သည် */
}

.dict-container {
    padding: 15px;
    background-color: #fdfdfd;
}

.dict-search {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.dict-search input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 20px; /* Round shape */
}

.dict-result {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.word-title {
    color: #7d3c3c;
    border-bottom: 2px solid #7d3c3c;
    display: inline-block;
    margin-bottom: 5px;
}

.word-type {
    color: #666;
    font-style: italic;
    margin-bottom: 15px;
}

.definition p {
    margin-bottom: 10px;
    color: #333;
    line-height: 1.7;
}

/* Dictionary Wrapper */
.dict-wrapper {
    padding: 20px;
    max-width: 800px;
    margin: 0 auto;
}

/* Search Box */
.dict-search-box {
    display: flex;
    margin-bottom: 25px;
    gap: 10px;
}

.dict-search-box input {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid #ddd;
    border-radius: 25px;
    font-size: 16px;
    outline: none;
}

.dict-search-box input:focus { border-color: #7d3c3c; }

.dict-search-box button {
    padding: 0 25px;
    background: #7d3c3c;
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
}

/* Word Title */
.main-word {
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

/* Dictionary Cards */
.dict-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

/* Badges (Labels) */
.badge {
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: bold;
    display: inline-block;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.tipitaka-bg { background: #e3f2fd; color: #1976d2; }
.hoke-sein-bg { background: #f1f8e9; color: #388e3c; }

.dict-body {
    line-height: 1.8;
    font-size: 16px;
    color: #444;
}

/* Sub-tab Container */
.nested-tabs-container {
    padding: 10px;
    background: #fdfdfd;
}

/* Sub-tab Header */
.sub-tab-header {
    display: flex;
    gap: 5px;
    border-bottom: 2px solid #ddd;
    margin-bottom: 15px;
}

/* Sub-tab Buttons */
.sub-tab-link {
    padding: 8px 15px;
    border: none;
    background: #eee;
    cursor: pointer;
    font-size: 14px;
    border-radius: 5px 5px 0 0;
    transition: 0.3s;
}

.sub-tab-link:hover {
    background: #e0e0e0;
}

.sub-tab-link.active {
    background: #7d7d4b; /* Nissaya color */
    color: white;
}

/* Sub-tab Content */
.sub-tab-content {
    display: none;
    padding: 15px;
    background: white;
    border: 1px solid #eee;
    min-height: 200px;
    line-height: 1.8;
}

.sub-tab-content.active {
    display: block;
}