/* Global Resets for Mobile Stability */

@import url('https://fonts.googleapis.com/css2?family=Khand:wght@300;400;500;600;700&family=Mukta:wght@200;300;400;500;600;700;800&family=Open+Sans:ital,wght@0,300..800;1,300..800&family=Roboto:ital,wght@0,100..900;1,100..900&family=Stack+Sans+Text:wght@200..700&display=swap');

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    background-color: gainsboro;
    color: #242424;
    /* transition: background-color 0.25s ease, color 0.25s ease; REMOVED FOR INSTANT SWITCH */
    font-family: 'Mukta', sans-serif;
    line-height: 1.6;
}

body.no-transition,
body.no-transition * {
    transition: none !important;
}

/* Protect Navbar from font change */
.branding-header,
.sticky-nav,
.sidebar {
    font-family: 'Khand', sans-serif !important;
}

body.dark {
    background-color: #1a202c;
    color: #f7fafc;
}

/* 
 * 1. LAYOUT CONTAINER
 */
.container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 15px;
}

/* 
 * 2. BRANDING SECTION (Logo & Title)
 */
.branding-header {
    text-align: center;
    padding: 10px 0px 8px;
}

.main-logo {
    height: 120px;
    max-width: 100%;
    object-fit: contain;
    display: none;
    margin: 0 auto 10px;
}

.site-title {
    color: #E47200;
    font-size: 54px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 5px;
}

.status-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    color: #718096;
    font-size: 18px;
    font-family: 'Mukta', sans-serif !important;
}

.datetime-box {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.datetime-separator {
    margin: 0 4px;
    color: #718096;
    font-weight: 500;
}

/* 
 * 3. STICKY NAVIGATION BAR
 */
.sticky-nav {
    position: sticky;
    top: 0;
    background-color: antiquewhite;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border-top: 1px solid #edf2f7;
    z-index: 1000;
}

body.dark .sticky-nav {
    background-color: #2d3748;
    border-color: #2d3748;
}

.nav-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
    width: 100%;
    gap: 15px;
    transition: all 0.3s ease-in-out;
}

/* Mobile Brand Component - Hidden by default */
.mobile-brand {
    display: none;
    text-align: center;
    flex: 1;
    line-height: 1.1;
}

.mobile-brand a {
    text-decoration: none;
    /*color: #E47200;*/
    /*font-size: 20px;*/
    /*font-weight: 800;*/
    display: block;
}

.mobile-nav-status {
    display: flex;
    justify-content: center;
    font-size: 14px;
    color: #718096;
    font-weight: 500;
    font-family: 'Mukta', sans-serif !important;
}

#mobile-current-time-icon {
    padding-right: 15px;
}

/* Scrolled Logo for Desktop */
.desktop-scrolled-logo {
    display: none;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.desktop-scrolled-logo img {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.desktop-scrolled-logo span {
    font-size: 22px;
    font-weight: 800;
    color: #E47200;
}

.sticky-nav.scrolled .desktop-scrolled-logo {
    display: none;
    animation: fadeInDown 0.3s forwards;
}

.brand-image-logo {
    height: 130px;
    width: auto;
    object-fit: contain;
}

.scrolled-brand-logo {
    height: 45px;
    width: auto;
    object-fit: contain;
}

.mobile-brand-logo {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.sidebar-brand-logo {
    height: 55px;
    width: auto;
    object-fit: contain;
}

@media (max-width: 991px) {
    .brand-image-logo {
        height: 65px;
    }

    .desktop-scrolled-logo {
        display: none !important;
    }
}


body.dark .mobile-nav-status {
    color: #a0aec0;
}

/* Desktop True Centering Logic (Flexbox) */
@media (min-width: 992px) {
    .nav-inner {
        gap: 25px;
        /* Balanced gap between sections */
    }

    .nav-inner>* {
        flex: 1;
        /* Allow left/right containers to push middle to center */
    }

    .nav-left {
        display: flex;
        align-items: center;
    }

    .menu-list {
        flex: 0 0 auto;
        /* Middle part maintains its natural width */
        display: flex;
        justify-content: center;
        white-space: nowrap;
        list-style: none;
        gap: 40px;
        padding: 0;
        margin: 0;
    }

    .nav-tools {
        display: flex;
        justify-content: flex-end;
        align-items: center;
        gap: 10px;
    }

    /* Hide Brand Name Image in Sticky Navbar on Desktop Scroll */
    .sticky-nav.scrolled .scrolled-brand-logo {
        display: none;
    }
}

/* Mobile specific overrides for nav tools */
@media (max-width: 991px) {
    .nav-tools {
        justify-content: center;
        width: auto;
    }
}

/* Mobile nav-left specific */
@media (max-width: 991px) {
    .nav-left {
        display: flex;
        align-items: center;
        min-width: 50px;
    }
}

/* 
 * 4. MENU ITEMS & HOVER EFFECTS
 */
.menu-list a,
.menu-list .nav-link {
    text-decoration: none;
    color: inherit;
    font-weight: 600;
    font-size: 20px;
    line-height: 1.4;
    transition: color 0.3s;
    position: relative;
    padding-bottom: 5px;
    cursor: pointer;
    display: inline-block;
}

.menu-list a::after,
.menu-list .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 3px;
    background-color: #E47200;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.menu-list a:hover::after,
.menu-list a.active::after,
.menu-list .dropdown:hover .nav-link::after {
    width: 100%;
}

.menu-list a:hover,
.menu-list a.active,
.menu-list .dropdown:hover .nav-link {
    color: #E47200;
}

/* 
 * 5. DROPDOWN MENUS (Desktop)
 */
.dropdown {
    position: relative;
    cursor: pointer;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    min-width: 220px;
    max-height: 400px;
    overflow-y: auto;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border: 1px solid #edf2f7;
    padding: 10px 0;
    z-index: 1000;
    background: antiquewhite;
}

body.dark .dropdown-menu {
    background: #2d3748;
    border-color: #4a5568;
}

.dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-menu a {
    display: block;
    padding: 10px 25px;
    border-bottom: 1px solid #2424;
    text-decoration: none;
    color: inherit;
    font-size: 20px;
    transition: background 0.3s, color 0.3s;
}

body.dark .dropdown-menu a {
    border-color: #4a5568;
}

.dropdown-menu a:hover {
    background: #f7fafc;
    color: #E47200;
}

body.dark .dropdown-menu a:hover {
    background: #4a5568;
}

/* Sub-dropdown (Desktop Accordion-style) */
.sub-menu {
    display: none;
    background: antiquewhite;
    padding: 5px 0;
    border-top: 1px solid #edf2f7;
}

body.dark .sub-menu {
    background: #313b4e;
}

.dropdown-item:hover>.sub-menu {
    display: block;
}

.sub-menu a {
    padding: 8px 35px;
    font-size: 20px;
    border: none !important;
}

/* 
 * 6. NAVIGATION TOOLS (Search, Theme, Unicode)
 */
.search-pill {
    display: none;
    align-items: center;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 4px 12px;
}

@media (min-width: 576px) {
    .search-pill {
        display: flex;
    }
}

body.dark .search-pill {
    background: #4a5568;
    border-color: #718096;
}

.search-pill input {
    border: none;
    outline: none;
    padding: 2px 8px;
    font-size: 16px;
    background: transparent;
    color: inherit;
    width: 120px;
}

.unicode-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #E47200;
    color: white !important;
    padding: 4px 8px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 18px;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(230, 126, 34, 0.2);
}

.unicode-btn:hover {
    transform: translateY(-2px);
    background: #d35400;
    box-shadow: 0 6px 15px rgba(230, 126, 34, 0.3);
}

/* Theme Toggle Circular Button */
.theme-toggle {
    width: 38px;
    height: 38px;
    background: #edf2f7;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid #e2e8f0;
    color: #4a5568;
}

.theme-toggle:hover {
    background: #e2e8f0;
    transform: rotate(15deg) scale(1.05);
}

body.dark .theme-toggle {
    background: #4a5568;
    border-color: #4a5568;
    color: #f6e05e;
    /* Sun yellow for contrast in dark mode */
}

body.dark .theme-toggle:hover {
    background: #2d3748;
}

#theme-ico {
    font-size: 16px;
    transition: transform 0.3s ease;
}

/* 
 * 7. MOBILE SIDEBAR & OVERLAY
 */
.burger-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: inherit;
    cursor: pointer;
}

@media (min-width: 992px) {

    .burger-btn,
    .nav-left-placeholder {
        display: none;
    }
}

/* Default Sidebar State (Mobile First Thinking) */
.sidebar {
    position: fixed;
    top: 0;
    left: -350px;
    width: 300px;
    height: 100vh;
    background: white;
    z-index: 2000;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.3s;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    /* Smooth mobile scroll */
    overscroll-behavior: contain;
    /* Prevent body scroll when sidebar ends */
    display: block;
    visibility: hidden;
}

@media (min-width: 992px) {
    .sidebar {
        display: none !important;
        /* Strictly hidden on desktop */
    }
}

body.dark .sidebar {
    background: #1a202c;
    color: white;
}

.sidebar.open {
    left: 0;
    visibility: visible;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid #edf2f7;
}

.sidebar-logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo {
    height: 40px;
    width: auto;
    object-fit: contain;
}

body.dark .sidebar-header {
    border-color: #2d3748;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    padding-bottom: 80px;
    /* Extra space for mobile browser bars */
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid #f7fafc;
}

body.dark .sidebar-nav a {
    border-color: #2d3748;
}

.sidebar-nav i {
    width: 24px;
    text-align: center;
    color: #E47200;
    font-size: 18px;
}

.overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

@media (max-width: 991px) {
    .overlay.active {
        display: block;
    }
}

/* Sidebar Custom Accordion Replacement */
.sidebar-item.has-sub .sidebar-row-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f7fafc;
}

body.dark .sidebar-item.has-sub .sidebar-row-wrapper {
    border-color: #2d3748;
}

.sidebar-item.has-sub .cat-link-main {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    text-decoration: none;
    color: inherit;
    border-bottom: none !important;
}

.sub-toggle-btn {
    background: none;
    border: none;
    padding: 10px 15px;
    cursor: pointer;
    color: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.sidebar-item .sidebar-sub-menu {
    display: none;
    padding-left: 36px;
    background: #f7fafc;
}

body.dark .sidebar-item .sidebar-sub-menu {
    background: #2d3748;
}

.sidebar-item.explicit-open .sidebar-sub-menu {
    display: flex;
    flex-direction: column;
}

.sidebar-item.explicit-open .sub-toggle-btn {
    transform: rotate(180deg);
}

.sidebar-sub-menu a {
    padding: 10px 0;
    font-size: 18px;
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Ensure desktop icons in dropdown don't block clicks if they were overlapping */
.dropdown-item a {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dropdown-item .toggle-icon {
    pointer-events: none;
    /* Let clicks pass to the parent link */
}

.summary-icon {
    transition: transform 0.3s;
    font-size: 14px;
}

/* 
 * 8. UTILITY CLASSES (Replacing Inline Styles)
 */
.fs-60 {
    font-size: 60px;
}

.fs-24 {
    font-size: 24px;
}

.fs-18 {
    font-size: 18px;
}

.fs-16 {
    font-size: 16px;
}

.fs-14 {
    font-size: 14px;
}

.fs-10 {
    font-size: 10px;
}

.fw-bold {
    font-weight: bold;
}

.c-brand {
    color: #E47200;
}

.c-sun {
    color: #F6AD55;
}

.c-gray {
    color: #718096;
}

.c-sidebar-text {
    color: #4A5568;
}

.c-mute {
    color: #A0AEC0;
}

.cursor-pointer {
    cursor: pointer;
}

.pointer-none {
    pointer-events: none;
}

.hidden {
    display: none;
}

.ml-10 {
    margin-left: 10px;
}

.sidebar-unicode-pill {
    color: #E47200;
    font-weight: bold;
    border-bottom: 2px solid #E47200;
    padding-bottom: 15px;
    margin-bottom: 5px;
}

.sidebar-brand-text {
    font-size: 24px;
    font-weight: bold;
    color: #E47200;
}

/* 
 * 9. RESPONSIVE BREAKPOINTS
 */
@media (max-width: 991px) {
    .menu-list {
        display: none;
    }

    .nav-tools .unicode-btn {
        display: none;
    }

    /* Compact Header Section for Mobile */
    .branding-header {
        padding: 15px 10px 10px;
    }

    .main-logo {
        height: 60px;
        /* Half size */
        margin-bottom: 5px;
    }

    .site-title {
        font-size: 28px;
        /* Significantly smaller */
        letter-spacing: 1px;
    }

    .status-row {
        font-size: 14px;
        gap: 2px;
    }

    /* Sticky Mobile Layout Alignment */
    .nav-inner {
        height: 70px;
        /* Slightly more compact sticky bar */
    }

    /* Show brand in sticky bar on scroll */
    .sticky-nav.scrolled .mobile-brand {
        display: block;
        animation: fadeInDown 0.3s forwards;
    }

    .sticky-nav.scrolled .nav-left,
    .sticky-nav.scrolled .nav-tools {
        flex: 0 0 50px;
    }

    .nav-tools {
        gap: 10px;
    }

    .search-pill {
        display: none;
        /* Hide search in sticky bar to make room for brand */
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 1250px) {

    /* Tighten spacing on medium screens */
    .unicode-btn span {
        display: none;
    }

    .unicode-btn {
        padding: 8px 12px;
    }

    .nav-inner {
        gap: 15px !important;
    }

    .menu-list {
        gap: 18px !important;
    }

    .menu-list a,
    .menu-list .nav-link {
        font-size: 20px !important;
    }
}