/* ============================================================
   HEADER.CSS — Complete header styles with dark/light theme
   ============================================================
   Two states controlled by JS:
   • .header-dark  → transparent glass over dark hero (light logo, white text)
   • .scrolled     → solid white background (dark logo, dark text)
   ============================================================ */

/* ── Base header ── */
header {
    position: fixed;
    width: calc(100% - 40px);
    max-width: 1400px;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    border-radius: 16px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    /* Default: transparent until JS adds a class */
    background: transparent;
    border: 1px solid transparent;
    box-shadow: none;
}

@media (min-width: 1025px) {
    header {
        top: 30px;
        width: calc(100% - 60px);
    }
}

@supports not (backdrop-filter: blur(20px)) {
    header.scrolled {
        background: rgba(255, 255, 255, 0.98);
    }
    header.header-dark {
        background: rgba(0, 0, 0, 0.6);
    }
}

/* ── Logo switching ── */
.logo-dark {
    display: block;
}
.logo-light {
    display: none;
}

header.header-dark .logo-dark {
    display: none;
}
header.header-dark .logo-light {
    display: block;
}

header.scrolled .logo-dark {
    display: block;
}
header.scrolled .logo-light {
    display: none;
}

/* ════════════════════════════════════════════════
   DARK STATE — transparent over dark hero/video
   ════════════════════════════════════════════════ */
header.header-dark {
    background: transparent;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.15);
}

header.header-dark .nav-links a {
    color: rgba(255, 255, 255, 0.9);
}

header.header-dark .nav-links a:hover {
    color: #37b3e3;
}

header.header-dark .nav-links a::after {
    background: #37b3e3;
}

header.header-dark .btn-lang-switch {
    color: rgba(255, 255, 255, 0.88);
    border-color: rgba(255, 255, 255, 0.25);
}

header.header-dark .btn-lang-switch:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
    color: #37b3e3;
}

header.header-dark .btn-lang-switch:hover svg,
header.header-dark .btn-lang-switch:hover svg circle,
header.header-dark .btn-lang-switch:hover svg path {
    stroke: #37b3e3 !important;
    fill: none !important;
}

header.header-dark .btn-cta-nav {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

header.header-dark .btn-cta-nav:hover {
    background: rgba(255, 255, 255, 0.22);
    color: #37b3e3 !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

header.header-dark .dropdown-arrow {
    color: rgba(255, 255, 255, 0.9);
}

header.header-dark .dropdown-menu {
    background: rgba(30, 30, 30, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

header.header-dark .dropdown-menu li a {
    color: rgba(255, 255, 255, 0.8) !important;
}

header.header-dark .dropdown-menu li a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #37b3e3 !important;
}

header.header-dark .mobile-menu-btn span {
    background: #fff;
}

/* ════════════════════════════════════════════════
   SCROLLED STATE — solid light background
   ════════════════════════════════════════════════ */
header.scrolled {
    background: transparent;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.12);
}

header.scrolled .nav-links a {
    color: #1d1d1d;
}

header.scrolled .nav-links a:hover {
    color: #37b3e3;
}

header.scrolled .nav-links a::after {
    background: #37b3e3;
}

header.scrolled .btn-lang-switch {
    color: #1d1d1d;
    border-color: rgba(29, 29, 29, 0.2);
}

header.scrolled .btn-lang-switch:hover {
    background: #1d1d1d;
    border-color: #1d1d1d;
    color: #37b3e3;
}

header.scrolled .btn-lang-switch:hover svg,
header.scrolled .btn-lang-switch:hover svg circle,
header.scrolled .btn-lang-switch:hover svg path {
    stroke: #37b3e3 !important;
    fill: none !important;
}

header.scrolled .btn-cta-nav {
    background: #1D1D1D;
    color: white !important;
    border: none;
    box-shadow: 0 4px 15px rgba(29, 29, 29, 0.2);
}

header.scrolled .btn-cta-nav:hover {
    background: #1D1D1D;
    color: #37b3e3 !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(29, 29, 29, 0.3);
}

header.scrolled .dropdown-menu {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

header.scrolled .dropdown-menu li a {
    color: #1d1d1d !important;
}

header.scrolled .dropdown-menu li a:hover {
    background: #1d1d1d;
    color: #fff !important;
}

header.scrolled .mobile-menu-btn span {
    background: #1d1d1d;
}

/* ══════════════════════════════════════
   SHARED NAV STRUCTURE
   ══════════════════════════════════════ */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
}

@media (min-width: 768px) {
    nav {
        padding: 14px 24px;
    }
}

.logo {
    display: flex;
    align-items: center;
    animation: fadeInDown 0.8s ease-out;
    position: relative;
    z-index: 1001;
}

.logo img {
    height: 36px;
    width: auto;
}

@media (min-width: 768px) {
    .logo img {
        height: 40px;
    }
}

.nav-links {
    display: flex;
    gap: 45px;
    list-style: none;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    font-weight: 500;
    font-size: 16px;
    position: relative;
    transition: color 0.3s ease;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    right: 0;
    width: 0;
    height: 2px;
    transition: width 0.3s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

/* ── CTA Button ── */
.btn-cta-nav {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
}

.btn-cta-nav::after {
    display: none !important;
}

/* ── Language Switch ── */
.btn-lang-switch {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border-radius: 50%;
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1.5px solid;
}

.btn-lang-switch svg {
    width: 20px;
    height: 20px;
    transition: all 0.3s ease;
}

.btn-lang-switch::after {
    display: none !important;
}

/* ── Dropdowns ── */
.nav-item {
    position: relative;
}

.nav-item > a {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-item .dropdown-arrow {
    width: 12px;
    height: 12px;
    transition: transform 0.3s ease;
}

.nav-item:hover .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    min-width: 180px;
    border-radius: 12px;
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.3s ease;
    z-index: 1002;
    list-style: none;
}

[dir="ltr"] .dropdown-menu {
    right: auto;
    left: 0;
}

.nav-item:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li a {
    display: block;
    padding: 10px 16px;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    border-radius: 8px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.dropdown-menu li a::after {
    display: none !important;
}

/* ══════════════════════════════════════
   MOBILE MENU BUTTON
   ══════════════════════════════════════ */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    z-index: 1001;
    position: relative;
}

.mobile-menu-btn span {
    width: 28px;
    height: 3px;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.mobile-menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* ══════════════════════════════════════
   MOBILE MENU PANEL
   ══════════════════════════════════════ */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    box-shadow: -5px 0 32px rgba(0, 0, 0, 0.1);
    padding: 100px 30px 30px;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
    overflow-y: auto;
}

@supports not (backdrop-filter: blur(40px)) {
    .mobile-menu {
        background: rgba(255, 255, 255, 0.98);
    }
}

.mobile-menu.active {
    right: 0;
}

.mobile-menu ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mobile-menu ul li a {
    display: block;
    padding: 15px 20px;
    color: #1d1d1d;
    text-decoration: none;
    font-weight: 500;
    font-size: 16px;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.mobile-menu ul li a:hover,
.mobile-menu ul li a:active {
    background: #1d1d1d;
    color: white;
}

/* ── Mobile CTA ── */
.mobile-cta-btn {
    display: block;
    padding: 15px 20px;
    background: #1d1d1d;
    color: #fff !important;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    border-radius: 12px;
    text-align: center;
    transition: all 0.3s ease;
}

.mobile-cta-btn:hover {
    background: #333;
    color: #37b3e3 !important;
}

/* ── Mobile Language ── */
.mobile-lang-wrap {
    display: flex;
    justify-content: center;
    padding: 20px 0;
}

.mobile-lang-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1.5px solid rgba(29, 29, 29, 0.2);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.mobile-lang-btn:hover {
    background: #1d1d1d;
    border-color: #1d1d1d;
}

.mobile-lang-btn:hover svg circle,
.mobile-lang-btn:hover svg path {
    stroke: #37b3e3 !important;
}

/* ── Mobile Menu Footer ── */
.mobile-menu-footer {
    padding: 20px 0 10px;
    display: flex;
    justify-content: center;
}

.mobile-menu-logo img {
    height: 28px;
    width: auto;
    opacity: 0.5;
}

/* ── Mobile Overlay ── */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 998;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ── Mobile Submenus ── */
.mobile-submenu {
    list-style: none;
    padding: 0 0 0 20px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

[dir="rtl"] .mobile-submenu {
    padding: 0 20px 0 0;
}

.mobile-submenu.open {
    max-height: 300px;
}

.mobile-submenu li a {
    padding: 10px 20px !important;
    font-size: 14px !important;
    color: #666 !important;
}

.mobile-submenu li a:hover {
    color: #fff !important;
}

.mobile-parent-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: none;
    border: none;
    padding: 15px 20px;
    color: #1d1d1d;
    font-weight: 500;
    font-size: 16px;
    font-family: inherit;
    cursor: pointer;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.mobile-parent-toggle:hover {
    background: #1d1d1d;
    color: white;
}

.mobile-parent-toggle svg {
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
}

.mobile-parent-toggle.open svg {
    transform: rotate(180deg);
}

/* ══════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════ */
@media (max-width: 1024px) {
    .nav-links {
        display: none;
    }
    .mobile-menu-btn {
        display: flex;
    }
}

@media (min-width: 1025px) {
    .mobile-menu,
    .mobile-menu-overlay,
    .mobile-menu-btn {
        display: none !important;
    }
}

/* ── Keyframes ── */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
