/* ===================================
   Engadina Now - Global Layout
   =================================== */

/* ===== Reset ===== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ===== Body ===== */
html, body {
  height: 100%;
  font-family: var(--font-body); /* P1.5-1: Inter for body text */
  font-size: var(--text-body);
  line-height: var(--leading-normal);
  color: var(--text-primary);
  background: var(--bg-app);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ===== App Container ===== */
.app-container {
  max-width: 100%;
  min-height: 100vh;
  padding-top: var(--header-height, 56px);
  padding-bottom: calc(var(--nav-height) + env(safe-area-inset-bottom));
}

/* ===== Section Structure ===== */
.section {
  padding: var(--space-xl) var(--space-lg);
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  display: none;
}

.section.active {
  display: block;
}

/* Home section has no top padding (hero handles it) */
.section-home {
  padding-top: 0;
}

/* ===== Premium Immersive Sections Override ===== */
/* These sections use full-screen immersive layouts and need to override default .section styles */

/* Home Premium - full viewport with no padding */
#home-view.section {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  padding: 0 !important;
  margin: 0 !important;
  max-width: none !important;
  z-index: 50 !important;
  overflow: hidden !important;
}

/* Attività/Discover Premium */
#events-view.section {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  padding: 0 !important;
  margin: 0 !important;
  max-width: none !important;
  z-index: 50 !important;
  overflow-y: auto !important;
  padding-bottom: calc(var(--nav-height) + env(safe-area-inset-bottom)) !important;
}

/* Agenda/Calendar Premium */
#agenda-view.section {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  padding: 0 !important;
  margin: 0 !important;
  max-width: none !important;
  z-index: 50 !important;
  overflow-y: auto !important;
  padding-bottom: calc(var(--nav-height) + env(safe-area-inset-bottom)) !important;
}

/* Vetrina Premium */
#vetrina-view.section {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  padding: 0 !important;
  margin: 0 !important;
  max-width: none !important;
  z-index: 50 !important;
  overflow-y: auto !important;
  padding-bottom: calc(var(--nav-height) + env(safe-area-inset-bottom)) !important;
}

/* Hide old header globally - Premium sections have their own headers */
.app-header {
  display: none !important;
}

/* App container - no top padding needed with Premium sections */
.app-container {
  padding-top: 0 !important;
}

/* Concierge section - full-width dark background with no padding */
#concierge-view.section {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  padding: 0 !important;
  margin: 0 !important;
  max-width: none !important;
  background: linear-gradient(180deg, #0a0e14 0%, #1a1f28 100%) !important;
  overflow-y: auto !important;
  z-index: 100 !important;
  padding-top: var(--header-height, 56px) !important;
  padding-bottom: calc(var(--nav-height) + env(safe-area-inset-bottom)) !important;
}

/* Desktop optimization for Concierge */
@media (min-width: 768px) {
  #concierge-view .concierge-container {
    max-width: 960px !important;
    padding: calc(var(--space-4xl) * 1.5) var(--space-2xl) var(--space-2xl) !important;
  }

  #concierge-view .scenarios-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: var(--space-xl) !important;
  }

  #concierge-view .scenario-card {
    min-height: 300px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
  }

  #concierge-view .scenario-card:hover {
    transform: translateY(-4px) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3) !important;
  }
}

@media (min-width: 1200px) {
  #concierge-view .concierge-container {
    max-width: 1200px !important;
    padding: calc(var(--space-4xl) * 2) var(--space-3xl) var(--space-2xl) !important;
  }

  #concierge-view .scenarios-grid {
    gap: var(--space-2xl) !important;
  }

  #concierge-view .scenario-card {
    min-height: 320px !important;
  }
}

.section-title {
  font-size: var(--text-large);
  font-weight: var(--weight-medium);
  color: var(--text-primary);
  margin-bottom: var(--space-xl);
  letter-spacing: var(--tracking-tight);
}

/* ===== Utility Classes ===== */
.text-center {
  text-align: center;
}

.text-muted {
  color: var(--text-secondary);
}

.text-tertiary {
  color: var(--text-tertiary);
}

/* Spacing utilities */
.mt-1 { margin-top: var(--space-sm); }
.mt-2 { margin-top: var(--space-md); }
.mt-3 { margin-top: var(--space-lg); }
.mb-1 { margin-bottom: var(--space-sm); }
.mb-2 { margin-bottom: var(--space-md); }
.mb-3 { margin-bottom: var(--space-lg); }

/* ===== Loading States ===== */
.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-4xl);
  color: var(--text-tertiary);
}

.loading-text {
  font-size: var(--text-small);
  margin-top: var(--space-md);
}

/* ===== Error States ===== */
.error-container {
  background: rgba(198, 123, 112, 0.05);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  text-align: center;
}

.error-icon {
  font-size: 48px;
  opacity: 0.6;
  margin-bottom: var(--space-md);
}

.error-text {
  font-size: var(--text-body);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
}

/* ===== Smooth Scrolling ===== */
html {
  scroll-behavior: smooth;
}

/* ===== Focus States for Accessibility ===== */
*:focus {
  outline: 2px solid var(--lake-blue);
  outline-offset: 2px;
}

*:focus:not(:focus-visible) {
  outline: none;
}

*:focus-visible {
  outline: 2px solid var(--lake-blue);
  outline-offset: 2px;
}
