/* === HEADER STYLES === */
.site-header {
    background-color: rgba(255, 255, 255, 0.95); /* Semi-transparent white background */
    backdrop-filter: blur(20px); /* Apply the blur effect */
    -webkit-backdrop-filter: blur(20px); /* For Safari compatibility */
    border-bottom: 1px solid rgba(255, 255, 255, 0.3); /* Light border */
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1); /* Subtle shadow for depth */
    padding: 10px 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    overflow: hidden;
    height: 130px;
    display: flex;
    align-items: center;
    z-index: 1000;
    transition: all 0.3s ease-in-out;
}

/* Scrolled state - slightly more opaque and pronounced shadow */
.site-header.scrolled {
    background-color: rgba(255, 255, 255, 0.98); /* Slightly more opaque when scrolled */
    backdrop-filter: blur(25px); /* Increase blur slightly */
    -webkit-backdrop-filter: blur(25px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.5); /* Stronger border */
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.15); /* More pronounced shadow */
}

/* Body padding to account for fixed header */
body {
    padding-top: 130px; /* Same as header height */
}

.site-header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    display: flex;
    align-items: center;
    height: 150%;
    position: relative;
    z-index: 10;
}

.logo img {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%) scale(1.2);
    max-width: none;
    height: 90px;
    width: 90px;
    object-fit: contain;
    transition: opacity 0.3s ease;
}

/* Slightly fade logo when scrolled for better visibility on transparent background */
.site-header.scrolled .logo img {
    opacity: 1; /* Keep logo fully opaque for clarity */
}

/* --- Desktop Styles (for large screens) --- */
.header-main-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1.5rem;
    flex-grow: 1;
}

.search-form {
    display: flex;
    border: 1px solid rgba(255, 255, 255, 0.5); /* Glassmorphic border */
    border-radius: 25px;
    overflow: hidden;
    width: 100%;
    max-width: 450px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.7); /* Glassmorphic background */
    backdrop-filter: blur(10px); /* Add blur to search form */
}

/* Enhance search form visibility when scrolled */
.site-header.scrolled .search-form {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.search-form input {
    padding: 0.75rem 1rem;
    border: none;
    outline: none;
    width: 100%;
    background: transparent; /* Make input background transparent to inherit parent glass effect */
    color: #333; /* Ensure text is readable */
    transition: background-color 0.3s ease;
}

.search-form input::placeholder {
    color: #666; /* Adjust placeholder color */
}

.site-header.scrolled .search-form input {
    background: transparent; /* Keep transparent */
}

.search-form button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); /* Use gradient for consistency */
    color: white;
    border: none;
    padding: 0 1.25rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.site-header.scrolled .search-form button {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%); /* Slightly darker gradient on scroll */
}

.header-navigation {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    width: 100%;
    gap: 2rem;
}

nav.main-nav {
    display: flex;
    gap: 1.5rem;
}

nav.main-nav a {
    color: #333;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 0.5rem 0;
}

nav.main-nav a:hover {
    color: #667eea; /* Use primary color for hover */
}

/* Enhance nav links visibility when scrolled */
.site-header.scrolled nav.main-nav a {
    color: #333;
}

.site-header.scrolled nav.main-nav a:hover {
    color: #667eea;
}

.download-btn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%); /* Use green gradient */
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transform: translateX(20px);
    transition: all 0.3s ease-in-out;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3); /* Add shadow */
}

.download-btn.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

/* Enhance download button when scrolled */
.site-header.scrolled .download-btn.show {
    background: linear-gradient(135deg, #218838 0%, #1c9b74 100%); /* Slightly darker green gradient */
    box-shadow: 0 6px 16px rgba(40, 167, 69, 0.4);
}

.download-btn .download-count {
    background: rgba(255, 255, 255, 0.9); /* Glassmorphic count badge */
    color: #667eea; /* Use primary color for count */
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: bold;
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

/* --- Mobile-Specific Styles --- */

/* Hide the hamburger icon on desktop */
.mobile-menu-toggle {
    display: none;
}

/* The slide-down panel is hidden by default */
.mobile-nav-container {
    position: fixed;
    top: 130px;   
    left: 0;
    right: 0;
    z-index: 999;  
    background: rgba(255, 255, 255, 0.98); 
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-in-out;
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.mobile-nav-container.is-active {
    max-height: 600px;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
}

/* Enhance mobile nav when header is scrolled */
.site-header.scrolled .mobile-nav-container.is-active {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.5);
}

/* Styles for the content INSIDE the mobile panel */
.search-form-mobile {
    display: flex;
    margin: 1.5rem 1rem;
    background: rgba(255, 255, 255, 0.7); /* Glassmorphic search form */
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 25px;
    overflow: hidden;
}

.search-form-mobile input {
    width: 100%;
    padding: 0.8rem;
    border: none;
    outline: none;
    border-radius: 25px 0 0 25px;
    background: transparent;
    color: #333;
    transition: all 0.3s ease;
}

.search-form-mobile input::placeholder {
    color: #666;
}

.site-header.scrolled .search-form-mobile input {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.8);
}

.search-form-mobile button {
    padding: 0 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-left: none;
    border-radius: 0 25px 25px 0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.site-header.scrolled .search-form-mobile button {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}

nav.mobile-nav {
    display: flex;
    flex-direction: column;
}

nav.mobile-nav a {
    color: #333;
    text-decoration: none;
    font-size: 1.1rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3); /* Lighter divider */
    transition: all 0.3s ease;
}

nav.mobile-nav a:hover {
    background-color: rgba(102, 126, 234, 0.1); /* Light hover effect */
    color: #667eea;
}

.site-header.scrolled nav.mobile-nav a {
    color: #333;
    border-bottom-color: rgba(255, 255, 255, 0.5);
}

/* Hide mobile downloads link initially */
nav.mobile-nav a[href="/downloads"] {
    display: none;
    transition: all 0.3s ease-in-out;
}

nav.mobile-nav a[href="/downloads"].show {
    display: block;
}

/* --- The Breakpoint: This applies all rules inside it to smaller screens --- */
@media (max-width: 991px) {
    /* Adjust body padding for mobile */
    body {
        padding-top: 130px;
    }

    /* Hide the entire desktop navigation area */
    .header-main-right {
        display: none;
    }

    /* Show the hamburger menu button */
    .mobile-menu-toggle {
        display: block;
        background: none;
        border: none;
        font-size: 2.2rem;
        color: #667eea; /* Use primary color for icon */
        cursor: pointer;
        transition: color 0.3s ease;
    }

    .site-header.scrolled .mobile-menu-toggle {
        color: #667eea;
    }

    /* Reduce header height slightly on mobile when scrolled for better space utilization */
    .site-header.scrolled {
        height: 120px;
        padding: 8px 0;
    }
}

/* Ensure desktop elements are visible and mobile elements are hidden on large screens */
@media (min-width: 992px) {
    .header-main-right {
        display: flex !important; /* Force display on desktop */
    }

    .mobile-nav-container {
        display: none !important; /* Force hide mobile menu on desktop */
    }

    .mobile-menu-toggle {
        display: none !important; /* Force hide hamburger on desktop */
    }
}

/* Smoo

/* Smooth scroll behavior for the whole page */
html {
    scroll-behavior: smooth;
}