/* Header */
header {
    background-color: #632E9B; /* Unified purple background */
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between; /* Ensures logo and menu are on opposite ends */
    padding: 0 20px; /* Removed extra vertical padding */
    position: fixed;
    top: 0;
    z-index: 1000;
    border-bottom: 3px solid #000000; /* Black border under the header */
    height: 60px; /* Fixed height for the header */
    overflow: visible; /* Ensures no elements overflow the header */
    
    transform: scale(var(--scale-factor));
    transform-origin: top left;
}

/* Logo Styling */
header #logo {
    flex-shrink: 1; /* Allows the logo to shrink when space is limited */
    margin-left: -10px; /* Adjust as needed to shift left */
    overflow: hidden; /* Prevents text from spilling out */
    position: relative;
    z-index: 1;
}

header #logo a {
    font-family: 'Pirata One', cursive;
    font-size: 48px;
    color: #000000; /* Black text */
    text-decoration: none; /* Remove underline */
    white-space: nowrap; /* Prevent wrapping */
    transition: color 0.3s ease-in-out; /* Smooth transition for hover */
    text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.7); /* Subtle dark shadow */
}

header #logo a:hover {
    color: #FFCC00; /* Gold hover effect */
    font-size: 52px;
    text-shadow: 3px 3px 8px rgba(0, 0, 0, 0.9), 0px 0px 10px rgba(255, 204, 0, 0.8); /* Stronger shadow with gold glow */
}

/* Gradient Background Styling */
#gradient-background {
    background: linear-gradient(
        to right,
        #632E9B 0%, 
        #390042 calc(20% + 2vw), 
        #000000 calc(40% + 4vw), 
        #000000 100%
    );
    height: 100%; /* Matches the height of the header */
    position: absolute; /* Ensure it sits between the logo and menu */
    top: 0; /* Aligns it with the top of the header */
    left: 0; /* Starts at the left edge of the header */
    right: 0; /* Stretches to the right edge */
    z-index: 0; /* Sits behind logo and menu */
}

/* Navigation Menu */
header nav {
    height: 100%; /* Ensure nav takes up the full height of the header */
    display: flex;
    align-items: center;
    position: relative; /* Make it relative for pseudo-element positioning */
    z-index: 1; /* Ensure the content is above the background */
    background: rgba(255, 255, 255, 0.2); /* Optional semi-transparent fallback color */
    backdrop-filter: blur(8px); /* Glass-like blur effect */
    flex-shrink: 0; /* Prevent the menu from shrinking */
}

/* Pseudo-element for the background image */
header nav::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('/images/Menu/MenuBackground.png');
    background-size: cover; /* Make the image cover the entire area */
    background-position: center;
    opacity: 0.4; /* Adjust opacity of the image */
    z-index: -1; /* Place it behind the menu */
}

header nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex; /* Horizontal layout */
    height: 100%; /* Match the height of the header */
    border-top: 3px solid #000000; /* Black border on top */
    border-bottom: 3px solid #000000; /* Black border on bottom */
}

header nav ul li {
    margin: 0;
    display: flex;
    align-items: center; /* Vertically align the text */
    height: 100%; /* Ensure li fills the full height of the menu bar */
    position: relative;
}

header nav ul li:last-child {
    background-color: #000000;
    padding-right: 25px;
    padding-left: 2px;
}

/* Main Menu Items */
header nav > ul > li {
    margin: 0;
    border-left: 3px solid #000000; /* Black divider between main menu items */
    display: flex;
    align-items: center; /* Vertically align the text */
    height: 100%; /* Ensure li fills the full height of the menu bar */
    position: relative;
}

/* Main Menu Links */
header nav > ul > li > a {
    font-family: 'Cinzel', serif; /* Main menu font */
    font-size: 18px; /* Main menu font size */
    color: #FFFFFF; /* White text */
    text-decoration: none;
    padding: 0 25px; /* Horizontal padding for spacing */
    display: flex;
    align-items: center; /* Vertically align text inside menu items */
    height: 100%; /* Ensures links fill the menu bar */
    text-transform: uppercase; /* All caps for menu text */
    letter-spacing: 1px; /* Subtle spacing for clarity */
    font-weight: bold; /* Makes the text bold */
    justify-content: center; /* Center-align text in menu items */
    transition: background-color 0.3s ease-in-out, color 0.3s ease-in-out; /* Smooth transition for hover */
    text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.7); /* Add a dark shadow */
    text-align: center; /* Ensures text aligns properly within the button */
}



header nav ul li a:hover {
    background-color: rgba(0, 0, 0, 0.5); /* Low-opacity dark overlay */
    color: #FFFFFF; /* Ensure text stays white */
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.5); /* Add a subtle glow effect */
    transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease; /* Smooth transition */
}

header nav ul li a span {
    display: inline-block; /* Ensure the text can scale independently */
    transition: transform 0.3s ease; /* Add smooth scaling for text */
}

header nav ul li a:hover span {
    transform: scale(1.2); /* Slightly enlarge the text */
}











/* Sub-Menu (Dropdown) Container */
header nav ul.dropdown {
    height: auto; /* Ensure dropdown adjusts dynamically */
}

/* Sub-Menu Container */
header nav ul li ul.dropdown {
    position: absolute;
    top: 100%; /* Aligns directly below the parent menu */
    left: -3px;
    background-color: rgba(255, 255, 255, 0.5); /* Grey Background */
    padding: 0; /* No extra padding inside the container */
    margin: 0; /* No extra margin */
    list-style: none; /* No bullet points */
    display: none; /* Hidden by default */
    z-index: 1000; /* Keeps it above other content */
    width: auto; /* Adjust width automatically based on content */
    border: solid #000000; /* All sides */ 
    border-width: 3px 3px 3px 3px; /* Different widths */
}

/* Show Sub-Menu on Hover */
header nav ul li:hover ul.dropdown {
    display: block; /* Show dropdown on hover */
}

/* Sub-Menu (Dropdown) Items */
header nav ul li ul.dropdown li {
    padding: 0px; /* Minimal padding for cleaner look */
    margin: 0; /* No extra spacing */
    background: none; /* Clear unnecessary background */
    display: block; /* Stack dropdown items vertically */
    white-space: nowrap; /* Prevent text wrapping */
    transition: background-color 0.2s ease, color 0.2s ease; /* Smooth hover effects */
}

/* Dropdown Menu Links */
header nav ul li ul.dropdown li a {
    /* Font Styles */
    font-family: 'Merriweather', serif;
    font-size: 16px; /* Dropdown font size */
    font-weight: bold;
    color: rgba(0, 0, 0, 1); /* Black text for dropdown */
    text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.7); /* Add a dark shadow */
    text-decoration: none; /* Remove underline */

    /* Layout & Spacing */
    padding: 5px 10px; /* Compact padding for dropdown links */
    display: block; /* Ensure full-width clickable links */

    /* Transitions/Effects */
    transition: background-color 0.2s ease, color 0.2s ease;
}

/* Dropdown Menu Links Hover */
header nav ul li ul.dropdown li a:hover {
    background-color: rgba(255, 136, 0, 1); /* Orange Background */
    text-shadow: 3px 3px 8px rgba(0, 0, 0, 0.9), 0px 0px 5px rgba(255, 255, 255, 0.6); /* Darker shadow + subtle glow effect */
    font-size: 17px; /* Dropdown font size */
}










/* Sub-sub Menu Styling */
header nav ul.dropdown-secondary {
    background-color: transparent !important; /* Remove parent background */
    position: absolute;
    top: 0; /* Align with the parent item */
    left: 100%; /* Position to the right of the parent menu */
    display: none; /* Hidden by default */
    z-index: 1000; /* Ensure it appears above other elements */
    padding: 0;
    margin: 0;
    list-style: none; /* No bullet points */
    border-top: 3px solid #000000; /* All sides */ 
    border-bottom: 0px solid #000000; /* Black border on bottom */
}

/* Show Sub-sub Menu on Hover */
header nav ul li ul.dropdown li:hover > ul.dropdown-secondary {
    display: block; /* Make it visible on hover */
}

header nav ul li ul.dropdown-secondary li {
    background-color: rgba(255, 255, 255, 0.5); /* Grey Background */
    color: rgba(0, 0, 0, 1); /* Black text for consistency */
    transition: background-color 0.2s ease, color 0.2s ease;
    border: solid #000000; /* All sides */ 
    border-width: 0px 3px; /* Different widths */
}

header nav ul li ul.dropdown-secondary li a:hover {
    font-size: 16px; /* Dropdown font size */
}

header nav ul li ul.dropdown-secondary li:last-child {
    border-width: 0px 3px 3px 3px; /* Different widths */
}













/* Search Button Container */
#search-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%; /* Match menu height */
    border-left: 3px solid #000000; /* Match menu borders */
}

#search-button {
    background-color: transparent; /* Transparent background */
    border: none; /* No border */
    padding: 0; /* Remove extra padding */
    cursor: pointer; /* Make it clickable */
    display: flex; /* Flexbox for centering */
    align-items: center; /* Center vertically */
    justify-content: center; /* Center horizontally */
    width: 50px; /* Adjust width for consistency with icon */
    height: 100%; /* Match other menu items' height */
    font-family: 'Cinzel', serif; /* Consistent font style (optional, in case you add text later) */
    font-size: 18px; /* Optional text size, not needed if icon-only */
    letter-spacing: 1px; /* Subtle spacing for alignment */
    font-weight: bold; /* Match other menu items' weight */
    text-transform: uppercase; /* Keep consistent with menu */
    color: #FFFFFF; /* Match text/icon color */
    transition: transform 0.3s ease-in-out, background-color 0.3s ease-in-out; /* Smooth hover effects */
}

#search-button:hover {
    transform: scale(1.1); /* Slight zoom for hover effect */
    background-color: #390042; /* Slightly darker purple for hover */
}

/* Search Form Styling */
#search-form {
    display: none; /* Initially hidden */
    position: absolute;
    top: 60px; /* Adjust to match your header height */
    right: 0;
    background-color: #632E9B; /* Match header color */
    border: 3px solid #000000; /* Optional border for styling */
    padding: 10px;
    z-index: 9999;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.3); /* Adds a shadow for depth */
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease; /* Smooth transition */
    transform: translateY(-20px); /* Start position for slide-in effect */
}

#search-form input[type="text"] {
    font-family: 'Cinzel', serif;
    font-size: 14px;
    padding: 5px;
    border: 1px solid #000000;
    width: 200px;
    margin-right: 5px;
}

#search-form button {
    background-color: #390042;
    color: #FFFFFF;
    border: none;
    padding: 5px 10px;
    font-family: 'Cinzel', serif;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s ease-in-out;
}

#search-form button:hover {
    background-color: #FFCC00; /* Gold hover effect */
    color: #000000;
}

/* Show form when button is clicked */
#search-container.active #search-form {
    display: block;
    opacity: 1;
    transform: translateY(0); /* Slide into view */
}

#search-icon {
    width: 55px; /* Adjust as needed for size */
    height: 60px; /* Adjust as needed for size */
    display: block;
    margin: auto; /* Center the icon within the button */
}



/* Default state: 100% opacity */
header #logo a {
    opacity: 1;
    transition: opacity 0.2s ease-in-out; /* Smooth fade for subtle updates */
}

/* Optional: Hide it completely at 914px or below, if needed */
@media screen and (max-width: 914px) {
    header #logo a {
        opacity: 0;
    }
}