/* =========================================================================
   ULTRA-PREMIUM GLOBAL HEADER STYLES (Stripe/Linear/Vercel Aesthetic)
   ========================================================================= */

/* --- 1. CORE VARIABLES & SETUP --- */
:root {
  --uh-bg-color: rgba(255, 255, 255, 0.15); /* Fully transparent glass */
  --uh-bg-scrolled: rgba(255, 255, 255, 0.35); /* More transparent even on scroll */
  --uh-blur: 40px; /* Max blur for frosted glass */
  --uh-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15); /* Glassmorphism standard shadow */
  --uh-shadow-scrolled: 0 12px 40px 0 rgba(31, 38, 135, 0.25);
  --uh-border: 1px solid rgba(255, 255, 255, 0.4);
  --uh-border-scrolled: 1px solid rgba(255, 255, 255, 0.6);
  
  --uh-text: #1a1f36;
  --uh-text-muted: #1a1f36; /* Darkened for ultra visibility on glass */
  --uh-primary: #E88321; /* Switched to Yellow/Orange */
  --uh-primary-glow: rgba(232, 131, 33, 0.3);
  
  --uh-radius: 100px;
  --uh-transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  --uh-font: 'DM Sans', sans-serif;
}

/* Base resets */
#ultra-header-container * {
  box-sizing: border-box;
}

/* --- 1.5 TOPBAR STYLES --- */
.uh-topbar {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 38px;
  background-color: #E88321;
  color: white;
  font-family: var(--uh-font);
  font-size: 13px;
  z-index: 9998;
  display: flex;
  align-items: center;
}

.uh-topbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 100%;
  margin: 0 auto;
  padding: 0 15px;
}

.uh-topbar-left {
  display: flex;
  align-items: center;
  height: 100%;
}

.uh-topbar-link {
  display: flex;
  align-items: center;
  gap: 6px;
  color: white;
  text-decoration: none;
  padding-right: 15px;
  border-right: 1px solid rgba(255, 255, 255, 0.3);
  height: 100%;
  transition: color 0.2s;
}

.uh-topbar-link:hover {
  color: rgba(255, 255, 255, 0.8);
}

.uh-topbar-location {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 15px;
  border-right: 1px solid rgba(255, 255, 255, 0.3);
  height: 100%;
}

.uh-lang-dropdown {
  position: relative;
  display: flex;
  align-items: center;
  padding-left: 15px;
  height: 100%;
}

.uh-lang-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  color: white;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  padding: 0;
}

.uh-lang-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 15px;
  background: white;
  min-width: 140px;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
  list-style: none;
  padding: 8px 0;
  margin: 0;
  z-index: 10000;
  border: 1px solid #eee;
}

.uh-lang-menu li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  color: #333;
  text-decoration: none;
  transition: background 0.2s;
}

.uh-lang-menu li a:hover {
  background: rgba(0,0,0,0.05);
}

.uh-topbar-center {
  flex: 1;
  text-align: center;
  overflow: hidden;
  white-space: nowrap;
  font-weight: 500;
  padding: 0 20px;
}

.uh-topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 100%;
}

.uh-social-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.uh-social-links a {
  color: white;
  border: 1px solid rgba(255,255,255,0.6);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.uh-social-links a:hover {
  background: white;
  color: #E88321;
}

@media (max-width: 1024px) {
  .uh-topbar-center { display: none; }
}
@media (max-width: 768px) {
  .uh-topbar-location { display: none; }
  .uh-topbar-link { border-right: none; padding-right: 0; }
}
@media (max-width: 576px) {
  .uh-topbar-right { display: none; }
  .uh-topbar .container { justify-content: center; gap: 15px; }
}
@media (max-width: 420px) {
  .uh-topbar-link span { display: none; }
}
@media (max-width: 320px) {
  .uh-topbar { display: none; }
}

/* --- 2. HEADER CONTAINER (Floating & Sticky) --- */
.uh-wrapper {
  position: fixed;
  top: 54px; /* Account for 38px topbar + 16px gap */
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 1400px;
  z-index: 9999;
  transition: var(--uh-transition);
  animation: uh-fade-down 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 0;
}

.uh-wrapper.scrolled {
  top: 16px;
  width: calc(100% - 24px);
}

.uh-navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 0 12px 0 24px;
  background: var(--uh-bg-color);
  backdrop-filter: blur(var(--uh-blur));
  -webkit-backdrop-filter: blur(var(--uh-blur));
  border: var(--uh-border);
  border-radius: var(--uh-radius);
  box-shadow: var(--uh-shadow), inset 0 1px 0 rgba(255,255,255,0.5); /* extra highlight styling */
  transition: var(--uh-transition);
}

.uh-wrapper.scrolled .uh-navbar {
  height: 60px;
  background: var(--uh-bg-scrolled);
  box-shadow: var(--uh-shadow-scrolled);
  border: var(--uh-border-scrolled);
}

/* --- 3. LOGO --- */
.uh-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.uh-logo img {
  height: 32px;
  width: auto;
  transition: transform 0.3s ease;
}

.uh-logo:hover img {
  transform: scale(1.05);
}

/* --- 4. NAVIGATION LINKS --- */
.uh-nav-list {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.uh-nav-item {
  position: relative;
}

.uh-nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-family: var(--uh-font);
  font-size: 15px;
  font-weight: 600; /* Increased font weight */
  color: var(--uh-text-muted);
  text-decoration: none;
  border-radius: 100px;
  transition: var(--uh-transition);
  background: transparent;
}

.uh-nav-link svg {
  width: 14px;
  height: 14px;
  transition: transform 0.3s ease;
}

/* Hover effects for links */
.uh-nav-link:hover {
  color: var(--uh-text);
  background: rgba(0, 0, 0, 0.04);
}

.uh-nav-item:hover .uh-nav-link svg {
  transform: rotate(180deg);
}

/* --- 5. DROPDOWN MENUS --- */
.uh-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%) translateY(10px) scale(0.95);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 16px;
  padding: 12px;
  min-width: 260px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.12);
  opacity: 0;
  visibility: hidden;
  transition: var(--uh-transition);
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Dropdown columns for larger menus (Formation) */
.uh-dropdown.wide {
  min-width: 500px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
  padding: 20px;
}

.uh-dropdown::before {
  content: '';
  position: absolute;
  top: -12px;
  left: 0;
  width: 100%;
  height: 12px;
  background: transparent;
}

.uh-nav-item:hover .uh-dropdown,
.uh-nav-item.active .uh-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0) scale(1);
  pointer-events: auto;
}

.uh-dropdown-link {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  color: var(--uh-text-muted);
  font-family: var(--uh-font);
  font-size: 14px;
  font-weight: 600; /* Increased font weight */
  text-decoration: none;
  border-radius: 12px;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.uh-dropdown-link:hover {
  background: rgba(26, 115, 232, 0.06);
  color: var(--uh-primary);
  transform: translateX(4px);
}

/* --- 6. CTA BUTTON --- */
.uh-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 24px;
  background: linear-gradient(135deg, #F59E0B 0%, #E88321 100%);
  color: #fff;
  font-family: var(--uh-font);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  border-radius: 100px;
  box-shadow: 0 4px 14px var(--uh-primary-glow);
  transition: var(--uh-transition);
  white-space: nowrap;
}

.uh-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(232, 131, 33, 0.45);
  color: #fff;
}

/* --- 7. MOBILE HAMBURGER TOGGLE --- */
.uh-mobile-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 10001;
  transition: background 0.3s ease;
  position: relative;
}

.uh-mobile-toggle:hover {
  background: rgba(0, 0, 0, 0.04);
}

.uh-mobile-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--uh-text);
  margin: 2.5px 0;
  transition: var(--uh-transition);
  border-radius: 2px;
}

.uh-mobile-toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.uh-mobile-toggle.active span:nth-child(2) {
  opacity: 0;
}
.uh-mobile-toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* --- 8. MOBILE DRAWER OVERLAY --- */
.uh-mobile-drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100dvh;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  z-index: 9998; /* Lower than uh-wrapper (9999) so hamburger remains clickable */
  display: flex;
  flex-direction: column;
  padding: 100px 24px 40px;
  opacity: 0;
  visibility: hidden;
  clip-path: circle(0% at 90% 40px);
  transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
}

.uh-mobile-drawer.active {
  opacity: 1;
  visibility: visible;
  clip-path: circle(150% at 90% 40px);
}

/* Mobile Nav List */
.uh-mobile-nav {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 40px;
}

.uh-mobile-item {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.4s ease;
}

.uh-mobile-drawer.active .uh-mobile-item {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered animation delays for mobile items */
.uh-mobile-drawer.active .uh-mobile-item:nth-child(1) { transition-delay: 0.1s; }
.uh-mobile-drawer.active .uh-mobile-item:nth-child(2) { transition-delay: 0.15s; }
.uh-mobile-drawer.active .uh-mobile-item:nth-child(3) { transition-delay: 0.2s; }
.uh-mobile-drawer.active .uh-mobile-item:nth-child(4) { transition-delay: 0.25s; }
.uh-mobile-drawer.active .uh-mobile-item:nth-child(5) { transition-delay: 0.3s; }

.uh-mobile-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--uh-font);
  font-size: 20px;
  font-weight: 600;
  color: var(--uh-text);
  text-decoration: none;
  padding: 12px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.uh-mobile-link svg {
  transition: transform 0.3s ease;
}

.uh-mobile-link.active svg {
  transform: rotate(180deg);
}

.uh-mobile-dropdown {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
}

.uh-mobile-dropdown-inner {
  padding: 12px 0 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.uh-mobile-sublink {
  font-family: var(--uh-font);
  font-size: 16px;
  color: var(--uh-text-muted);
  text-decoration: none;
  display: block;
  transition: color 0.2s;
}

.uh-mobile-sublink:hover {
  color: var(--uh-primary);
}

.uh-mobile-drawer .uh-cta {
  width: 100%;
  margin-top: auto;
  height: 56px;
  font-size: 16px;
}

/* --- 9. KEYFRAMES --- */
@keyframes uh-fade-down {
  0% {
    opacity: 0;
    transform: translate(-50%, -20px);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

body.uh-locked {
  overflow: hidden;
}

/* --- 10. RESPONSIVE BREAKPOINTS --- */
@media (max-width: 1024px) {
  .uh-nav-list, .uh-navbar .uh-cta {
    display: none;
  }
  
  .uh-mobile-toggle {
    display: flex;
  }

  /* Two Circles Layout for Mobile Header */
  .uh-navbar {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    padding: 0 !important;
    height: auto !important;
  }
  
  .uh-wrapper.scrolled {
    width: calc(100% - 32px); /* keep full width for the container */
  }

  .uh-logo {
    background: var(--uh-bg-color);
    backdrop-filter: blur(var(--uh-blur));
    -webkit-backdrop-filter: blur(var(--uh-blur));
    border: var(--uh-border);
    box-shadow: var(--uh-shadow);
    padding: 10px 16px;
    border-radius: 100px;
  }

  .uh-mobile-toggle {
    background: var(--uh-bg-color);
    backdrop-filter: blur(var(--uh-blur));
    -webkit-backdrop-filter: blur(var(--uh-blur));
    border: var(--uh-border);
    box-shadow: var(--uh-shadow);
    width: 48px;
    height: 48px;
  }

  .uh-mobile-toggle:hover {
    background: rgba(255, 255, 255, 0.25);
  }
}
