/* ─────────────────────────────────────────────────────────────
   Magenda — design tokens + base resets for PWA mockups
   ───────────────────────────────────────────────────────────── */

/* Border-box everywhere — the styleguide sheet and any other non-.pwa-screen
   host need this too: .poster and friends declare width/height + padding. */
*, *::before, *::after { box-sizing: border-box; }

:root {
  /* Magenta scale (primary) */
  --magenta-50:  #fff0f6;
  --magenta-100: #ffd6e7;
  --magenta-200: #ffadce;
  --magenta-300: #ff7eb1;
  --magenta-400: #ff3d8a;
  --magenta-500: #e91e63;   /* primary */
  --magenta-600: #c2185b;
  --magenta-700: #9a1248;
  --magenta-800: #6b0a31;
  --magenta-900: #3d0419;

  /* Neutrals */
  --ink:        #0a0a0a;
  --ink-2:      #1a1a1a;
  --ink-3:      #404040;
  --ink-4:      #6b6b6b;  /* AA (4.5:1) on both --paper and --ink-8 */
  --ink-5:      #a3a3a3;
  --ink-6:      #d4d4d4;
  --ink-7:      #e5e5e5;
  --ink-8:      #f5f5f5;
  --paper:      #ffffff;

  /* Accents — Dice/RA-style category colors */
  --accent-rock:   #ff5722;
  --accent-jazz:   #1e88e5;
  --accent-arte:   #ffc107;
  --accent-tech:   #00bfa5;
  --accent-gastro: #8bc34a;
  --accent-cine:   #7c4dff;

  /* Type */
  --font-display: 'Bricolage Grotesque', 'Inter', system-ui, sans-serif;
  --font-body:    'Inter', system-ui, -apple-system, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, monospace;

  /* Radii */
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;
  --r-xl: 28px;
  --r-pill: 999px;

  /* Tint surface — semantic pair. Use these (NOT --magenta-50/-100) whenever a
     soft magenta panel carries text: selected rows, status badges, unread
     notifications, explainer cards. They flip with the theme; the raw magenta
     scale does not. */
  --tint:        var(--magenta-50);
  --tint-border: var(--magenta-100);
  --on-tint:     var(--magenta-700);

  /* Feedback — theme-aware so deltas and errors stay legible on both grounds */
  --success: #15803d;
  --danger:  #dc2626;

  /* Accessible magenta. --magenta-500 is the brand hue but only reaches 4.35:1
     against white, so it is for DECORATIVE fills (bars, dots, rings) only.
     Text and icons use --magenta-ink; filled CTAs carrying white text use
     --magenta-fill. Both clear AA at every size. */
  --magenta-ink:  var(--magenta-600);
  --magenta-fill: var(--magenta-600);
}

/* Dark mode tokens — applied via [data-theme="dark"] on .pwa-screen */
[data-theme="dark"] {
  --paper:  #0a0a0a;
  --ink:    #fafafa;
  --ink-2:  #f5f5f5;
  --ink-3:  #e5e5e5;
  --ink-4:  #a3a3a3;
  --ink-5:  #737373;
  --ink-6:  #404040;
  --ink-7:  #262626;
  --ink-8:  #171717;

  /* Tint surface inverts to a deep magenta so inverted ink stays legible.
     The raw magenta scale is brand colour and deliberately does NOT invert. */
  --tint:        #2e0c19;
  --tint-border: #45122a;
  --on-tint:     #ffadce;

  --success: #4ade80;
  --danger:  #f87171;

  --magenta-ink:  #ff7eb1;
  --magenta-fill: var(--magenta-600);
}

/* ── PWA screen frame (lives inside the 390×844 iPhone content area) */
.pwa-screen {
  width: 390px;
  height: 844px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.4;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  /* iOS safe area top (status bar handled by IOSDevice) */
  -webkit-font-smoothing: antialiased;
}

.pwa-screen button { font-family: inherit; cursor: pointer; }

/* Status bar pad — status bar drawn by frame on top */
.pwa-statusbar-pad { height: 54px; flex-shrink: 0; }

/* Top header (sticky) */
.pwa-header {
  padding: 8px 20px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--paper);
  flex-shrink: 0;
}

.pwa-logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 26px;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.pwa-logo b { color: var(--magenta-ink); }

.pwa-locality-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  background: var(--ink-8);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
}

.pwa-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--magenta-400), var(--magenta-700));
  border: 2px solid var(--paper);
  box-shadow: 0 0 0 2px var(--magenta-500);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
  overflow: hidden;
}

/* Body scroller */
.pwa-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
}
.pwa-body::-webkit-scrollbar { display: none; }

/* Bottom tab bar */
.pwa-tabbar {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 80px;
  padding: 8px 24px 24px;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--ink-7);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 10;
}

.pwa-tab {
  background: transparent;
  border: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 4px 14px;
  color: var(--ink-4);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.pwa-tab.active { color: var(--magenta-ink); }
.pwa-tab svg { width: 22px; height: 22px; }

/* Filter chips */
.pwa-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  border-radius: var(--r-pill);
  background: var(--ink-8);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  border: 0;
}
.pwa-chip.active {
  background: var(--ink);
  color: var(--paper);
}
.pwa-chip.magenta {
  background: var(--magenta-fill);
  color: white;
}

/* Buttons */
.pwa-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px;
  border-radius: var(--r-pill);
  font-weight: 700;
  font-size: 15px;
  border: 0;
  letter-spacing: -0.01em;
}
.pwa-btn.primary {
  background: var(--magenta-fill);
  color: white;
}
.pwa-btn.dark {
  background: var(--ink);
  color: var(--paper);
}
.pwa-btn.outline {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--ink-6);
}

/* Promoter avatar gradient (creator vibe) */
.creator-ring {
  padding: 2px;
  border-radius: 50%;
  background: conic-gradient(from 200deg, #ff3d8a, #e91e63, #c2185b, #ff5722, #ff3d8a);
  display: inline-block;
}
.creator-ring > * {
  border: 2px solid var(--paper);
  border-radius: 50%;
  display: block;
}

/* Image placeholder helpers — for typographic poster cards */
.poster {
  width: 100%;
  height: 100%;
  min-height: 0;
  aspect-ratio: 4/5;
  border-radius: var(--r-md);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 4px;
  padding: 16px;
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.04em;
  color: white;
  position: relative;
  overflow: hidden;
}
.poster.magenta { background: linear-gradient(160deg, #ff3d8a 0%, #c2185b 100%); }
.poster.ink     { background: linear-gradient(160deg, #1a1a1a 0%, #0a0a0a 100%); }
.poster.cream   { background: #f4ead5; color: #1a1a1a; }
.poster.purple  { background: linear-gradient(160deg, #7c4dff 0%, #4a1fad 100%); }
.poster.orange  { background: linear-gradient(160deg, #ff5722 0%, #c41e1e 100%); }

.poster .poster-meta {
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: .85;
}
.poster .poster-title {
  font-size: 28px;
  line-height: 0.95;
  text-wrap: balance;
  min-width: 0;
  overflow-wrap: anywhere;
  overflow: hidden;
}

/* Photo image placeholder — gradient + label */
.photo {
  width: 100%;
  aspect-ratio: 4/5;
  border-radius: var(--r-md);
  position: relative;
  overflow: hidden;
  background-position: center;
  background-size: cover;
}
.photo::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,0.55) 100%);
}

/* Card row */
.event-row {
  display: flex;
  gap: 14px;
  padding: 12px 0;
  align-items: stretch;
  border-bottom: 1px solid var(--ink-7);
}
.event-row:last-child { border-bottom: 0; }
.event-row .thumb {
  width: 92px;
  height: 116px;
  border-radius: var(--r-md);
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
}

/* Section title */
.section-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.03em;
  color: var(--ink);
  padding: 20px 20px 10px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.section-title .more {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  color: var(--magenta-ink);
}

/* Utility */
.hide-scrollbar { scrollbar-width: none; }
.hide-scrollbar::-webkit-scrollbar { display: none; }

.dot {
  width: 4px; height: 4px; border-radius: 50%; background: var(--ink-5);
  display: inline-block; vertical-align: middle; margin: 0 6px;
}

.tag-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 700;
  background: var(--ink-8);
  color: var(--ink-2);
  letter-spacing: 0.01em;
}

/* Map screen specifics */
.map-canvas {
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 20% 30%, #f5f5f5 0%, transparent 40%),
    radial-gradient(circle at 70% 60%, #e8e8e8 0%, transparent 50%),
    repeating-linear-gradient(45deg, #efeff0 0 1px, transparent 1px 18px),
    repeating-linear-gradient(-45deg, #efeff0 0 1px, transparent 1px 18px),
    #f3f3f0;
}
[data-theme="dark"] .map-canvas {
  background:
    radial-gradient(circle at 20% 30%, #1a1a1a 0%, transparent 40%),
    radial-gradient(circle at 70% 60%, #222 0%, transparent 50%),
    repeating-linear-gradient(45deg, #1f1f1f 0 1px, transparent 1px 18px),
    repeating-linear-gradient(-45deg, #1f1f1f 0 1px, transparent 1px 18px),
    #111;
}
.map-road {
  position: absolute; background: var(--ink-7); opacity: 0.7;
}
[data-theme="dark"] .map-road { background: var(--ink-6); opacity: 0.3; }

/* Form inputs */
.pwa-input {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--ink-7);
  background: var(--paper);
  color: var(--ink);
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  outline: none;
}
.pwa-input:focus { border-color: var(--magenta-ink); }
.pwa-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
  display: block;
}
