/* public/css/header.css */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&family=Poppins:wght@400;500;600;700&display=swap');

/* Color Palette Variables - Using Navy Blue and Aqua Green */
:root {
    --header-bg-dark: #1A2E40; /* Deep Navy Blue */
    --header-bg-light: #2A445C; /* Slightly lighter Navy for subtle effects */
    --text-light: #ECF0F1;      /* Light off-white for main text */
    --accent-teal: #1ABC9C;     /* Vibrant Aqua Green for buttons/highlights */
    --accent-teal-dark: #16A085;/* Darker Aqua Green on hover */
    --link-hover-aqua: #82E0AA; /* Lighter Aqua Green for link hover */
    --mobile-nav-bg: #1A2E40;   /* Same as header dark for mobile menu */
    --border-color-light: rgba(255, 255, 255, 0.1);
}

body {
    padding-top: 80px; /* Space for fixed header */
    font-family: 'Poppins', sans-serif; /* Primary font */
    background-color: #f4f7f6; /* A clean page background */
    margin: 0;
}

/* Scroll lock for mobile menu */
body.no-scroll {
    overflow: hidden;
}

/* --- Main Header Styling --- */
.main-header {
    background-color: var(--header-bg-dark);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: center; /* Changed back to center to align header-content */
    align-items: center;
    height: 80px; /* Fixed height for the header */
    overflow: hidden; /* Ensure content stays within bounds */
}

.header-content {
    width: 100%;
    max-width: 98%; /* Your specified max-width */
    padding: 0 40px; /* Generous horizontal padding */
    display: flex;
    justify-content: space-between; /* Default desktop distribution */
    align-items: center;
    position: relative;
    z-index: 2; /* Ensure content is above pseudo-elements */
}

/* Subtle diagonal background pattern */
.main-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--header-bg-dark) 60%, var(--header-bg-light) 100%);
    /* Example: subtle stripe pattern */
    background-image: linear-gradient(45deg, var(--header-bg-dark) 25%, transparent 25%, transparent 75%, var(--header-bg-dark) 75%, var(--header-bg-dark)),
                      linear-gradient(45deg, var(--header-bg-dark) 25%, transparent 25%, transparent 75%, var(--header-bg-dark) 75%, var(--header-bg-dark));
    background-size: 20px 20px; /* Size of the stripes */
    background-position: 0 0, 10px 10px; /* Offset for second pattern */
    opacity: 0.1; /* Very subtle */
    z-index: 1;
}


/* --- Logo and Brand Name --- */
.header-logo-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--text-light);
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 1.6rem; /* Slightly bigger brand text */
    letter-spacing: 0.8px;
    transition: color 0.3s ease;
    flex-shrink: 0; /* Prevent shrinking on small screens */
    /* Default desktop order */
    order: 1;
}

.header-logo-brand:hover {
    color: var(--link-hover-aqua);
}

.logo-img {
    height: 90px; /* Your specified size */
    width: 70px; /* Your specified size */
    margin-right: 5px; /* Your specified margin */
    /* border-radius: 50%;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3); */
}

.brand-name {
    white-space: nowrap;
    opacity: 0.95;
    font-size: 1rem; /* Your specified font size for desktop base */
}


/* --- Main Navigation (Desktop) --- */
.main-nav {
    flex-grow: 1; /* Allow nav to take up available space */
    display: flex; /* Use flex to center the nav items */
    justify-content: center;
    margin: 0 30px; /* Space between logo/actions and nav */
    /* Default desktop order */
    order: 2;
}

.main-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 45px; /* Generous spacing between desktop links */
}

.nav-link {
    text-decoration: none;
    color: var(--text-light);
    font-weight: 500;
    font-size: 1.05rem; /* Slightly larger links */
    padding: 5px 0;
    position: relative;
    transition: all 0.3s ease;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.nav-link::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -8px;
    width: 0;
    height: 3px;
    background-color: var(--link-hover-aqua);
    transform: translateX(-50%);
    transition: width 0.3s ease-out;
    border-radius: 2px;
}

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

.nav-link:hover,
.nav-link.active {
    color: var(--link-hover-aqua);
}

/* Dropdown Menu Styling (Desktop) */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 15px);
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--header-bg-dark);
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, 10px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
    padding: 10px 0;
    z-index: 1001;
    border: 1px solid var(--border-color-light);
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
}

.dropdown-menu a {
    color: var(--text-light);
    padding: 10px 20px;
    text-decoration: none;
    display: block;
    font-size: 0.95rem;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.dropdown-menu a:hover {
    background-color: rgba(255, 255, 255, 0.08);
    color: var(--link-hover-aqua);
}

.dropdown-toggle .fas {
    margin-left: 8px;
    font-size: 0.75rem;
    transition: transform 0.3s ease;
    /* Hide desktop dropdown arrow by default */
    display: none;
}

.dropdown:hover .dropdown-toggle .fas {
    transform: rotate(180deg);
    color: var(--link-hover-aqua);
}


/* --- Header Actions (Sign-In/User Info) --- */
.header-actions {
    display: flex;
    align-items: center;
    gap: 20px; /* Space between elements */
    flex-shrink: 0;
    /* Default desktop order */
    order: 3;
}

.user-greeting {
    color: var(--text-light);
    font-weight: 500;
    font-size: 1rem;
    white-space: nowrap;
}

.btn-action {
    background-color: var(--accent-teal);
    color: #fff;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-right: 15px; /* Your specified margin */
}

.btn-action:hover {
    background-color: var(--accent-teal-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

/* --- Mobile Menu Toggle (Hamburger) --- */
.menu-toggle {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 2rem;
    cursor: pointer;
    display: none; /* Hidden on desktop, shown by media queries */
    transition: color 0.3s ease;
    padding: 0;
    /* Order set in mobile media queries */
}
.menu-toggle:hover {
    color: var(--accent-teal);
}

/* --- Mobile Right Spacer --- */
.mobile-right-spacer {
    display: none; /* Hidden on desktop */
    flex-shrink: 0;
    /* Width and order set in mobile media queries */
}

/* --- Mobile Navigation (Off-Canvas) --- */
.mobile-nav {
    position: fixed;
    top: 0;
    right: -320px; /* Off-screen */
    width: 320px;
    max-width: 90vw; /* Added for very small screens */
    height: 100%;
    background-color: var(--mobile-nav-bg);
    box-shadow: -8px 0 25px rgba(0, 0, 0, 0.4);
    z-index: 1002;
    transition: right 0.4s ease-in-out;
    display: flex;
    flex-direction: column;
    padding-bottom: 20px;
    overflow-y: auto;
}

.mobile-nav.is-open {
    right: 0;
}

.mobile-nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    background-color: var(--header-bg-dark);
    border-bottom: 1px solid var(--border-color-light);
    margin-bottom: 15px;
}

.mobile-nav-header .header-logo-brand {
    font-size: 1.4rem;
}
.mobile-nav-header .logo-img {
    height: 40px;
}
.mobile-nav-header .brand-name {
    font-size: 1rem;
}

.menu-close {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 2rem;
    cursor: pointer;
    transition: color 0.3s ease;
}
.menu-close:hover {
    color: var(--accent-teal);
}

.mobile-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    flex-grow: 1;
}

.mobile-nav li {
    border-bottom: 1px solid var(--border-color-light);
}
.mobile-nav li:last-of-type {
    border-bottom: none;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 18px 25px;
    text-decoration: none;
    color: var(--text-light);
    font-size: 1.05rem;
    font-weight: 500;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.mobile-nav-link i {
    font-size: 1.25rem;
    color: var(--link-hover-aqua);
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
    background-color: rgba(255, 255, 255, 0.08);
    color: var(--link-hover-aqua);
}
.mobile-nav-link:hover i,
.mobile-nav-link.active i {
    color: var(--accent-teal);
}

/* Mobile Dropdown */
.mobile-dropdown-toggle {
    display: flex;
    justify-content: space-between; /* To push arrow to right */
    align-items: center;
}
.mobile-dropdown-toggle .dropdown-arrow {
    margin-left: auto; /* Changed to auto to push arrow right */
    transition: transform 0.3s ease;
}
.mobile-dropdown-toggle.active .dropdown-arrow {
    transform: rotate(180deg);
}

.mobile-dropdown-menu {
    display: none;
    background-color: rgba(0, 0, 0, 0.2);
    padding-left: 30px;
    animation: fadeIn 0.3s ease-out;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.mobile-dropdown-menu a {
    display: block;
    padding: 12px 25px;
    text-decoration: none;
    color: var(--text-light);
    font-size: 0.95rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.mobile-dropdown-menu a:last-child {
    border-bottom: none;
}
.mobile-dropdown-menu a:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--link-hover-aqua);
}

.mobile-action-item {
    margin-top: 30px;
    padding: 0 25px;
}
.btn-action-mobile {
    width: 100%;
    text-align: center;
    padding: 14px 0;
    font-size: 1.05rem;
}

/* --- Responsive Utility Classes --- */
.d-none { display: none !important; }

/* Desktop-specific classes, set to none by default */
.d-lg-block { display: none !important; }
.d-lg-flex { display: none !important; }

/* --- Media Queries (Your Breakpoints) --- */

/* Desktop Base / Large Screens (Default above 991px) */
/* Re-enable desktop-specific elements for screens >= 992px */
@media (min-width: 992px){
    .d-lg-block { display: block !important; }
    .d-lg-flex { display: flex !important; } /* Ensure flex for desktop actions/nav */
    .menu-toggle, .mobile-right-spacer {
        display: none !important; /* Hide mobile specific elements */
    }
    /* Reset mobile-specific flex ordering if applied */
    .header-logo-brand { order: 0; text-align: left; margin-left: 0; flex-grow: 0; }
    .main-nav { order: 0; }
    .header-actions { order: 0; }
}

@media (min-width:1349px) and (max-width:1688px){ /* Corrected 'and' syntax */
    .main-nav ul{
        gap:20px;
    }
    /* .brand-name{
        display: none;
    } */
}

@media(min-width: 1033px) and (max-width:1348px){ /* Corrected 'and' syntax */
    .main-nav ul{
        gap:15px;
    }
    .brand-name{
        display: none;
    }
    .header-logo-brand{
        margin-left:-50px;
    }
    .header-actions{
        margin-right: -80px;
    }
}

/* Your original 992px-1000px breakpoint. This acts like a 'mini-desktop' adjustment */
@media (min-width:1028px) and (max-width: 1032px) {
    .main-header {
        height: 70px;
    }
    .main-nav ul{
        gap:15px;
    }
    body {
        padding-top: 70px;
    }
    .header-content {
        padding: 0 15px;
    }
    .logo-img {
        height: 90px;
        width:70px;
        margin-left: -30px;
    }
    .brand-name {
        display: none;
    }
    .menu-toggle {
        font-size: 2.8rem;
        margin-top: -3px;
        /* These margin adjustments are typically for mobile, keeping them here as per your original code */
    }
    /* Ensure desktop navigation and actions are still hidden here if this is a 'mobile-like' desktop */
    /* Based on your original request, I'm assuming this range still behaves like desktop for nav/actions */
    .main-nav, .header-actions {
        display: flex !important; /* Re-affirm they are visible for this specific desktop range */
    }
    .menu-toggle, .mobile-right-spacer {
        display: none !important; /* Re-affirm mobile elements are hidden */
    }
    /* Desktop order remains */
    .header-logo-brand { order: 1; text-align: left; margin-left: 0; flex-grow: 0; }
    .main-nav { order: 2; }
    .header-actions { order: 3; }
}


/* For devices smaller than or equal to 991px (TABLETS AND PHONES) */
@media (max-width: 1028px) {
    /* Hide desktop nav/actions regardless of inner min-width checks below */
    .main-nav, .header-actions {
        display: none !important;
    }

    /* Show mobile-specific elements */
    .menu-toggle {
        display: block !important; /* Show hamburger */
        order: 3; /* Place hamburger first (left) */
        margin-left: 40%;
        margin-top: -3px;
    }
    .mobile-right-spacer {
        display: block !important; /* Show spacer to push logo center */
        order: 2; /* Place spacer third (right) */
        width: 2rem; /* Give it width to balance the toggle button */
        height: 1px; /* Minimal height */
    }

    /* Apply centering logic for the logo */
    .header-logo-brand {
        order: 1; /* Place logo second (center) */
        flex-grow: 1; /* Allow it to grow to push spacer right */
        text-align: center; /* Center the text/image within its flex item */
        margin-left: -2rem; /* Compensate for menu-toggle width */
    }
    /* Reset margins that might have been applied by your desktop queries */
    .header-logo-brand, .header-actions {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
}

/* Your specific styling for (min-width: 577px) and (max-width: 991px) */
@media (min-width: 681px) and (max-width: 991px) { /* Corrected 'and' syntax */
    .header-content {
        padding: 0 20px;
    }
    .header-logo-brand {
        font-size: 1.3rem; /* Your specified font size */
    }
    .brand-name {
        font-size: 1rem; /* Your specified font size */
    }
    .btn-action { /* This class is hidden by max-width:991px anyway, but keeping for consistency */
        padding: 8px 18px;
        font-size: 0.9rem;
        gap: 6px;
        margin-right: 0;
    }
    .logo-img { /* Apply mobile specific logo size */
        height: 90px;
        width:70px;
        margin-left: auto;
    }
    .menu-toggle { /* Adjust toggle size for tablets */
        font-size: 2rem;
        /* margin-left: 25%;*/
        margin-right: 10px !important; 
        flex-direction: column-reverse;
        margin-top: -3px; /* Reset previous margin */
    }
    .header-logo-brand {
        margin-left: -2rem; /* Match with toggle button size */
    }
    .mobile-right-spacer {
        width: 2rem; /* Match with toggle button size */
    }
}
@media (min-width: 577px) and (max-width: 682px) { /* Corrected 'and' syntax */
    .header-content {
        padding: 0 20px;
    }
    .header-logo-brand {
        font-size: 1.3rem; /* Your specified font size */
    }
    .brand-name {
        display: none;
    }
    .btn-action { /* This class is hidden by max-width:991px anyway, but keeping for consistency */
        padding: 8px 18px;
        font-size: 0.9rem;
        gap: 6px;
        margin-right: 0;
    }
    .logo-img { /* Apply mobile specific logo size */
        height: 90px;
        width:70px;
        margin-left: auto;
    }
    .menu-toggle { /* Adjust toggle size for tablets */
        font-size: 2rem;
        /* margin-left: 25%;*/
        display: flex;
        flex-direction: column-reverse;
        margin-left:50%;
        margin-top: -3px; /* Reset previous margin */
    }
    .header-logo-brand {
        margin-left: -2rem; /* Match with toggle button size */
    }
    .mobile-right-spacer {
        width: 2rem; /* Match with toggle button size */
    }
}

/* Your specific styling for (max-width: 576px) (SMALLER PHONES) */
@media (max-width: 576px) {
    .main-header {
        height: 70px;
    }
    body {
        padding-top: 70px;
    }
    .header-content {
        padding: 0 15px;
    }
    .logo-img {
        height: 90px; /* Your specified size */
        width:70px;  /* Your specified size */
    }
    .brand-name {
        display: none;
    }
    .menu-toggle {
        font-size: 2.8rem; /* Your specified size */
        margin-top: -3px; /* Your specified margin */
        margin-right:20px ;
    }
    .mobile-nav {
        width: 100%; /* Your specified width */
        right: -100%;
    }
    .mobile-nav.is-open {
        right: 0;
    }
    .header-logo-brand {
        margin-left: -1.8rem; /* Adjusted compensation for th menu toggle */
        flex-grow: 1; /* Re-affirm flex-grow */
        order: 1;
        text-align: center; /* Re-affirm text-align center */
    }
    .menu-toggle {
        order: 3; /* Ensure it's still first */
        font-size: 2.2rem; /* Adjust font size to fit better */
        margin-right: 10px !important;
    }
    .mobile-right-spacer {
        width: 2.2rem; /* Match the new toggle size for centering */
        order: 2; 
    }
}
