/* =======================================
   ROOT VARIABLES – LIGHT THEME DEFAULT
======================================= */
:root {
    --primary-color: #dc3545;
    --theme-red: #b10000;
    --accent-blue: #007bff;
    --accent-green: #198754;
    --accent-cyan: #0dcaf0;
    --dark-text: #212529;
    --light-bg: #f8f9fa;
    --shadow-sm: 0 2px 6px rgba(0,0,0,0.08);

    /* THEME COLORS */
    --bg-color: #ffffff;
    --text-color: #212529;
    --header-bg: #ffffff;
    --nav-link: #212529;
    --nav-hover: #b10000;
    --card-bg: #ffffff;
    --section-bg: #f9f9f9;
    --border-color: #e5e5e5;
    --shadow: 0 2px 6px rgba(0,0,0,0.08);

    --card: var(--card-bg);
    --text: var(--text-color);
    --text-light: var(--nav-link);
}

/* ===== DARK MODE ===== */
body.dark-mode {
    --bg-color: #121212;
    --text-color: #eaeaea;
    --header-bg: #1e1e1e;
    --nav-link: #eaeaea;
    --nav-hover: #dc3545;
    --card-bg: #1c1c1c;
    --section-bg: #181818;
    --border-color: #333;
    --shadow: 0 2px 8px rgba(255,255,255,0.05);
}

/* =======================================
   BASE STYLES
======================================= */
body {
    background: var(--bg-color);
    color: var(--text-color);
    font-family: 'Inter', sans-serif;
    transition: background 0.4s ease, color 0.4s ease;
}

a {
    color: var(--nav-link);
    transition: color 0.3s ease;
}
a:hover {
    color: var(--nav-hover);
}

/* =======================================
   GLOBAL MAX-WIDTH FIX
======================================= */
@media (min-width: 1400px) {
    .container {
        max-width: 1370px;
    }
}

/* ===========================================
   MAIN HEADER (Common Styles)
=========================================== */
.main-header {
    position: fixed;
    top: 0;
    width: 100%;
    background: var(--header-bg);
    box-shadow: var(--shadow);
    z-index: 1000;
    height: 84px;
    display: flex;
    align-items: center;
    transition: .4s ease;
}

/* News Style Header (Specific) */
.main-header.news-style-header {
    background: #002b6b; /* Override header-bg with dark blue */
    color: #fff;
    padding: 6px 0;
    position: sticky; /* Sticky is usually better than fixed for news headers */
    top: 0;
    z-index: 999;
    height: auto; /* Allow padding to define height */
    box-shadow: none; /* Remove shadow if news style is cleaner */
    border-bottom: 2px solid rgba(255,255,255,0.2);
}

.news-style-header .container {
    max-width: 1400px;
}

/* LOGO AREA */
.logo-area {
    display: flex;
    align-items: center;
    gap: 10px;
}

.site-logo, .logo-area img {
    height: 48px; /* Use consistent height for both */
}

/* BRAND TEXT */
.brand-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-color); /* Overridden by inline style in HTML for news-style */
}

.brand-tagline {
    font-size: 14px;
    font-weight: 500;
}

/* --------------------------------------------------
   DESKTOP NAVIGATION (News Style)
-------------------------------------------------- */
.nav-list li {
    list-style: none;
    margin: 0 15px;
    position: relative;
}

.nav-list li a {
    color: #fff !important; /* Force white for news style */
    font-size: 17px;
    font-weight: 500;
    text-decoration: none;
    transition: .2s;
}

.nav-list li a:hover,
.nav-list li a.active {
    color: #FFD700 !important;
}

.nav-list li a:hover::after,
.nav-list li a.active::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -3px;
    width: 100%;
    height: 3px;
    background: #ff4d00;
}

/* DROPDOWN */
.dropdown-menu {
    max-height: 300px;
    overflow-y: auto;
}

.dropdown-item:hover {
    background: #002b6b;
    color: #fff;
}

/* STICKY HEADER */
.main-header.sticky {
    padding: 6px 0;
}

/* THEME TOGGLE / NAV TOGGLE */
.theme-toggle,
.nav-toggle {
    font-size: 22px;
    cursor: pointer;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 0 !important;
}

.theme-toggle i,
.nav-toggle i {
    color: #fff !important; /* Icons must be white in news header */
    font-size: 22px !important;
}

body.dark-mode .theme-toggle i {
    color: #f1f1f1 !important;
}


/* --------------------------------------------------
   MOBILE NAV PANEL (SLIDE MENU)
-------------------------------------------------- */
@media(max-width: 991px) {
    .main-nav {
        position: fixed;
        top: 60px; /* Reduced to fit typical mobile view after reducing header height */
        left: -260px;
        width: 260px;
        height: calc(100vh - 60px);
        background: #002b6b;
        border-right: 2px solid rgba(255,255,255,0.15);
        padding: 20px;
        transition: 0.35s ease;
        z-index: 9999;
    }
}
.main-nav.active {
    left: 0;
    box-shadow: 0 0 15px rgba(0,0,0,0.5);
}

.nav-list {
    flex-direction: column;
    gap: 12px;
    padding: 0;
    margin: 0;
}

.nav-list li a {
    color: #fff !important;
    font-size: 16px;
    font-weight: 600;
    padding: 8px 5px;
    display: block;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    transition: 0.2s;
}

.nav-list li a:hover {
    color: #FFD700 !important;
    border-bottom-color: #FF4D00;
    transform: translateX(5px);
}

/* OVERLAY */
.nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    opacity: 0;
    visibility: hidden;
    transition: .25s;
    z-index: 9998;
}

.nav-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* --------------------------------------------------
   MOBILE HEADER LAYOUT FIX (Main Fix)
-------------------------------------------------- */
@media (max-width: 992px) {
    /* 1. Menu Toggle (Left) */
    .nav-toggle {
        order: 1; /* बाईं ओर */
        margin-right: 15px;
        display: block; /* Ensure it's visible */
    }

    /* 3. Right Side Buttons (Theme Toggle & Notification) */
    .d-flex.align-items-center.gap-3 {
        order: 3; /* दाईं ओर */
        margin-left: 15px;
    }
    
    /* 2. Logo Area (Center) */
    .logo-area {
        order: 2; /* मध्य में */
        flex-grow: 1; /* उपलब्ध स्पेस में फैलने दें */
        justify-content: center !important; /* लोगो को सेंटर करें */
        text-align: center;
        margin: 0 5px; /* किनारों से थोड़ी स्पेसिंग */
    }

    /* Ensure desktop nav is hidden on mobile */
    .main-nav:not(.active) {
        display: none;
    }

    /* Adjust logo area on super small screens */
    .logo-text {
        display: flex;
        flex-direction: column;
        text-align: center;
    }
}

/* --------------------------------------------------
   SUPER MOBILE LAYOUT FIX (<= 576px)
-------------------------------------------------- */
@media (max-width: 576px) {
    /* Hide logo image */
    .logo-area img {
        display: none !important;
        opacity: 0 !important;
        height: 0 !important;
        width: 0 !important;
        visibility: hidden !important;
    }

    /* Brand title + tagline visible */
    .brand-title,
    .brand-tagline {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
        text-align: center;
    }

    /* Mobile size adjustments */
    .brand-title { font-size: 20px; }
    .brand-tagline { font-size: 11px; }

    /* Avoid overflow */
    .logo-area {
        gap: 0 !important;
        padding: 0 !important;
    }
}

/* --------------------------------------------------
   DESKTOP RESTORE (Reset mobile behavior)
-------------------------------------------------- */
@media(min-width: 992px) {
    .main-nav {
        position: static;
        height: auto;
        width: auto;
        background: transparent;
        border: none;
        box-shadow: none;
        left: 0;
        padding: 0;
        display: block !important; /* Ensure desktop nav is visible */
    }

    .nav-list {
        flex-direction: row;
    }

    .nav-list li a {
        border: none;
        transform: none !important;
        font-size: 17px;
    }
    
    .nav-toggle {
        display: none !important; /* Hide mobile toggle on desktop */
    }
}