/*==================== HEADER ====================*/
.header {
    width: 90%; /* Make it floating */
    max-width: 1400px;
    background-color: rgba(10, 10, 10, 0.85); /* Deep black glass */
    backdrop-filter: blur(20px); /* Glass effect */
    -webkit-backdrop-filter: blur(20px);
    position: fixed;
    top: 1rem; /* Space from top */
    left: 0; 
    right: 0;
    margin: 0 auto; /* Center without transform to allow fixed children to be relative to viewport */
    z-index: 1000; /* Increased z-index for mobile visibility */
    transition: background-color .4s, border-color .4s, box-shadow .4s, opacity .4s;
    border-radius: 28px; /* Large rounded corners */
    border: 1px solid rgba(255, 255, 255, 0.06); /* Subtle border */
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

/* Transparent header during video showcase — visible on hover */
.header.vs-hidden {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.header.vs-hidden:hover {
    opacity: 1;
}

/* Hide header visual parts when menu is open */
.header.menu-expanded {
    background-color: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-color: transparent;
    box-shadow: none;
}

.header.menu-expanded .nav__logo,
.header.menu-expanded .nav__toggle {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.nav {
    height: var(--header-height);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-right: 1rem; /* Ensure space from the right edge */
}
  
.nav__logo {
    display: inline-flex;
    align-items: center;
    column-gap: .2rem;
    font-size: .5rem; /* Reduced from default/1rem to fit more items */
    font-weight: var(--font-medium);
    transition: .3s;
    color: var(--title-color);
    position: absolute; /* Changed (was fixed) to align with floating header */
    top: 50%; /* Vertically center */
    left: 2rem; /* Adjusted left position */
    transform: translateY(-50%); /* Vertically center */
    transform-origin: center left;
    transition: all 0.5s ease-in-out;
    z-index: var(--z-fixed); /* Ensure logo is above other elements */
    line-height: normal; /* Fix any line-height issues */
}
  
.nav__logo img{
    width: 55px;
    padding-top: 0;
    display: block;
}
  
/* Navigation for mobile devices */
@media screen and (max-width: 1400px) {
  .nav__menu {
    position: fixed;
    top: -1rem; /* Offset header top margin */
    right: -120%; /* Hidden offscreen */
    width: 100vw; /* Full viewport width */
    height: 100vh; /* Full viewport height */
    padding-top: 6rem; /* Space for items */
    transition: right .4s;
    z-index: 1005; /* Above header */
    display: flex;
    flex-direction: column;
    align-items: center; 
    box-shadow: none;
    background-color: var(--body-color); /* Restored Glass background */
    backdrop-filter: blur(24px); /* Blur effect */
    -webkit-backdrop-filter: blur(24px);
  }
}
  
.nav__list {
    display: flex;
    flex-direction: column;
    row-gap: 3rem;
    padding-top: 6rem;
    text-align: center;
    list-style-type: none; /* Remove bullet points */
    padding: 0; /* Remove default padding */
}
  
.nav__link {
    color: var(--title-color);
    font-weight: var(--font-medium);
    transition: color .3s;
    font-family: 'Poppins', sans-serif; /* Apply better font */
    text-decoration: none; /* Remove underline */
    font-size: var(--h3-font-size);
}
  
.nav__link:hover {
    color: var(--first-color);
}
  
.nav__close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 1.5rem;
    color: var(--title-color);
    cursor: pointer;
}
  
.nav__toggle {
    font-size: 1.5rem;
    color: var(--title-color);
    cursor: pointer;
    margin-left: auto;
    padding-right: 20px; /* Add this line */
}

.nav__logo img{
    width: 55px;
}
  
/* Show menu */
.show-menu {
    right: calc((100% - 100vw) / 2); /* Pulls right edge to screen edge */
}
  
/* Change background header */
.scroll-header {
    background-color: var(--body-color); /* Semi-transparent for glass effect */
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.scroll-header .nav__logo {
    top: 50%; /* Keep centered */
    left: 2rem;
    transform: translateY(-50%);
}

/* Nav Dropdown */
.nav__item.dropdown {
    position: relative;
    cursor: pointer;
    perspective: 1000px; /* For 3D transitions */
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 1rem); /* Slight gap */
    right: 0;
    
    /* Styles for "Cooler" Look */
    background: var(--container-color); /* Darker, sleek base */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    
    /* Animation Properties */
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* Bouncy spring effect */
    
    list-style: none;
    display: flex; /* Always flex, visibility handles hide/show */
    flex-direction: column;
    min-width: 150px;
    z-index: 1002;
}

/* Show State */
.nav__item.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.dropdown-menu::before {
    /* Little triangle pointer */
    content: '';
    position: absolute;
    top: -6px;
    right: 20px;
    width: 12px;
    height: 12px;
    background: inherit;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    border-left: 1px solid rgba(255, 255, 255, 0.15);
    transform: rotate(45deg);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
}

.dropdown-menu li {
    width: 100%;
}

.dropdown-menu li a {
    color: var(--title-color);
    text-decoration: none;
    font-size: 0.95rem;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 12px;
    transition: all 0.2s ease;
    font-weight: 500;
}

.dropdown-menu li a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--first-color);
    transform: translateX(5px);
}

/* Media Queries for Header */
@media screen and (max-width: 650px){
    header{
        padding: 0 5px; /* Reduce global padding if causing issues */
    }
    .header {
        padding: 0 1rem; /* Internal padding for the glass pill */
    }
    .nav {
        padding: 0 0.5rem; /* Ensure nav items aren't on the edge */
    }
    .nav__logo img {
        width: 45px;
    }
    .scroll-header .nav__logo {
        top: .25rem;
        left: 1rem;
    }
}

@media screen and (min-width: 1400px) {
    .nav {
      height: calc(var(--header-height) + 1.5rem);
      padding-left: 2rem; /* Restore spacing for relative logo */
      padding-left: 3rem; /* Space for logo */
      padding-right: 3rem; /* Space for right menu */
    }
    .nav__menu {
        margin-left: auto;
    }
    .nav__toggle, .nav__close {
      display: none;
    }
    .nav__list {
      flex-direction: row;
      column-gap: 3rem;
      padding-top: 0;
    }
  }

/* Disable Logo Animation Offset on Mobile (< 500px) */
/* Disable Logo Animation Offset on Mobile (< 500px) */
@media screen and (max-width: 560px) {
    .nav__logo, 
    .scroll-header .nav__logo {
        /* Force consistent position and scale in both states */
        top: 50% !important;
        left: 1rem !important;
        transform: translateY(-50%) scale(1) !important;
        transition: none !important; /* Kill any remaining drift */
    }
}
