/* ============================================
   HEADER / NAVIGATION
   Glassmorphism design with smooth animations
   ============================================ */

/* ---------- MAIN NAVBAR ---------- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-fixed);

  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-2) var(--space-6);

  /* Transparent by default */
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom: 1px solid transparent;

  transition: background 0.3s ease, backdrop-filter 0.3s ease, border-bottom-color 0.3s ease, box-shadow 0.3s ease;
}

/* Scrolled state - add via JS */
.navbar.scrolled {
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow-md);
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

/* Hide navbar background when menu is open */
.navbar.menu-open,
.navbar.menu-open.scrolled {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
  border-bottom-color: transparent;
}

/* ---------- HAMBURGER MENU BUTTON ---------- */
.hamburger {
  height: 44px;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  transition: var(--transition-base);
  background: transparent;
  border: none;
}

/* Hamburger lines container */
.hamburger-lines {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  width: 24px;
}

.hamburger:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* ---------- CALENDAR ICON ---------- */
.calendar-icon {
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  transition: var(--transition-base);
}

.calendar-icon:hover {
  background: rgba(255, 255, 255, 0.1);
}

.calendar-icon img {
  width: 28px;
  height: 28px;
  filter: brightness(0) invert(1);
}

/* Legacy class support */
.calender-icon {
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  transition: var(--transition-base);
}

.calender-icon:hover {
  background: rgba(255, 255, 255, 0.1);
}

.calender-icon img {
  width: 28px;
  height: 28px;
  filter: brightness(0) invert(1);
}

/* ---------- NAV LABELS (Desktop only) ---------- */
.nav-label {
  font-family: var(--font-body);
  font-size: var(--text-small);
  font-weight: var(--weight-medium);
  color: var(--color-white);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  margin-left: var(--space-2);
  white-space: nowrap;
}

/* Hide nav labels on tablet and mobile */
@media (max-width: 1024px) {
  .nav-label {
    display: none;
  }
}

/* Header link wrapper */
.header-link-wrapper {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: var(--space-2);
}

/* Header logo */
.header-logo {
  width: 50px;
  height: 50px;
  margin: 0 var(--space-4);
}

.hamburger-lines .line,
.hamburger .line {
  display: block;
  height: 2px;
  width: 24px;
  background-color: var(--color-white);
  border-radius: var(--radius-full);
  transition: all 0.4s var(--ease-bounce);
  transform-origin: center;
}

/* Hamburger to X animation */
#hamburger-1.is-active .line:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

#hamburger-1.is-active .line:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

#hamburger-1.is-active .line:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* ---------- MOBILE MENU ---------- */
#mobile-menu {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: calc(var(--z-fixed) - 1);

  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: clamp(0.5rem, 2vh, var(--space-4));
  padding-top: clamp(60px, 10vh, 100px);
  padding-bottom: clamp(2rem, 8vh, var(--space-16));

  /* Glassmorphism */
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);

  /* Hidden state */
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s var(--ease-out), visibility 0.4s var(--ease-out);
}

#mobile-menu.show {
  opacity: 1;
  visibility: visible;
}

/* Mobile menu links */
#mobile-menu a {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 4vh, var(--text-h2));
  font-weight: var(--weight-black);
  color: var(--color-white);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  padding: clamp(0.5rem, 1.5vh, var(--space-4)) var(--space-8);

  /* Staggered animation setup */
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s var(--ease-out),
              transform 0.4s var(--ease-out),
              color var(--transition-fast);
}

#mobile-menu.show a {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered animation delays */
#mobile-menu.show a:nth-child(1) { transition-delay: 0.1s; }
#mobile-menu.show a:nth-child(2) { transition-delay: 0.15s; }
#mobile-menu.show a:nth-child(3) { transition-delay: 0.2s; }
#mobile-menu.show a:nth-child(4) { transition-delay: 0.25s; }
#mobile-menu.show a:nth-child(5) { transition-delay: 0.3s; }
#mobile-menu.show a:nth-child(6) { transition-delay: 0.35s; }
#mobile-menu.show a:nth-child(7) { transition-delay: 0.4s; }

#mobile-menu a:hover {
  color: var(--color-gray-400);
}

/* Decorative line under active/hover */
#mobile-menu a::after {
  content: '';
  display: block;
  width: 0;
  height: 2px;
  background: var(--color-white);
  margin-top: var(--space-2);
  transition: width 0.3s var(--ease-out);
}

#mobile-menu a:hover::after {
  width: 100%;
}

/* ---------- RESPONSIVE ---------- */

/* Tablet */
@media only screen and (max-width: 1024px) {
  .navbar {
    padding: var(--space-2) var(--space-5);
  }
}

/* Mobile */
@media only screen and (max-width: 640px) {
  .navbar {
    padding: var(--space-2) var(--space-4);
  }
}

/* ============================================
   FLOATING CLOWN NOSE
   Playful home button with scroll animation
   ============================================ */

.floating-nose {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: var(--z-fixed);

  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;

  background: transparent;
  border: none;
  border-radius: var(--radius-full);

  cursor: pointer;
  transition: transform 0.3s var(--ease-bounce),
              opacity 0.3s ease;
}

.floating-nose img {
  width: 40px;
  height: 40px;
  transition: transform 0.3s var(--ease-bounce);
}

.floating-nose:hover {
  transform: scale(1.1);
  opacity: 1;
}

.floating-nose:hover img {
  transform: rotate(-10deg);
}

.floating-nose:active {
  transform: scale(0.95);
}

/* Scroll-triggered bounce animation */
.floating-nose.bounce {
  animation: noseBounce 0.5s var(--ease-bounce);
}

@keyframes noseBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* Tablet */
@media (max-width: 1024px) {
  .floating-nose {
    width: 55px;
    height: 55px;
    bottom: var(--space-5);
    right: var(--space-5);
  }

  .floating-nose img {
    width: 36px;
    height: 36px;
  }
}

/* Mobile */
@media (max-width: 640px) {
  .floating-nose {
    width: 50px;
    height: 50px;
    bottom: var(--space-4);
    right: var(--space-4);
  }

  .floating-nose img {
    width: 32px;
    height: 32px;
  }
}

/* Small mobile */
@media (max-width: 400px) {
  .floating-nose {
    width: 46px;
    height: 46px;
    bottom: var(--space-3);
    right: var(--space-3);
  }

  .floating-nose img {
    width: 28px;
    height: 28px;
  }
}
