/* ============================================================================
   FILE: header-footer.css
   DESCRIPTION: Global Navigation, Announcement, Preloader, and Footer Styles.
   Manages the global layout shell that wraps the website content including 
   desktop/mobile headers, side drawers, and responsive footers.
   ============================================================================ */

/* --- 1. PAGE PRELOADER --- */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-body);
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.8s ease, visibility 0.8s;
}

.preloader-logo {
    height: 55px;
    filter: none;
    animation: pulseLogo 1.5s infinite ease-in-out alternate;
}

@keyframes pulseLogo {
    0% {
        transform: scale(0.95);
        opacity: 0.6;
    }

    100% {
        transform: scale(1.05);
        opacity: 1;
    }
}

.preloader-hidden {
    opacity: 0;
    visibility: hidden;
}

/* --- 2. ANNOUNCEMENT BAR --- */
/* The bar starts positioned off-screen (top: -28px) and slides down
   when body receives the 'page-loaded' class, creating a staggered
   entrance effect coordinated with the preloader dismissal. */
.announcement-bar {
    width: 100%;
    background-color: var(--text-main);
    color: var(--primary-gold);
    height: 28px;
    display: flex;
    align-items: center;
    overflow: hidden;
    position: fixed;
    top: -28px;
    z-index: 1001;
    transition: top 0.6s cubic-bezier(0.2, 0.8, 0.3, 1);
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body.page-loaded .announcement-bar {
    top: 0;
}

.announcement-track {
    display: flex;
    width: max-content;
    will-change: transform;
    opacity: 0;
    transition: opacity 0.5s ease;
    /* Animation and Hover-Pause are now fully controlled by Web Animations API in JS */
    transform: translateZ(0); /* Hardware acceleration */
}

.marquee-group {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.announcement-item {
    padding: 0 35px;
    font-size: 11px;
    line-height: 28px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    cursor: pointer;
    color: var(--primary-gold);
    white-space: nowrap;
}

body.page-loaded #main-header {
    top: 28px;
    margin-top: -1px;
}

/* --- 3. DESKTOP HEADER & NAVIGATION NAVBAR --- */
/* Uses backdrop-filter glassmorphism for a frosted-glass aesthetic.
   The semi-transparent background combined with blur creates depth
   while keeping content behind the header subtly visible. */
#main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(253, 251, 247, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: all 0.4s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

#main-header.scrolled {
    background: rgba(253, 251, 247, 0.98);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 5%;
    transition: all 0.4s ease;
}

#main-header.scrolled .navbar {
    padding: 12px 5%;
}

.logo {
    display: flex;
    align-items: center;
}

.logo img {
    height: 45px;
    transform: translateY(2px);
    transition: all 0.4s ease;
}

#main-header.scrolled .logo img {
    height: 40px;
    transform: translateY(1px);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 35px;
}

.nav-link {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 600;
    font-size: 1rem;
    position: relative;
    padding-bottom: 5px;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 50%;
    background-color: var(--primary-gold);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-link:hover::after {
    width: 100%;
}

.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    z-index: 1001;
    background: none !important;
    background-color: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    min-width: 44px;
    min-height: 44px;
    -webkit-tap-highlight-color: transparent;
    -webkit-appearance: none;
    appearance: none;
}

.hamburger span {
    width: 22px;
    height: 2px;
    background-color: var(--text-main);
    border-radius: var(--btn-radius);
    transition: 0.3s;
    box-shadow: none !important;
    border: none !important;
}

/* --- 4. MOBILE SIDE PANEL (Drawer Menu) --- */
.mobile-sidebar {
    position: fixed;
    top: 0;
    left: -100%;
    width: 300px;
    max-width: 80%;
    height: 100vh;
    height: 100dvh;
    background-color: var(--bg-section);
    z-index: 2000;
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    transition: left 0.4s cubic-bezier(0.77, 0, 0.175, 1);
    padding-bottom: env(safe-area-inset-bottom);
}

.mobile-sidebar.open {
    left: 0;
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
}

.sidebar-overlay.open {
    opacity: 1;
    visibility: visible;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.sidebar-logo {
    height: 40px;
}

.sidebar-links {
    list-style: none;
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    flex-grow: 1;
}

.side-link {
    text-decoration: none;
    font-size: 1.1rem;
    color: var(--text-main);
    font-weight: 500;
    transition: color 0.3s ease;
}

.side-link:hover {
    color: var(--primary-gold);
}

.sidebar-footer {
    padding: 25px 24px;
    border-top: 1px solid rgba(0, 0, 0, 0.04);
    background-color: var(--bg-body);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sidebar-contact-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sidebar-contact-item {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: #333333;
    font-size: 0.85rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

.sidebar-contact-item:hover {
    color: var(--primary-gold);
}

.sidebar-contact-item svg {
    color: var(--primary-gold);
    flex-shrink: 0;
}

.sidebar-wa-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 40px;
    background-color: var(--text-main);
    color: var(--text-light) !important;
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-radius: var(--btn-radius);
    transition: all 0.3s ease;
    margin-top: 4px;
}

.sidebar-wa-btn:hover {
    background-color: var(--wa-green);
    box-shadow: 0 6px 15px rgba(37, 211, 102, 0.25);
    transform: translateY(-1px);
}

.sidebar-social-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 14px;
    border-top: 1px solid rgba(0, 0, 0, 0.04);
}

.sidebar-social-label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #888888;
    font-weight: 600;
}

.sidebar-social-icons {
    display: flex;
    gap: 10px;
}

.sidebar-social-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--icon-radius);
    border: 1px solid rgba(0, 0, 0, 0.06);
    color: var(--text-main);
    transition: all 0.3s ease;
}

.sidebar-social-icon-btn:hover {
    color: var(--text-light);
    background-color: var(--text-main);
    border-color: var(--text-main);
    transform: translateY(-2px);
}

/* --- 5. FOOTER (ABOUT & CONTACT) --- */
/* The footer uses a dark theme (--bg-dark) creating visual contrast
   with the rest of the site. Contains a decorative Mithila-art SVG
   background element at 5% opacity for subtle cultural branding. */
#about-contact {
    position: relative;
    background-color: var(--bg-dark);
    color: var(--text-light);
    padding: 80px 5% 0 5%;
    overflow: hidden;
}

.mithila-pattern-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    opacity: 0.05;
    z-index: 0;
    pointer-events: none;
    display: flex;
    justify-content: center;
    align-items: center;
}

.footer-container {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 70px;
    max-width: 1100px;
    margin: 0 auto;
    padding-bottom: 60px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-logo {
    max-width: 130px;
    margin-bottom: 25px;
    filter: brightness(0) invert(1);
}

.footer-title {
    font-size: 1.35rem;
    color: var(--text-light);
    margin-bottom: 15px;
    font-weight: 600;
}

.footer-desc {
    font-size: 0.9rem;
    color: #999999;
    line-height: 1.8;
}

.contact-title {
    font-size: 1.35rem;
    color: var(--primary-gold);
    margin-bottom: 12px;
    font-weight: 600;
}

.contact-desc {
    font-size: 0.9rem;
    color: #999999;
    line-height: 1.6;
    margin-bottom: 30px;
}

.footer-links-wrapper {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    gap: 60px;
}

.link-group-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #666666;
    margin-bottom: 15px;
    font-weight: 700;
}

.contact-methods {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.social-methods {
    display: flex;
    gap: 20px;
}

.footer-social-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #dddddd;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    width: fit-content;
}

.footer-social-link svg {
    color: var(--primary-gold);
    transition: all 0.3s ease;
}

.footer-social-link:hover {
    color: var(--text-light);
    transform: translateX(4px);
}

.social-methods .footer-social-link:hover {
    transform: translateY(-3px);
}

.footer-social-link.phone-link:hover svg {
    color: #007AFF;
}

.footer-social-link.wa-link:hover svg {
    color: var(--wa-green);
}

.footer-social-link.email-link:hover svg {
    color: #EA4335;
}

.footer-social-link.ig-link:hover svg {
    color: #E1306C;
}

.footer-social-link.fb-link:hover svg {
    color: #1877F2;
}

.footer-bottom {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1100px;
    margin: 0 auto;
    padding: 25px 0;
    font-size: 0.8rem;
    color: #666666;
}

.footer-credits {
    display: flex;
    align-items: center;
    gap: 6px;
}

.footer-credits svg {
    color: var(--primary-gold);
}

/* --- 6. RESPONSIVENESS (Header & Footer) --- */

/* Tablet: same content size as desktop — matching duration for speed parity */

@media (max-width: 768px) {

    /* Navbar Layout Mobile Overrides */
    .navbar {
        display: grid;
        grid-template-columns: 1fr auto 1fr;
        align-items: center;
        padding: 14px 5%;
    }

    #main-header.scrolled .navbar {
        padding: 10px 5%;
    }

    .logo {
        justify-self: center;
    }

    .logo img {
        height: 40px;
    }

    #main-header.scrolled .logo img {
        height: 35px;
    }

    .nav-links {
        display: none;
    }

    .hamburger {
        display: flex;
        justify-self: flex-start;
    }

    /* Announcement Bar Mobile Overrides */
    .announcement-bar {
        height: 26px;
        top: -26px;
    }

    body.page-loaded #main-header {
        top: 26px;
        margin-top: -1px;
    }

    .announcement-item {
        padding: 0 25px;
        font-size: 10px;
        line-height: 26px;
    }

    /* About & Contact Footer Mobile Overrides */
    .footer-container {
        grid-template-columns: 1fr;
        gap: 50px;
        text-align: center;
        padding-bottom: 40px;
    }

    .footer-links-wrapper {
        flex-direction: column;
        align-items: center;
        gap: 40px;
    }

    .contact-methods {
        align-items: center;
    }

    .social-methods {
        justify-content: center;
    }

    .footer-title,
    .contact-title {
        font-size: 1.25rem;
    }

    .footer-desc,
    .contact-desc {
        font-size: 0.85rem;
    }

    .footer-bottom {
        flex-direction: column-reverse;
        gap: 12px;
        text-align: center;
        padding: 20px 0;
        font-size: 0.75rem;
    }
}