/* ===================================
   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(to bottom, rgba(20, 35, 50, 0.98) 0%, rgba(44, 95, 141, 0.95) 100%);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  z-index: 200;
  box-shadow: 0 2px 8px -1px rgba(0, 0, 0, 0.25);
}

.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: 28px;
  width: auto;
  object-fit: contain;
  border-radius: 6px;
}

.logo-text {
  font-size: var(--text-large);
  font-weight: var(--weight-semibold);
  color: #C8A962;
  letter-spacing: -0.01em;
}

/* ===== 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: #C8A962;
  background: rgba(255, 255, 255, 0.1);
}

.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-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;
}
