/* css/header.css */

/* Basic Reset (Minimal for component reusability if not already globally defined) */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Color Palette Variables (Essential for the header) */
:root {
    --primary-color: #00796B; /* Deep Teal - This can be overridden by JS from data.json */
    --primary-hover-color: #004D40; /* Darker Teal for hover - Adjusted for consistency */
    --secondary-color: #FFC107; /* Default Amber for accents - Can be overridden */
    --text-dark: #2F4F4F; /* Dark Slate Gray for body text */
    --text-headings: #1A3A3A; /* Even darker for headings */
    --text-light: #FDFDFD; /* Off-white for dark backgrounds */
    --border-color: #D1D5DB; /* Light border color */
    --transition-speed: 0.3s; /* Default transition speed */
    --transition-speed-fast: 0.2s; /* Faster transition speed */
    --transition-dropdown: 0.25s; /* Specific for dropdowns */

    --header-top-bar-bg: var(--primary-color); /* Ensure top bar uses primary color */
    --header-top-bar-text-color: #E0F2F1;
    --header-top-bar-link-hover-color: #FFFFFF;
    --header-top-bar-icon-color: #A7FFEB;
    --header-top-bar-item-hover-bg: rgba(255, 255, 255, 0.1);
}

/* Body font for context if component is viewed standalone */
body {
    font-family: 'Inter', sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
}
h1, h2, h3, h4, h5, h6 {
    font-family: 'Lora', serif;
    color: var(--text-headings);
}

/* Container class (for general page content) */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* --- Header Design inspired by provided image --- */

/* The main header element */
.header {
    background-color: #ffffff; /* White background for the header bar */
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1); /* Soft, subtle shadow */
    position: sticky; /* Sticky position to stay at top on scroll */
    top: 0;
    left: 0;
    width: 100%;
    z-index: 999; /* Ensure it's above other content */
    padding: 0.5rem 0; /* Reduced vertical padding to match screenshot's compact header */
    min-height: 80px; /* Minimum height for the header */
}

/* Main content wrapper inside the header for desktop layout */
.header .container.main-header-content {
    display: flex;
    justify-content: space-between; /* Distributes items to space out logo, navs, and button */
    align-items: center;
    min-height: 80px; /* Matches header min-height */
}

/* Logo specific styles */
.logo {
    flex-shrink: 0; /* Prevents logo from shrinking */
}

.logo a {
    display: inline-block;
}
.logo img {
    height: 90px; /* Adjusted logo size to match screenshot's relative size */
    width: auto;
    display: block;
    transition: transform var(--transition-speed) ease;
}
.logo a:hover img {
    transform: scale(1.02); /* Subtle scale */
}

/* Desktop Navigation Links */
.nav-links {
    display: flex; /* Always flex for desktop */
    align-items: center;
    list-style: none;
    padding: 0;
    margin: 0 auto; /* Center navigation links automatically */
    gap: 2rem; /* Space between main nav items */
    flex-grow: 1; /* Allow nav links to grow and push other elements */
    justify-content: center; /* Center nav links in the available space */
}

.nav-links > a {
    text-decoration: none !important; /* Ensure no underline */
    color: var(--text-dark); /* Default text color */
    font-size: 0.95rem; /* Adjusted font size to match screenshot */
    font-weight: 500;
    padding: 0.6rem 0.8rem; /* Adjusted padding */
    text-transform: uppercase; /* Uppercase as in screenshot */
    white-space: nowrap;
    display: inline-block;
    position: relative; /* For pseudo-elements */
    z-index: 1; /* Ensure text is above pseudo-elements */
    transition: color var(--transition-speed-fast) ease; /* Transition for text color */
}

/* Split Border Reveal Effect for main nav links */
.nav-links > a::before,
.nav-links > a::after {
    content: '';
    position: absolute;
    height: 2px; /* Thickness of the border */
    background-color: var(--primary-color);
    width: 0; /* Start hidden */
    left: 50%; /* Start from center */
    transform: translateX(-50%) scaleX(0); /* Center and scale to 0 */
    transition: width var(--transition-speed) ease-out, transform var(--transition-speed) ease-out;
}

.nav-links > a::before {
    top: 0; /* Top border */
}

.nav-links > a::after {
    bottom: 0; /* Bottom border */
}

.nav-links > a:hover::before,
.nav-links > a:hover::after {
    width: 100%; /* Expand to full width */
    transform: translateX(-50%) scaleX(1); /* Scale to 1, maintaining center */
}

.nav-links > a:hover {
    color: var(--primary-color) !important; /* Change text color to primary on hover */
}


/* Styles for Desktop Navigation Dropdown */
.nav-item-dropdown {
    position: relative;
    z-index: 1; /* Ensure text is above pseudo-elements */
}

.nav-item-dropdown .dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.4em; /* Adjusted gap for arrow */
    cursor: pointer;
    text-decoration: none !important; /* Ensure no underline */
    color: var(--text-dark);
    font-size: 0.95rem;
    font-weight: 500;
    padding: 0.6rem 0.8rem; /* Adjusted padding */
    text-transform: uppercase;
    white-space: nowrap;
    position: relative; /* For pseudo-elements */
    transition: color var(--transition-speed-fast) ease;
}

/* Split Border Reveal Effect for dropdown toggle */
.nav-item-dropdown .dropdown-toggle::before,
.nav-item-dropdown .dropdown-toggle::after {
    content: '';
    position: absolute;
    height: 2px; /* Thickness of the border */
    background-color: var(--primary-color);
    width: 0; /* Start hidden */
    left: 50%; /* Start from center */
    transform: translateX(-50%) scaleX(0); /* Center and scale to 0 */
    transition: width var(--transition-speed) ease-out, transform var(--transition-speed) ease-out;
}

.nav-item-dropdown .dropdown-toggle::before {
    top: 0; /* Top border */
}

.nav-item-dropdown .dropdown-toggle::after {
    bottom: 0; /* Bottom border */
}

.nav-item-dropdown .dropdown-toggle:hover::before,
.nav-item-dropdown .dropdown-toggle:hover::after {
    width: 100%; /* Expand to full width */
    transform: translateX(-50%) scaleX(1); /* Scale to 1, maintaining center */
}

.nav-item-dropdown .dropdown-toggle:hover {
    color: var(--primary-color) !important; /* Change text color to primary on hover */
}


.nav-item-dropdown .dropdown-arrow {
    font-size: 0.7em;
    transition: transform var(--transition-speed-fast) ease, color var(--transition-speed-fast) ease; /* Added color transition, faster */
    margin-left: 0.3em;
    color: var(--text-dark); /* Default arrow color */
}

.nav-item-dropdown:hover .dropdown-arrow {
    transform: rotate(180deg);
    color: var(--primary-color) !important; /* Change arrow color to primary on hover */
}

.nav-item-dropdown .dropdown-menu {
    display: block;
    position: absolute;
    top: calc(100% + 10px); /* Position further below the parent */
    left: 0;
    background-color: #ffffff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15); /* More subtle shadow */
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1.2rem 0;
    list-style: none;
    z-index: 1000;
    min-width: 240px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px) scale(0.98); /* Adjusted initial state for smoother entry */
    transform-origin: top center;
    transition: opacity var(--transition-dropdown) ease-out,
                visibility 0s linear var(--transition-dropdown), /* Hides instantly, shows after opacity */
                transform var(--transition-dropdown) cubic-bezier(0.23, 1, 0.32, 1); /* SMOOTHER DROPDOWN TRANSITION */
}

.nav-item-dropdown:hover .dropdown-menu,
.nav-item-dropdown .dropdown-toggle:focus + .dropdown-menu,
.nav-item-dropdown .dropdown-menu:hover {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1); /* Final state for dropdown animation */
    transition-delay: 0s, 0s, 0s; /* Ensures immediate transition when showing */
}

.dropdown-menu li {
    opacity: 0;
    transform: translateX(-10px);
    /* Animation applied dynamically below for staggered effect */
}

/* Staggered animation for list items */
.nav-item-dropdown:hover .dropdown-menu li {
    animation: fadeInSlideItem 0.3s ease-out forwards;
}
.nav-item-dropdown:hover .dropdown-menu li:nth-child(1) { animation-delay: 0.05s; }
.nav-item-dropdown:hover .dropdown-menu li:nth-child(2) { animation-delay: 0.1s; }
.nav-item-dropdown:hover .dropdown-menu li:nth-child(3) { animation-delay: 0.15s; }
.nav-item-dropdown:hover .dropdown-menu li:nth-child(4) { animation-delay: 0.2s; } /* Add more if needed */


@keyframes fadeInSlideItem {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}


.dropdown-menu li a {
    display: block;
    padding: 0.8rem 1.5rem;
    color: var(--text-dark);
    text-decoration: none !important; /* Ensure no underline */
    font-size: 0.9rem;
    white-space: nowrap;
    transition: background-color var(--transition-speed-fast) ease, color var(--transition-speed-fast) ease;
}

.dropdown-menu li a:hover {
    background-color: #f8f8f8;
    color: var(--primary-color);
}
.dropdown-menu li a::after {
    display: none;
}

/* BOOK NOW Button */
a.btn-contact-now {
    display: inline-block;
    background-color: var(--primary-color); /* Default background: primary green */
    color: var(--text-light) !important; /* Default text: white */
    border: 1px solid var(--primary-color); /* Add a border to maintain size on hover */
    padding: 0.6rem 1.3rem;
    text-decoration: none !important;
    border-radius: 30px;
    font-weight: 500;
    text-align: center;
    text-transform: none !important;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease; /* Removed transform, box-shadow, filter */
    font-size: 0.9rem;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1); /* Kept initial shadow, but won't change on hover */
    margin-left: 2rem;
    flex-shrink: 0;
}
a.btn-contact-now:hover {
    background-color: var(--text-light); /* Hover background: white */
    color: var(--primary-color) !important; /* Hover text: primary green */
    border-color: var(--primary-color); /* Hover border: primary green */
    /* Removed transform, box-shadow, filter changes on hover */
    text-decoration: none !important;
}


/* Mobile Menu Button */
.mobile-menu-button {
    display: flex; /* Changed to flex */
    justify-content: center; /* Center horizontally */
    align-items: center; /* Center vertically */
    background: none;
    border: none;
    color: var(--text-dark); /* Dark icon for white background */
    font-size: 2.2rem;
    cursor: pointer;
    margin-left: 1.5rem;
    padding: 0.5rem; /* Smaller padding */
    border-radius: 50%;
    transition: color var(--transition-speed-fast) ease, transform var(--transition-speed-fast) ease, background-color var(--transition-speed-fast) ease;
}
.mobile-menu-button:hover {
    color: var(--primary-color);
    transform: scale(1.15);
    background-color: #f8f8f8;
}

/* Mobile Menu Styles */
.mobile-menu {
    background-color: #ffffff;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.12);
    padding-top: 1rem;
    padding-bottom: 1rem;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 998;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    visibility: hidden;
    transition: max-height 0.4s cubic-bezier(0.23, 1, 0.32, 1), /* Smoother opening */
                opacity 0.3s ease-in-out,
                visibility 0s linear 0.4s;
}

.mobile-menu.active {
    max-height: 600px; /* Increased max-height to ensure content fits */
    opacity: 1;
    visibility: visible;
    transition: max-height 0.4s cubic-bezier(0.23, 1, 0.32, 1),
                opacity 0.3s ease-in-out,
                visibility 0s linear 0s;
}

.mobile-menu > a,
.mobile-menu > .mobile-nav-item-dropdown > .mobile-dropdown-toggle {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--text-dark);
    padding: 1.2rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color var(--transition-speed) ease, background-color var(--transition-speed-fast) ease, transform var(--transition-speed-fast) ease; /* Added background and transform transition */
    position: relative;
    width: 100%; /* Ensure it takes full width for hover effect */
}
/* Removed animated underline for mobile menu links */
.mobile-menu > a::after {
    display: none;
}
.mobile-menu > a:hover {
    color: var(--primary-color);
    background-color: #E0F2F1; /* Subtle background on hover, lighter primary shade */
    transform: translateX(5px); /* Subtle slide to the right */
}

.mobile-nav-item-dropdown {
    /* Basic container */
}

.mobile-dropdown-toggle {
    justify-content: space-between;
    width: 100%;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
}
.mobile-dropdown-toggle:hover {
    color: var(--primary-color);
    background-color: #E0F2F1; /* Subtle background on hover */
    transform: translateX(5px); /* Subtle slide to the right */
}

.mobile-dropdown-toggle .dropdown-arrow {
    font-size: 1em;
    transition: transform var(--transition-speed-fast) ease;
}

.mobile-dropdown-toggle[aria-expanded="true"] .dropdown-arrow {
    transform: rotate(180deg);
}

.mobile-dropdown-menu {
    list-style: none;
    padding-left: 0;
    margin: 0;
    background-color: #f5f5f5;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.mobile-dropdown-menu.open {
    max-height: 200px;
}

.mobile-dropdown-menu li a {
    display: block;
    padding: 0.8rem 1.2rem 0.8rem 2.5rem;
    font-size: 0.85rem;
    color: var(--text-dark);
    text-decoration: none;
    transition: color var(--transition-speed-fast) ease, background-color var(--transition-speed-fast) ease;
}
.mobile-dropdown-menu li a:hover {
    color: var(--primary-color);
    background-color: #e0e0e0;
}
.mobile-dropdown-menu li a::after {
    display: none;
}

.mobile-menu .contact-info-mobile {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--text-dark);
    padding: 1.2rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 500;
}
.mobile-menu .contact-info-mobile i {
     margin-right: 0.6rem;
     color: var(--primary-color);
}

.mobile-menu .btn-book-now-mobile {
    display: block;
    background-color: var(--primary-color); /* Default background: primary green */
    color: var(--text-light); /* Default text: white */
    border: 1px solid var(--primary-color); /* Add a border to maintain size on hover */
    margin: 1.2rem 1.5rem;
    padding: 0.9rem 1.8rem;
    border-radius: 0.5rem;
    font-weight: bold;
    text-align: center;
    text-transform: none !important;
    text-decoration: none !important; /* Ensure no underline for mobile button */
    transition: background-color var(--transition-speed) ease, color var(--transition-speed) ease, border-color 0.2s ease; /* Removed transform, box-shadow */
}
.mobile-menu .btn-book-now-mobile:hover {
    background-color: var(--text-light); /* Hover background: white */
    color: var(--primary-color) !important; /* Hover text: primary green */
    border-color: var(--primary-color); /* Hover border: primary green */
    /* Removed transform, box-shadow, filter changes on hover */
    text-decoration: none !important;
}

.mobile-menu hr {
    border: none;
    border-top: 1px solid #e0e0e0;
    margin: 1rem 1.5rem;
}

/* Responsive Adjustments for Header Elements */
@media (min-width: 768px) {
    .top-thin-bar { /* Show the new top thin bar on desktop */
        display: block;
    }
    .header .header-pill-content {
        display: flex;
    }
    .nav-links {
        display: flex; /* Ensure nav links are flex for desktop */
    }
    .header-utility-actions { /* Show utility actions on desktop */
        display: flex;
    }
    .mobile-menu-button {
        display: none;
    }
    .mobile-menu {
        display: none !important;
        max-height: 0;
        opacity: 0;
        visibility: hidden;
    }
}

@media (max-width: 767px) {
    .top-thin-bar { /* Hide the new top thin bar on mobile */
        display: none;
    }
    .header .header-pill-content { /* Hide the desktop pill container on mobile */
        display: none;
    }
    /* Show mobile menu button on mobile */
    .mobile-menu-button {
        display: flex; /* Changed to flex */
        justify-content: center; /* Center horizontally */
        align-items: center; /* Center vertically */
        margin-left: auto; /* Push mobile button to right */
    }
    .header { /* Ensure main header itself is still visible on mobile */
        height: 65px; /* Fixed height for mobile header, allowing 5px top/bottom for 55px logo */
        display: flex;
        align-items: center; /* Vertically center content */
        justify-content: space-between; /* Space out logo and mobile button */
    }
    .header .container.main-header-content {
        display: flex; /* Re-enable flex for logo and mobile button */
        justify-content: space-between;
        align-items: center; /* Vertically center content */
        width: 100%;
        padding: 0 15px;
    }
    .logo { /* Show logo in main header on mobile */
        display: block;
        /* Removed height: 70px; as it was applied to the div, not the img */
        /* Removed margin-right: auto; as justify-content handles spacing */
    }
    .logo img { /* Explicitly set image height on mobile */
        height: 55px; /* Adjust logo size for mobile */
        width: auto; /* Maintain aspect ratio */
    }
    .nav-links,
    .header-utility-actions,
    a.btn-contact-now { /* Hide desktop nav, utility, and contact button on mobile */
        display: none;
    }
}
