/* ===================================
   Engadina Now - Design Tokens
   Premium Immersive Design Language
   Version: 2.0 (UI Switch)
   =================================== */

:root {
  /* ===== Core Brand Colors ===== */
  --brand-forest: #11201C;       /* Deep Forest - Primary dark */
  --brand-forest-alt: #102219;   /* Forest variant */
  --brand-green: #11d473;        /* Accent Green - CTA, interactive */
  --brand-gold: #e8ab30;         /* Gold - Concierge, Calendar */
  --brand-gold-soft: #C8A962;    /* Gold muted - Logo only */

  /* ===== Background Colors ===== */
  /* Dark Mode (Primary) */
  --bg-dark-primary: #11201C;    /* Main dark background */
  --bg-dark-secondary: #102219;  /* Card/elevated surfaces */
  --bg-dark-tertiary: #0f172a;   /* Deepest layer */

  /* Light Mode */
  --bg-light-primary: #F8F7F5;   /* Main light background */
  --bg-light-secondary: #F8F8F8; /* Card surfaces */
  --bg-light-tertiary: #f6f8f7;  /* Subtle variation */

  /* Glassmorphism */
  --bg-glass-dark: rgba(17, 32, 28, 0.80);
  --bg-glass-light: rgba(248, 247, 245, 0.92);
  --bg-blur-dark: rgba(16, 34, 25, 0.90);

  /* ===== Text Colors ===== */
  /* On Dark Background */
  --text-dark-primary: #F0F0F0;      /* Primary text on dark */
  --text-dark-secondary: rgba(255, 255, 255, 0.70);
  --text-dark-tertiary: rgba(255, 255, 255, 0.60);
  --text-dark-muted: rgba(255, 255, 255, 0.50);
  --text-dark-subtle: rgba(255, 255, 255, 0.40);

  /* On Light Background */
  --text-light-primary: #333333;     /* Primary text on light */
  --text-light-secondary: #64748b;
  --text-light-tertiary: #94a3b8;
  --text-light-muted: rgba(51, 51, 51, 0.65);

  /* ===== Status Colors - Muted, never screaming ===== */
  --status-ok: #52A675;          /* Verde bosco */
  --status-attention: #D4A574;   /* Ambra */
  --status-warning: #C67B70;     /* Terracotta */
  --status-info: #6B9AC4;        /* Azzurro ghiacciaio */

  /* ===== Borders ===== */
  --border-dark-subtle: rgba(255, 255, 255, 0.10);
  --border-dark-soft: rgba(255, 255, 255, 0.20);
  --border-dark-medium: rgba(255, 255, 255, 0.30);

  --border-light-subtle: rgba(51, 51, 51, 0.08);
  --border-light-soft: rgba(51, 51, 51, 0.12);
  --border-light-medium: rgba(51, 51, 51, 0.20);

  /* ===== Shadows ===== */
  /* Dark mode shadows */
  --shadow-dark-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-dark-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-dark-lg: 0 8px 24px rgba(0, 0, 0, 0.5);

  /* Light mode shadows */
  --shadow-light-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-light-md: 0 4px 12px rgba(15, 23, 42, 0.08);
  --shadow-light-lg: 0 8px 24px rgba(15, 23, 42, 0.12);

  /* Special effects */
  --shadow-halo: 0 0 10px rgba(255, 255, 255, 0.15);
  --shadow-glow-green: 0 0 20px rgba(17, 212, 115, 0.3);
  --shadow-text-light: 0 0 8px rgba(255, 255, 255, 0.5);
  --shadow-text-dark: 0 0 15px rgba(255, 255, 255, 0.2);

  /* ===== Gradients ===== */
  /* Card overlays */
  --gradient-card-overlay: linear-gradient(to top, rgba(0, 0, 0, 0.60), rgba(0, 0, 0, 0.20) 50%, transparent);
  --gradient-card-subtle: linear-gradient(to top, rgba(0, 0, 0, 0.50), rgba(0, 0, 0, 0.10) 50%, transparent);

  /* Header/Footer fades */
  --gradient-header-fade: linear-gradient(to bottom, rgba(0, 0, 0, 0.30), transparent);
  --gradient-footer-fade: linear-gradient(to top, var(--bg-dark-primary) 0%, rgba(17, 32, 28, 0.80) 50%, transparent 100%);

  /* Welcome screen */
  --gradient-welcome: linear-gradient(0deg, rgba(16, 34, 25, 0.5) 0%, rgba(16, 34, 25, 0.2) 50%, rgba(16, 34, 25, 0.5) 100%);

  /* Atmosfera (light mode) */
  --gradient-atmosfera: linear-gradient(180deg, #F8F7F5 0%, #F1F1F1 100%);

  /* ===== Typography ===== */
  /* Font Families */
  --font-ui: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Noto Serif', Georgia, 'Times New Roman', serif;
  --font-atmosfera: 'Manrope', system-ui, -apple-system, sans-serif;
  --font-mono: 'Roboto Mono', 'SF Mono', 'Monaco', monospace;

  /* Legacy fallback */
  --font-body: var(--font-ui);
  --font-family: var(--font-ui);

  /* Font Sizes */
  --text-xxs: 0.65rem;    /* 10.4px - Micro labels */
  --text-xs: 0.75rem;     /* 12px - Timestamps, tags */
  --text-sm: 0.875rem;    /* 14px - Secondary info */
  --text-base: 1rem;      /* 16px - Body text */
  --text-lg: 1.125rem;    /* 18px - Large body */
  --text-xl: 1.25rem;     /* 20px - Card titles */
  --text-2xl: 1.5rem;     /* 24px - Section headers */
  --text-3xl: 2rem;       /* 32px - Page titles */
  --text-4xl: 2.5rem;     /* 40px - Hero headlines */
  --text-5xl: 3rem;       /* 48px - Display */

  /* Font Weights */
  --weight-light: 300;
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;
  --weight-black: 800;

  /* Line Heights */
  --leading-none: 1;
  --leading-tight: 1.2;
  --leading-snug: 1.375;
  --leading-normal: 1.5;
  --leading-relaxed: 1.625;
  --leading-loose: 1.75;

  /* Letter Spacing */
  --tracking-tighter: -0.033em;
  --tracking-tight: -0.015em;
  --tracking-normal: 0;
  --tracking-wide: 0.015em;
  --tracking-wider: 0.05em;
  --tracking-widest: 0.1em;

  /* ===== Spacing Scale (4px base) ===== */
  --space-0: 0;
  --space-1: 0.25rem;   /* 4px */
  --space-2: 0.5rem;    /* 8px */
  --space-3: 0.75rem;   /* 12px */
  --space-4: 1rem;      /* 16px */
  --space-5: 1.25rem;   /* 20px */
  --space-6: 1.5rem;    /* 24px */
  --space-8: 2rem;      /* 32px */
  --space-10: 2.5rem;   /* 40px */
  --space-12: 3rem;     /* 48px */
  --space-16: 4rem;     /* 64px */
  --space-20: 5rem;     /* 80px */

  /* Component Spacing */
  --card-padding: 1rem;
  --card-padding-lg: 1.5rem;
  --section-gap: 1.5rem;
  --nav-height: 60px;

  /* ===== Border Radius ===== */
  --radius-none: 0;
  --radius-sm: 0.25rem;   /* 4px */
  --radius-md: 0.5rem;    /* 8px */
  --radius-lg: 0.75rem;   /* 12px */
  --radius-xl: 1rem;      /* 16px */
  --radius-2xl: 1.5rem;   /* 24px */
  --radius-full: 9999px;

  /* ===== Animation ===== */
  /* Durations */
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 350ms;
  --duration-slower: 500ms;

  /* Easing */
  --ease-linear: linear;
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);

  /* ===== Z-Index Scale ===== */
  --z-base: 0;
  --z-dropdown: 10;
  --z-sticky: 20;
  --z-fixed: 30;
  --z-modal-backdrop: 40;
  --z-modal: 50;
  --z-popover: 60;
  --z-tooltip: 70;

  /* ===== Icon Settings (Material Symbols) ===== */
  --icon-fill: 0;
  --icon-weight: 200;
  --icon-grade: 0;
  --icon-optical-size: 20;

  /* ===== Legacy Compatibility ===== */
  /* Old tokens mapped to new values */
  --sky-light: var(--bg-light-tertiary);
  --lake-blue: #4A90A4;
  --stone-grey: #8B9A9F;
  --snow-white: #FAFBFC;
  --forest-dark: var(--brand-forest);

  --bg-app: var(--bg-light-primary);
  --bg-card: var(--bg-light-secondary);
  --bg-card-hover: #FCFDFD;
  --bg-overlay: rgba(0, 0, 0, 0.02);

  --text-primary: var(--text-light-primary);
  --text-secondary: var(--text-light-secondary);
  --text-tertiary: var(--text-light-tertiary);
  --text-disabled: #D1D5DB;

  --border-light: var(--border-light-subtle);
  --border-medium: var(--border-light-soft);
  --divider: var(--border-light-subtle);

  --shadow-sm: var(--shadow-light-sm);
  --shadow-md: var(--shadow-light-md);
  --shadow-lg: var(--shadow-light-lg);
  --shadow-hover: 0 6px 20px rgba(15, 23, 42, 0.15);
}

/* ===== Dark Mode Overrides ===== */
.dark {
  --bg-app: var(--bg-dark-primary);
  --bg-card: var(--bg-dark-secondary);
  --bg-card-hover: var(--bg-dark-tertiary);

  --text-primary: var(--text-dark-primary);
  --text-secondary: var(--text-dark-secondary);
  --text-tertiary: var(--text-dark-tertiary);

  --border-light: var(--border-dark-subtle);
  --border-medium: var(--border-dark-soft);
  --divider: var(--border-dark-subtle);

  --shadow-sm: var(--shadow-dark-sm);
  --shadow-md: var(--shadow-dark-md);
  --shadow-lg: var(--shadow-dark-lg);
}

/* ===== Utility Classes ===== */

/* Glassmorphism panels */
.glass-panel {
  background: var(--bg-glass-dark);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.glass-panel-light {
  background: var(--bg-glass-light);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

/* Card with image overlay */
.card-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gradient-card-overlay);
  pointer-events: none;
}

/* Icon halo effect */
.icon-halo {
  box-shadow: var(--shadow-halo);
}

/* Text glow on dark */
.text-glow {
  text-shadow: var(--shadow-text-dark);
}

/* Material Symbols base config */
.material-symbols-outlined {
  font-variation-settings:
    'FILL' var(--icon-fill),
    'wght' var(--icon-weight),
    'GRAD' var(--icon-grade),
    'opsz' var(--icon-optical-size);
  font-size: 20px;
  line-height: 1;
}

/* Thin separator line */
.thin-separator {
  width: 100%;
  height: 1px;
  background-color: var(--border-light-subtle);
}

.dark .thin-separator {
  background-color: var(--border-dark-subtle);
}

/* ===== Premium UI Component Classes ===== */

/* Primary CTA Button */
.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 0 24px;
  background-color: var(--brand-green);
  color: var(--brand-forest);
  font-family: var(--font-ui);
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
  line-height: 1;
  letter-spacing: 0.015em;
  border: none;
  border-radius: var(--radius-xl);
  cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease-in-out),
              transform var(--duration-fast) var(--ease-in-out);
}

.btn-primary:hover {
  background-color: #0eb562;
}

.btn-primary:active {
  transform: scale(0.98);
}

/* Secondary/Outline Button */
.btn-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 0 24px;
  background-color: transparent;
  color: var(--text-dark-secondary);
  font-family: var(--font-ui);
  font-size: var(--text-base);
  font-weight: var(--weight-light);
  line-height: 1;
  letter-spacing: 0.015em;
  border: 1px solid var(--border-dark-soft);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease-in-out);
}

.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

/* Icon Button (circular) */
.btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 8px;
  background-color: transparent;
  color: var(--text-dark-primary);
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease-in-out);
}

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

.btn-icon.with-halo {
  box-shadow: var(--shadow-halo);
}

/* Top App Bar */
.top-bar {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-glass-dark);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.top-bar-title {
  flex: 1;
  text-align: center;
  font-family: var(--font-ui);
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  color: var(--text-dark-primary);
  letter-spacing: -0.015em;
}

.top-bar-subtitle {
  flex: 1;
  text-align: center;
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  font-weight: var(--weight-light);
  color: var(--text-dark-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Premium Card with Image */
.card-premium {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background-color: var(--bg-dark-secondary);
}

.card-premium-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.card-premium-overlay {
  position: absolute;
  inset: 0;
  background: var(--gradient-card-overlay);
  pointer-events: none;
}

.card-premium-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--space-4);
}

.card-premium-title {
  font-family: var(--font-ui);
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
  color: var(--text-dark-primary);
  line-height: var(--leading-tight);
}

.card-premium-action {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-dark-soft);
  border-radius: var(--radius-full);
  color: var(--text-dark-primary);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  box-shadow: var(--shadow-text-dark);
}

/* Mood Selection Card */
.mood-card {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: var(--radius-lg);
  cursor: pointer;
}

.mood-card-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: transform var(--duration-slow) var(--ease-in-out);
}

.mood-card:hover .mood-card-bg {
  transform: scale(1.05);
}

.mood-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.2) 50%, transparent);
  transition: background-color var(--duration-normal) var(--ease-in-out);
}

.mood-card:hover .mood-card-overlay {
  background: linear-gradient(to top, rgba(17, 212, 115, 0.3), rgba(17, 212, 115, 0.1) 50%, transparent);
}

.mood-card-label {
  position: absolute;
  bottom: var(--space-4);
  left: var(--space-4);
  width: 80%;
  font-family: var(--font-ui);
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
  color: var(--text-dark-primary);
  line-height: var(--leading-tight);
}

/* Section Header */
.section-header {
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-dark-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Chat Input (Concierge) */
.chat-input {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  height: 48px;
  padding: 0 var(--space-4);
  background: transparent;
  border: 1px solid var(--border-dark-medium);
  border-radius: var(--radius-full);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.chat-input input {
  flex: 1;
  height: 100%;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  font-weight: var(--weight-light);
  color: var(--text-dark-primary);
}

.chat-input input::placeholder {
  color: var(--text-dark-muted);
}

/* Chip / Tag */
.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0 var(--space-4);
  background: transparent;
  border: 1px solid var(--border-dark-medium);
  border-radius: var(--radius-full);
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  font-weight: var(--weight-light);
  color: var(--text-dark-primary);
  cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease-in-out);
}

.chip:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.chip.active {
  background-color: var(--brand-green);
  border-color: var(--brand-green);
  color: var(--brand-forest);
}

/* Page Indicator Dots */
.page-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
}

.page-dot {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background-color: var(--border-dark-soft);
  transition: background-color var(--duration-fast) var(--ease-in-out);
}

.page-dot.active {
  background-color: var(--brand-green);
}

/* Atmosfera Typography (E-ink style) */
.atmosfera-temp {
  font-family: var(--font-mono);
  font-size: var(--text-3xl);
  font-weight: var(--weight-light);
  letter-spacing: 0.05em;
  color: var(--text-light-primary);
}

.dark .atmosfera-temp {
  color: var(--text-dark-primary);
}

.atmosfera-condition {
  font-family: var(--font-atmosfera);
  font-size: var(--text-2xl);
  font-weight: var(--weight-light);
  letter-spacing: 0.02em;
  line-height: var(--leading-snug);
}

.atmosfera-detail {
  font-family: var(--font-atmosfera);
  font-size: var(--text-sm);
  font-weight: var(--weight-light);
  color: var(--text-light-muted);
}

.dark .atmosfera-detail {
  color: var(--text-dark-muted);
}

/* Concierge Display Typography */
.concierge-response {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: var(--weight-regular);
  line-height: var(--leading-snug);
  color: var(--text-dark-primary);
}

.concierge-prompt {
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  font-weight: var(--weight-light);
  color: var(--text-dark-muted);
}
