/* ═══════════════════════════════════════════════════════════════
   THEME.CSS — FAM & FRIENDS DESIGN SYSTEM
   Single source of truth for all design tokens.
   Imported by every page: trips.html, trip-detail.html, profiles, etc.
   
   COLOR CONVENTION:
   - Flamingo (#F2709C) = pre-trip / earlier / before
   - White (#F0EDE6) = during / current / now
   - Aqua (#4ECDC4) = post-trip / later / after
   - Gold (#C9A96E) = ONLY Michelin stars, hotel icons, star ratings
   
   LOGO: "Fam" (aqua) "&" (white) "Friends" (flamingo)
   ═══════════════════════════════════════════════════════════════ */

/* ─── Google Fonts ──────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;0,900;1,400&family=DM+Sans:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;700&display=swap');

/* ─── Root Variables ────────────────────────────────────────── */
:root {
  /* ── Backgrounds ─────────────────────────────────────────── */
  --bg-primary: #0C0F14;
  --bg-secondary: #13161D;
  --bg-card: rgba(255,255,255,0.03);
  --bg-card-hover: rgba(255,255,255,0.06);
  --bg-glass: rgba(255,255,255,0.04);
  --bg-glass-strong: rgba(255,255,255,0.08);

  /* ── Borders ─────────────────────────────────────────────── */
  --border: rgba(255,255,255,0.06);
  --border-hover: rgba(255,255,255,0.12);

  /* ── Text (warm white base #F0EDE6) ──────────────────────── */
  --text-primary: #F0EDE6;
  --text-secondary: rgba(240,237,230,0.55);
  --text-tertiary: rgba(240,237,230,0.3);
  /* Legacy aliases (used by trips.html) */
  --text-muted: rgba(240,237,230,0.3);

  /* ── Brand Colors ────────────────────────────────────────── */
  --brand-aqua: #4ECDC4;
  --brand-aqua-dim: rgba(78,205,196,0.15);
  --brand-aqua-glow: rgba(78,205,196,0.3);
  --brand-flamingo: #F2709C;
  --brand-flamingo-dim: rgba(242,112,156,0.15);
  --brand-flamingo-glow: rgba(242,112,156,0.3);
  --brand-purple: #8C32E6;
  --brand-purple-dim: rgba(140,50,230,0.15);
  --brand-purple-glow: rgba(140,50,230,0.3);
  /* Legacy aliases (used by trips.html) */
  --accent-aqua: #4ECDC4;
  --accent-flamingo: #F2709C;
  --accent-purple: #8C32E6;

  /* ── Accent Palette ──────────────────────────────────────── */
  --accent-gold: #C9A96E;
  --accent-gold-dim: rgba(201,169,110,0.15);
  --accent-coral: #E07A5F;
  --accent-teal: #5EAAA8;
  --accent-sky: #6EA8D7;
  --accent-lavender: #9B8EC4;
  --accent-rose: #D4728C;

  /* ── Status Colors ───────────────────────────────────────── */
  --success: #6ECB63;
  --warning: #F2C94C;
  --danger: #E05F5F;

  /* ── Typography ──────────────────────────────────────────── */
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', monospace;
  /* Legacy aliases */
  --font-ui: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;

  /* ── Typography Scale ────────────────────────────────────── */
  --text-xs: 11px;
  --text-sm: 13px;
  --text-base: 15px;
  --text-lg: 18px;
  --text-xl: 22px;
  --text-2xl: 28px;
  --text-3xl: 36px;
  --text-4xl: 48px;

  /* ── Spacing Scale ───────────────────────────────────────── */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 28px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* ── Border Radius Scale ─────────────────────────────────── */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-xl: 32px;
  --radius-2xl: 28px;
  --radius-full: 9999px;

  /* ── Shadows ─────────────────────────────────────────────── */
  --shadow-card: 0 4px 24px rgba(0,0,0,0.3), 0 1px 4px rgba(0,0,0,0.2);
  --shadow-elevated: 0 12px 48px rgba(0,0,0,0.5), 0 2px 8px rgba(0,0,0,0.3);
  --shadow-glow: 0 0 40px rgba(78,205,196,0.08);

  /* ── Transitions ─────────────────────────────────────────── */
  --transition: 0.3s cubic-bezier(0.4,0,0.2,1);
  --transition-fast: 0.15s ease;
  --transition-bounce: 0.5s cubic-bezier(0.34,1.56,0.64,1);
}

/* ─── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-tap-highlight-color: transparent; }

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ─── Selection ─────────────────────────────────────────────── */
::selection { background: var(--brand-flamingo-dim); color: var(--brand-flamingo); }

/* ─── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.18); }

/* ─── Ambient Background ───────────────────────────────────── */
.ambient-bg {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 800px 600px at 15% 20%, rgba(78,205,196,0.04) 0%, transparent 70%),
    radial-gradient(ellipse 600px 800px at 85% 80%, rgba(242,112,156,0.03) 0%, transparent 70%),
    radial-gradient(ellipse 900px 400px at 50% 50%, rgba(140,50,230,0.02) 0%, transparent 60%);
}

.noise-overlay {
  position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 128px 128px;
}

/* ─── Logo ──────────────────────────────────────────────────── */
.logo-fam { color: var(--brand-aqua); }
.logo-amp { color: var(--text-primary); }
.logo-friends { color: var(--brand-flamingo); }

/* ─── Glass Morphism ────────────────────────────────────────── */
.glass {
  background: var(--bg-glass);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

/* ─── Shared Button Styles ──────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 22px; border-radius: var(--radius-sm);
  font-family: var(--font-body); font-size: 13px; font-weight: 600;
  border: none; cursor: pointer; transition: var(--transition);
  letter-spacing: 0.3px; text-decoration: none; min-height: 44px;
}
.btn-primary {
  background: linear-gradient(135deg, var(--brand-aqua), var(--brand-flamingo));
  color: var(--bg-primary); box-shadow: 0 2px 12px rgba(78,205,196,0.25);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 20px rgba(242,112,156,0.3); }
.btn-ghost {
  background: var(--bg-glass); color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg-glass-strong); border-color: var(--border-hover); }
.btn-sm { padding: 6px 14px; font-size: 12px; min-height: 32px; }
.btn-icon {
  width: 36px; height: 36px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm); background: var(--bg-glass);
  border: 1px solid var(--border); color: var(--text-secondary);
  cursor: pointer; transition: var(--transition);
}
.btn-icon:hover { background: var(--bg-glass-strong); color: var(--text-primary); border-color: var(--border-hover); }

/* ─── Shared Form Styles ────────────────────────────────────── */
input, textarea, select {
  font-family: var(--font-body); font-size: 14px;
  background: rgba(255,255,255,0.04); color: var(--text-primary);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px 14px; outline: none; transition: var(--transition); width: 100%;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--brand-aqua); box-shadow: 0 0 0 3px var(--brand-aqua-dim);
}
input::placeholder, textarea::placeholder { color: var(--text-tertiary); }

/* ─── Badge ─────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 12px; border-radius: 100px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.5px; text-transform: uppercase;
}

/* ─── Toast Notification ────────────────────────────────────── */
.ff-toast {
  position: fixed; bottom: max(24px, env(safe-area-inset-bottom));
  left: 50%; transform: translateX(-50%);
  z-index: 9999; padding: 12px 24px; border-radius: 100px;
  background: var(--bg-secondary); border: 1px solid var(--border);
  box-shadow: var(--shadow-elevated);
  font-family: var(--font-body); font-size: 13px; font-weight: 500;
  color: var(--text-primary);
  display: flex; align-items: center; gap: 8px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.ff-toast.show {
  opacity: 1; pointer-events: auto;
  animation: toastIn 0.3s ease;
}
.ff-toast.toast-success { border-color: rgba(110,203,99,0.3); }
.ff-toast.toast-error { border-color: rgba(224,95,95,0.3); }
.ff-toast.toast-warning { border-color: rgba(242,201,76,0.3); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(12px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ─── Shared Animations ─────────────────────────────────────── */
.fade-up {
  opacity: 0; transform: translateY(20px);
  animation: fadeUp 0.6s ease forwards;
}
@keyframes fadeUp { to { opacity: 1; transform: translateY(0); } }

.stagger-1 { animation-delay: 0ms; }
.stagger-2 { animation-delay: 100ms; }
.stagger-3 { animation-delay: 200ms; }
.stagger-4 { animation-delay: 300ms; }
.stagger-5 { animation-delay: 400ms; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ─── Responsive Utilities ──────────────────────────────────── */
.container {
  max-width: 1100px; margin: 0 auto;
  padding: 0 var(--space-6); position: relative; z-index: 2;
}

@media (max-width: 768px) {
  .container { padding: 0 var(--space-4); }
  .hide-mobile { display: none !important; }
}

@media (max-width: 480px) {
  .hide-small { display: none !important; }
}
