/* ============================================
   NOTIFICATION SECTION (MARQUEE BOX)
   Base styles - matches home page on all pages
   ============================================ */

.marquee-box {
    background: #ffffff;
    color: #333;
    display: flex;
    width: 100%;
    align-items: stretch;
}

.marquee-title {
    background: #c62828;
    padding: 8px 20px;
    font-weight: bold;
    font-size: 14px;
    z-index: 2;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.marquee-content {
    padding: 8px 12px;
    flex-grow: 1;
    color: #1a237e;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.marquee-content marquee {
    width: 100%;
    line-height: 1.4;
}

/* ============================================
   MOBILE NOTIFICATION & MENU SECTION
   Optimized for Mobile View
   ============================================ */

@media (max-width: 767px) {
    
    /* ============================================
       1. NOTIFICATION SECTION (MARQUEE BOX)
       ============================================ */
    
    .marquee-box {
        display: flex !important;
        flex-direction: row !important;
        width: 100% !important;
        background: #ffffff !important; /* White background */
        min-height: 42px !important; /* Compact height */
        overflow: hidden !important;
        margin: 0 !important;
        align-items: stretch !important;
    }
    
    .marquee-title {
        background: #c62828 !important; /* Red background */
        color: #ffffff !important;
        padding: 8px 12px !important; /* Proper padding */
        font-weight: bold !important;
        font-size: 11px !important; /* Readable font size */
        writing-mode: horizontal-tb !important; /* Horizontal text (left to right) */
        text-orientation: mixed !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        min-width: auto !important; /* Auto width */
        width: auto !important;
        flex-shrink: 0 !important;
        white-space: nowrap !important;
        letter-spacing: 0.8px !important; /* Better readability */
        text-transform: uppercase !important;
        z-index: 2 !important;
        line-height: 1.3 !important;
        font-family: 'Segoe UI', Arial, sans-serif !important;
        border-right: 2px solid rgba(255, 255, 255, 0.2) !important; /* Separator */
    }
    
    .marquee-content {
        flex: 1 !important;
        padding: 8px 12px !important; /* Proper padding */
        color: #1a237e !important; /* Dark blue color */
        font-weight: 600 !important;
        font-size: 12px !important; /* Readable size */
        display: flex !important;
        align-items: center !important;
        overflow: hidden !important;
        min-height: 42px !important; /* Match box height */
        background: #ffffff !important;
        justify-content: flex-start !important;
    }
    
    .marquee-content marquee {
        width: 100% !important;
        line-height: 1.4 !important;
        display: block !important;
    }
    
    /* ============================================
       2. NAVBAR / MENU SECTION
       ============================================ */
    
    .navbar {
        background: #c62828 !important; /* Red background */
        width: 100% !important;
        position: sticky !important;
        top: 0 !important;
        z-index: 1000 !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
        margin: 0 !important; /* All margins zero */
        margin-top: 0 !important;
        margin-bottom: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    
    /* Remove any top margin from elements before navbar */
    .marquee-box + .navbar,
    .main-header + .navbar,
    * + .navbar {
        margin-top: 0 !important;
    }
    
    /* Ensure no gap between notification and menu */
    .marquee-box {
        margin-bottom: 0 !important;
    }
    
    .navbar .container {
        position: relative !important;
        padding: 8px 15px !important; /* Equal padding on all sides for centering */
        min-height: 50px !important; /* Reduced height to minimize red space */
        display: flex !important;
        align-items: center !important;
        justify-content: center !important; /* Center the button */
    }
    
    /* Hamburger Menu Button - Centered & Highlighted */
    .mobile-menu-toggle {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        background: #ffffff !important;
        color: #c62828 !important;
        border: 2px solid #c62828 !important;
        padding: 8px 14px !important; /* Proper padding */
        font-size: 18px !important;
        cursor: pointer !important;
        position: relative !important; /* Changed from absolute to relative for centering */
        left: auto !important;
        right: auto !important;
        top: auto !important;
        transform: none !important; /* Remove transform for centering */
        z-index: 1001 !important;
        border-radius: 6px !important;
        transition: all 0.3s ease !important;
        box-shadow: 0 3px 8px rgba(198, 40, 40, 0.4), 0 0 0 3px rgba(198, 40, 40, 0.1) !important;
        min-width: auto !important;
        max-width: calc(100% - 30px) !important; /* Prevent overflow */
        min-height: 40px !important;
        gap: 8px !important;
        flex-direction: row !important;
        margin: 0 auto !important; /* Center the button */
    }
    
    /* "Open Menu" text next to button */
    .mobile-menu-toggle::after {
        content: 'Open Menu' !important;
        font-size: 12px !important; /* Reduced from 13px */
        font-weight: 600 !important;
        color: #c62828 !important;
        white-space: nowrap !important;
        display: inline-block !important;
    }
    
    .mobile-menu-toggle.active::after {
        content: 'Close Menu' !important;
        color: #ffffff !important;
    }
    
    .mobile-menu-toggle:hover {
        background: #c62828 !important;
        color: #ffffff !important;
        border-color: #b71c1c !important;
        transform: scale(1.05) !important; /* Scale without translateY */
        box-shadow: 0 4px 12px rgba(198, 40, 40, 0.6), 0 0 0 4px rgba(198, 40, 40, 0.2) !important;
    }
    
    .mobile-menu-toggle:hover::after {
        color: #ffffff !important;
    }
    
    .mobile-menu-toggle:active {
        transform: scale(0.95) !important; /* Scale without translateY */
    }
    
    .mobile-menu-toggle.active {
        background: #c62828 !important;
        color: #ffffff !important;
        border-color: #b71c1c !important;
        box-shadow: 0 4px 12px rgba(198, 40, 40, 0.7), 0 0 0 4px rgba(198, 40, 40, 0.25) !important;
    }
    
    .mobile-menu-toggle i {
        transition: transform 0.3s ease !important;
    }
    
    .mobile-menu-toggle.active i.fa-bars {
        transform: rotate(90deg) !important;
    }
    
    /* Navigation Menu - Mobile Slide-in */
    .nav-menu {
        display: none !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        max-width: 320px !important;
        height: 100vh !important;
        background: linear-gradient(180deg, #c62828 0%, #b71c1c 100%) !important;
        flex-direction: column !important;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3) !important;
        z-index: 9999 !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        transform: translateX(-100%) !important;
        transition: transform 0.3s ease-in-out !important;
        padding: 70px 0 20px 0 !important;
        visibility: hidden !important;
        opacity: 0 !important;
        margin: 0 !important;
    }
    
    .nav-menu.active {
        display: flex !important;
        transform: translateX(0) !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    /* Overlay and scroll lock when menu is open */
    body.menu-open {
        overflow: hidden !important;
    }
    /* NOTE: Overlay is now a real DOM element (#menu-overlay) created by script.js.
       Pseudo-elements (::before/::after) pass click events to their parent element,
       which blocks clicks on menu items. DO NOT use pseudo-element overlays. */
    
    @keyframes fadeIn {
        from { opacity: 0; }
        to { opacity: 1; }
    }
    
    .nav-menu li {
        width: 100% !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.15) !important;
        position: relative !important;
        margin: 0 !important;
    }
    
    .nav-menu li:first-child {
        border-top: 1px solid rgba(255, 255, 255, 0.15) !important;
    }
    
    .nav-menu li a {
        padding: 16px 20px !important;
        display: flex !important;
        align-items: center !important;
        width: 100% !important;
        font-size: 15px !important;
        font-weight: 600 !important;
        min-height: 52px !important;
        color: #ffffff !important;
        text-decoration: none !important;
        transition: all 0.3s ease !important;
        position: relative !important;
        text-transform: uppercase !important;
        letter-spacing: 0.5px !important;
    }
    
    .nav-menu li a:hover {
        background: rgba(255, 255, 255, 0.1) !important;
        padding-left: 25px !important;
    }
    
    .nav-menu li a i {
        margin-right: 12px !important;
        font-size: 16px !important;
        width: 20px !important;
        text-align: center !important;
    }
    
    /* Dropdown Menu Styling */
    .dropdown-menu {
        display: none !important;
        background: rgba(0, 0, 0, 0.3) !important;
        width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
        box-shadow: none !important;
    }
    
    .dropdown.active > .dropdown-menu {
        display: block !important;
    }
    
    .dropdown-menu li {
        border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    }
    
    .dropdown-menu li a {
        padding-left: 50px !important;
        font-size: 14px !important;
        font-weight: 500 !important;
    }
    
    /* Nested Submenu */
    .dropdown-menu-sub {
        display: none !important;
        background: rgba(0, 0, 0, 0.4) !important;
        width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    .dropdown-sub.active > .dropdown-menu-sub {
        display: block !important;
    }
    
    .dropdown-menu-sub li a {
        padding-left: 70px !important;
        font-size: 13px !important;
    }
    
    /* Dropdown Arrow */
    .nav-menu li.dropdown > a::after {
        content: '\f078' !important;
        font-family: 'Font Awesome 5 Free' !important;
        font-weight: 900 !important;
        margin-left: auto !important;
        transition: transform 0.3s ease !important;
    }
    
    .nav-menu li.dropdown.active > a::after {
        transform: rotate(180deg) !important;
    }
    
    /* Dropdown sub arrow indicator */
    .nav-menu li.dropdown-sub > a::after {
        content: '\f105' !important;
        font-family: 'Font Awesome 5 Free' !important;
        font-weight: 900 !important;
        margin-left: auto !important;
        transition: transform 0.3s ease !important;
    }
    
    .nav-menu li.dropdown-sub.active > a::after {
        transform: rotate(90deg) !important;
    }
    
    /* ============================================
       CRITICAL: Disable hover-based dropdowns on mobile
       Inline <style> in pages defines :hover rules —
       these must be overridden so only JS click (.active) works
       ============================================ */
    .nav-menu li.dropdown:hover > .dropdown-menu {
        display: none !important;
    }
    .dropdown-sub:hover > .dropdown-menu-sub {
        display: none !important;
    }
    /* Only show via .active class (JS click) */
    .nav-menu li.dropdown.active > .dropdown-menu {
        display: block !important;
        position: static !important;
    }
    .dropdown-sub.active > .dropdown-menu-sub {
        display: block !important;
        position: static !important;
    }
    
    /* Force dropdown menus static on mobile */
    .dropdown-menu,
    .dropdown-menu-sub {
        position: static !important;
    }
}

/* ============================================
   VERY SMALL SCREENS (max-width: 480px)
   ============================================ */

@media (max-width: 480px) {
    .marquee-box {
        min-height: 38px !important; /* Slightly smaller for small screens */
    }
    
    .marquee-title {
        font-size: 10px !important; /* Readable size */
        padding: 6px 10px !important; /* Compact but readable padding */
        min-width: auto !important;
        width: auto !important;
        letter-spacing: 0.5px !important; /* Better readability */
        font-family: 'Segoe UI', Arial, sans-serif !important;
    }
    
    .marquee-content {
        padding: 6px 10px !important;
        font-size: 11px !important; /* Readable font */
        min-height: 38px !important; /* Match box height */
    }
    
    .navbar .container {
        padding: 6px 12px !important; /* Equal padding for centering */
        min-height: 45px !important; /* Reduced height to minimize red space */
        justify-content: center !important; /* Center the button */
    }
    
    .mobile-menu-toggle {
        padding: 6px 12px !important; /* Proper padding */
        font-size: 16px !important;
        min-height: 36px !important;
        max-width: calc(100% - 24px) !important; /* Prevent overflow */
        position: relative !important;
        left: auto !important;
        right: auto !important;
        top: auto !important;
        transform: none !important;
        border: 2px solid #c62828 !important;
        box-shadow: 0 3px 8px rgba(198, 40, 40, 0.4), 0 0 0 3px rgba(198, 40, 40, 0.1) !important;
        gap: 6px !important;
        margin: 0 auto !important; /* Center the button */
    }
    
    .mobile-menu-toggle:hover {
        transform: scale(1.05) !important;
    }
    
    .mobile-menu-toggle:active {
        transform: scale(0.95) !important;
    }
    
    .mobile-menu-toggle::after {
        font-size: 11px !important;
    }
    
    .mobile-menu-toggle:hover {
        box-shadow: 0 4px 12px rgba(198, 40, 40, 0.6), 0 0 0 4px rgba(198, 40, 40, 0.2) !important;
    }
    
    .mobile-menu-toggle.active {
        box-shadow: 0 4px 12px rgba(198, 40, 40, 0.7), 0 0 0 4px rgba(198, 40, 40, 0.25) !important;
    }
    
    .nav-menu li a {
        padding: 14px 18px !important;
        font-size: 14px !important;
        min-height: 48px !important;
    }
}
