/* ===================================
   Engadina Now - App Header & Menu Drawer
   =================================== */

/* ===== APP HEADER ===== */
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height, 56px);
  background: linear-gradient(135deg, rgba(26, 31, 40, 0.98) 0%, rgba(44, 62, 80, 0.95) 100%);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(212, 175, 55, 0.2);
  z-index: 200;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.header-content {
  max-width: 1280px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-lg);
}

/* Header Actions (right side buttons) */
.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

/* ===== LOGO ===== */
.header-logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.logo-icon {
  height: 50px;
  width: auto;
  object-fit: contain;
  border-radius: 8px;
}

.logo-text {
  font-family: var(--font-ui); /* P1.5-1: Manrope for branding */
  font-size: var(--text-large);
  font-weight: var(--weight-bold);
  background: linear-gradient(135deg, #D4AF37 0%, #F4C430 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 0.02em;
  text-shadow: 0 2px 8px rgba(212, 175, 55, 0.3);
}

/* ===== HEADER BUTTONS (help, alerts, menu) ===== */
.header-button {
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-sm);
  color: white;
  transition: all var(--duration-fast) var(--ease-smooth);
  border-radius: var(--radius-md);
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.header-button:hover {
  color: #D4AF37;
  background: rgba(212, 175, 55, 0.15);
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.3);
}

.header-button:active {
  transform: scale(0.95);
}

.header-button .button-icon {
  width: 24px;
  height: 24px;
}

/* Help button (?) */
.help-button {
  font-size: 20px;
  font-weight: var(--weight-bold);
}

/* Alert button with badge */
.alert-button {
  position: relative;
}

.alert-button.has-alerts {
  color: #FF8C00; /* Orange for active alerts */
}

.alert-button.has-alerts:hover {
  color: #FF6600;
}

.alert-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  background: #FF4500;
  border-radius: 50%;
  border: 2px solid white;
  animation: pulse-alert 2s ease-in-out infinite;
}

@keyframes pulse-alert {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.1);
  }
}

/* Legacy menu-button class (keep for compatibility) */
.menu-button {
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-sm);
  color: var(--text-secondary);
  transition: all var(--duration-fast) var(--ease-smooth);
  border-radius: var(--radius-md);
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.menu-button:hover {
  color: var(--lake-blue);
  background: var(--bg-overlay);
}

.menu-button:active {
  transform: scale(0.95);
}

.menu-icon {
  width: 24px;
  height: 24px;
}

/* ===== MENU DRAWER ===== */
.menu-drawer {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 300;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--duration-normal) var(--ease-smooth);
}

.menu-drawer.active {
  pointer-events: auto;
  opacity: 1;
}

/* Overlay */
.menu-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity var(--duration-normal) var(--ease-smooth);
}

.menu-drawer.active .menu-overlay {
  opacity: 1;
}

/* Menu Content */
.menu-content {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(320px, 85vw);
  background: var(--snow-white);
  box-shadow: -4px 0 20px rgba(76, 144, 164, 0.15);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform var(--duration-normal) cubic-bezier(0.4, 0, 0.2, 1);
}

.menu-drawer.active .menu-content {
  transform: translateX(0);
}

/* ===== MENU HEADER ===== */
.menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-xl) var(--space-lg);
  border-bottom: 1px solid var(--divider);
}

.menu-title {
  font-family: var(--font-ui); /* P1.5-1: Manrope for UI headings */
  font-size: var(--text-xlarge);
  font-weight: var(--weight-semibold);
  color: var(--forest-dark);
  margin: 0;
}

.menu-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-sm);
  color: var(--text-secondary);
  transition: all var(--duration-fast) var(--ease-smooth);
  border-radius: var(--radius-md);
  min-width: 40px;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.menu-close:hover {
  color: var(--lake-blue);
  background: var(--bg-overlay);
}

.menu-close:active {
  transform: scale(0.95);
}

/* ===== MENU NAVIGATION ===== */
.menu-nav {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-lg) 0;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  color: var(--text-primary);
  text-decoration: none;
  transition: all var(--duration-fast) var(--ease-smooth);
  font-size: var(--text-body);
  font-weight: var(--weight-medium);
  border-left: 3px solid transparent;
}

.menu-item:hover {
  background: var(--bg-overlay);
  border-left-color: var(--lake-blue);
  color: var(--forest-dark);
}

.menu-item:active {
  background: rgba(76, 144, 164, 0.1);
}

.menu-item-icon {
  width: 20px;
  height: 20px;
  stroke-width: 2;
  color: var(--stone-grey);
  transition: color var(--duration-fast) var(--ease-smooth);
}

.menu-item:hover .menu-item-icon {
  color: var(--lake-blue);
}

/* Featured menu item (Private Concierge) */
.menu-item-featured {
  background: linear-gradient(
    135deg,
    rgba(76, 144, 164, 0.08) 0%,
    rgba(76, 144, 164, 0.04) 100%
  );
  border-left-color: var(--lake-blue);
  margin: var(--space-md) 0;
}

.menu-item-featured:hover {
  background: linear-gradient(
    135deg,
    rgba(76, 144, 164, 0.15) 0%,
    rgba(76, 144, 164, 0.08) 100%
  );
}

/* ===== MENU FOOTER ===== */
.menu-footer {
  padding: var(--space-lg);
  border-top: 1px solid var(--divider);
  text-align: center;
}

.menu-version {
  font-size: var(--text-small);
  font-weight: var(--weight-semibold);
  color: var(--text-secondary);
  margin: 0 0 var(--space-xs) 0;
}

.menu-copyright {
  font-size: var(--text-xsmall);
  color: var(--text-tertiary);
  margin: 0;
}

/* ===== RESPONSIVE ADJUSTMENTS ===== */

/* Adjust app-container for fixed header */
.app-container {
  padding-top: var(--header-height, 56px);
}

/* Tablet (768px+) */
@media (min-width: 768px) {
  .app-header {
    height: 64px;
  }

  .header-content {
    padding: 0 var(--space-xl);
  }

  .logo-icon {
    height: 32px;
  }

  .logo-text {
    font-size: var(--text-xlarge);
  }

  .header-actions {
    gap: var(--space-sm);
  }

  .header-button {
    min-width: 48px;
    min-height: 48px;
  }
}

/* Desktop (1024px+) */
@media (min-width: 1024px) {
  .app-header {
    height: 72px;
  }

  .header-content {
    padding: 0 var(--space-2xl);
    max-width: 900px;
    margin: 0 auto;
  }

  .logo-icon {
    height: 36px;
  }

  .logo-text {
    font-size: 20px;
  }

  .header-actions {
    gap: var(--space-md);
  }

  .menu-content {
    width: 380px;
  }

  /* Desktop hover effects */
  .header-button {
    transition: all var(--duration-fast) var(--ease-smooth),
                transform var(--duration-fast) var(--ease-smooth);
  }

  .header-button:hover {
    transform: translateY(-2px);
  }

  .header-button:active {
    transform: scale(0.95);
  }
}

/* Large Desktop (1280px+) */
@media (min-width: 1280px) {
  .header-content {
    max-width: 1100px;
    margin: 0 auto;
  }
}

/* Extra Large Desktop (1440px+) */
@media (min-width: 1440px) {
  .header-content {
    max-width: 1280px;
    margin: 0 auto;
  }

  .menu-content {
    width: 420px;
  }
}

/* Small phones */
@media (max-width: 374px) {
  .logo-text {
    font-size: var(--text-body);
  }

  .logo-icon {
    height: 24px;
  }

  .menu-content {
    width: 90vw;
  }
}

/* Prevent body scroll when menu is open */
body.menu-open {
  overflow: hidden;
}

/* ===== Language Selector ===== */
.language-selector {
  display: flex;
  align-items: center;
  gap: 4px;
}

.language-option {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-smooth);
  text-decoration: none;
  color: var(--text-secondary);
  font-size: var(--text-small);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.7;
}

.language-option:hover {
  opacity: 1;
}

.language-option.active {
  color: var(--lake-blue);
  opacity: 1;
}

/* ===================================
   Premium Side Menu - Full Screen Design
   =================================== */

/* Side Menu Container */
.side-menu {
  position: fixed;
  inset: 0;
  background: var(--bg-dark-primary, #11201C);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 60px 40px 40px;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.side-menu.active {
  transform: translateX(0);
}

/* Close Button */
.side-menu-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: color 0.2s ease, transform 0.2s ease;
  border-radius: 50%;
}

.side-menu-close:hover {
  color: rgba(255, 255, 255, 1);
}

.side-menu-close:active {
  transform: scale(0.95);
}

.side-menu-close .material-symbols-outlined {
  font-size: 28px;
}

/* Logo */
.side-menu-logo {
  width: 140px;
  height: auto;
  margin-bottom: 48px;
  filter: brightness(0) invert(1);
  opacity: 0.95;
}

/* Primary Navigation */
.side-menu-nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 100%;
}

.side-menu-link {
  font-family: var(--font-ui, 'Plus Jakarta Sans', sans-serif);
  font-size: 1.25rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  letter-spacing: 0.01em;
  transition: color 0.2s ease, transform 0.2s ease;
  padding: 8px 16px;
}

.side-menu-link:hover {
  color: var(--brand-green, #11d473);
}

.side-menu-link:active {
  transform: scale(0.98);
}

/* Divider */
.side-menu-divider {
  width: 60px;
  height: 1px;
  background: rgba(255, 255, 255, 0.15);
  margin: 32px 0;
}

/* Secondary Navigation */
.side-menu-secondary {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
}

.side-menu-secondary-link {
  font-family: var(--font-ui, 'Plus Jakarta Sans', sans-serif);
  font-size: 0.9375rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.5);
  text-decoration: none;
  letter-spacing: 0.01em;
  transition: color 0.2s ease;
  padding: 6px 12px;
}

.side-menu-secondary-link:hover {
  color: rgba(255, 255, 255, 0.8);
}

/* Contact Section */
.side-menu-contact {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 32px;
}

.side-menu-contact-title {
  font-family: var(--font-ui, 'Plus Jakarta Sans', sans-serif);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: rgba(255, 255, 255, 0.4);
  margin-bottom: 8px;
}

.side-menu-contact-link {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  font-family: var(--font-ui, 'Plus Jakarta Sans', sans-serif);
  font-size: 0.875rem;
  transition: color 0.2s ease;
}

.side-menu-contact-link:hover {
  color: rgba(255, 255, 255, 1);
}

.contact-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* Language Selector */
.side-menu-languages {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: auto;
  padding-top: 40px;
}

.side-menu-lang {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 36px;
  padding: 0 14px;
  font-family: var(--font-ui, 'Plus Jakarta Sans', sans-serif);
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.5);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.side-menu-lang:hover {
  color: rgba(255, 255, 255, 0.8);
  border-color: rgba(255, 255, 255, 0.4);
}

.side-menu-lang.active {
  color: var(--bg-dark-primary, #11201C);
  background: var(--brand-green, #11d473);
  border-color: var(--brand-green, #11d473);
}

/* Version */
.side-menu-version {
  font-family: var(--font-ui, 'Plus Jakarta Sans', sans-serif);
  font-size: 0.75rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.3);
  margin-top: 24px;
  text-align: center;
}

/* Menu Overlay */
.side-menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

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

/* Prevent body scroll when menu is open */
body.side-menu-open {
  overflow: hidden;
}

/* Responsive adjustments */
@media (min-width: 768px) {
  .side-menu {
    padding: 80px 60px 60px;
  }

  .side-menu-logo {
    width: 160px;
    margin-bottom: 60px;
  }

  .side-menu-link {
    font-size: 1.5rem;
  }

  .side-menu-secondary-link {
    font-size: 1rem;
  }
}

@media (max-width: 374px) {
  .side-menu {
    padding: 50px 24px 32px;
  }

  .side-menu-logo {
    width: 120px;
    margin-bottom: 36px;
  }

  .side-menu-link {
    font-size: 1.125rem;
  }

  .side-menu-nav {
    gap: 16px;
  }

  .side-menu-divider {
    margin: 24px 0;
  }
}
