/* ============================================================
   HOMEPAGE REDESIGN — Design System + Layout
   All classes prefixed hp- to avoid collisions with styles.css
   ============================================================ */

/* ── Design Tokens ─────────────────────────────────────── */
:root {
  /* 8px spacing scale */
  --hp-space-1: 8px;
  --hp-space-2: 16px;
  --hp-space-3: 24px;
  --hp-space-4: 32px;
  --hp-space-5: 40px;
  --hp-space-6: 48px;

  /* Typography */
  --hp-font-h1: 28px;
  --hp-font-h2: 20px;
  --hp-font-title: 16px;
  --hp-font-meta: 13px;

  /* Color roles */
  --hp-live: #FF2D55;
  --hp-live-bg: rgba(255, 45, 85, 0.12);
  --hp-trending: #FF9F0A;
  --hp-trending-bg: rgba(255, 159, 10, 0.12);
  --hp-soon: #FFD60A;
  --hp-soon-bg: rgba(255, 214, 10, 0.12);
  --hp-social: #BF5AF2;

  /* Card */
  --hp-card-radius: 14px;
  --hp-card-radius-lg: 16px;
  --hp-card-gap: 12px;

  /* Section */
  --hp-section-pad: var(--hp-space-4) var(--hp-space-2);
  --hp-max-width: 1200px;
}

/* ── Page container ─────────────────────────────────────── */
/* margin-top is set dynamically by JS (_measureHero) to match fixed hero height */
.hp-page {
  max-width: var(--hp-max-width);
  margin-top: var(--hp-hero-h, 160px); /* JS overrides this after measuring */
  margin-left: auto;
  margin-right: auto;
  padding-bottom: 72px; /* clearance for bottom nav */
  transition: margin-top 0.3s ease; /* syncs with hero padding transition */
}


/* ── Section base ───────────────────────────────────────── */
.hp-section {
  padding: var(--hp-section-pad);
}

.hp-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--hp-space-2);
}

.hp-section-title {
  font-size: var(--hp-font-h2);
  font-weight: 600;
  line-height: 1.2;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.hp-section-link {
  font-size: var(--hp-font-meta);
  color: var(--accent-color, #7c3aed);
  text-decoration: none;
  white-space: nowrap;
  opacity: 0.8;
}
.hp-section-link:hover { opacity: 1; text-decoration: underline; }

/* ── HERO — fixed header (out of flow → no layout shift on compact toggle) ── */
.hp-hero {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 800;
  padding: var(--hp-space-3) var(--hp-space-2) var(--hp-space-3);
  /* Liquid glass */
  background: linear-gradient(135deg,
    rgba(26, 26, 46, 0.82) 0%,
    rgba(15, 15, 26, 0.90) 100%);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0 0 22px 22px;
  box-shadow:
    0 4px 32px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.10),
    inset 0 -1px 0 rgba(0, 0, 0, 0.20);
  /* Smooth shrink transitions */
  transition: padding 0.3s ease;
}

/* Compact state — triggered on scroll by ui.js */
.hp-hero--compact {
  padding: 10px var(--hp-space-2) 10px;
  border-radius: 0 0 14px 14px;
}

.hp-hero-headline {
  font-size: var(--hp-font-h1);
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 4px 0;
  color: var(--text-primary, #fff);
  transition: font-size 0.3s ease, margin 0.3s ease;
}
.hp-hero--compact .hp-hero-headline {
  font-size: 18px;
  margin-bottom: 0;
}

/* Brand accent — "en ville" / "In Da City" colored */
.hp-hero-headline .hp-brand-accent {
  color: var(--accent-color, #FF5C35);
}

.hp-hero-sub {
  font-size: 14px;
  opacity: 0.7;
  margin: 0 0 4px 0;
  color: var(--text-secondary, #ccc);
  transition: opacity 0.2s ease, max-height 0.3s ease;
  overflow: hidden;
}
.hp-hero--compact .hp-hero-sub {
  opacity: 0;
  max-height: 0;
  margin: 0;
}

/* Desktop: right-pad clears the fixed GUW pill (lang + bell + avatar ≈ 170px) */
@media (min-width: 769px) {
  .hp-hero {
    padding-right: 190px;
  }
}

/* ── HERO SEARCH BAR ──────────────────────────────────────── */
.hp-hero-search {
  margin-top: 10px;
  position: relative;
  transition: margin 0.2s ease;
}

/* Dropdown anchored below the input */
.hp-hero-search .global-search-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 900;
}

/* Compact: searchbar shrinks (stays visible) */
.hp-hero--compact .hp-hero-search {
  margin-top: 6px;
}
.hp-hero--compact .hp-hero-search .ev-search-input {
  padding-top: 7px;
  padding-bottom: 7px;
  font-size: 13px;
}

/* ── LIVE TICKER (inside hero, bottom) ───────────────────── */
.hp-ticker {
  margin-top: 10px;
  height: 28px;
  overflow: hidden;
  background: var(--primary-color, #FF5C35);
  border-radius: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  padding-top: 4px;
  /* Fixed height so hero measurement stays stable */
}

.hp-ticker-track {
  display: flex;
  gap: 48px;
  white-space: nowrap;
  animation: hp-ticker-scroll 22s linear infinite;
}

@keyframes hp-ticker-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

.hp-ticker-item {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.90);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.hp-ticker-item i { color: rgba(255, 255, 255, 0.80); font-size: 11px; }
.hp-ticker-item .live-dot { width: 7px; height: 7px; }
.hp-ticker-item strong { color: #fff; }

.hp-ticker-pulse {
  color: rgba(255, 255, 255, 0.90);
  font-size: 11px;
}
.hp-ticker-pulse i { color: rgba(255, 255, 255, 0.90); }

/* Compact: ticker stays visible */
.hp-ticker {
  transition: opacity 0.2s ease, height 0.3s ease, margin 0.3s ease, padding 0.3s ease;
}

/* ── BADGES ─────────────────────────────────────────────── */
.hp-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.hp-badge-live {
  background: var(--hp-live-bg);
  color: var(--hp-live);
}
.hp-badge-live::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--hp-live);
  animation: hp-pulse 1.4s ease-in-out infinite;
}

.hp-badge-soon {
  background: var(--hp-soon-bg);
  color: #c8a400;
}

.hp-badge-trending {
  background: var(--hp-trending-bg);
  color: var(--hp-trending);
}

.hp-badge-rank {
  background: rgba(255,255,255,0.08);
  color: var(--text-primary, #fff);
  font-size: 14px;
  font-weight: 800;
  min-width: 28px;
  justify-content: center;
}

.hp-badge-featured {
  background: linear-gradient(135deg, rgba(255,214,10,0.2), rgba(255,159,10,0.15));
  border: 1px solid rgba(255,214,10,0.45);
  color: #FFD60A;
}

@keyframes hp-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

/* ── POPULARITY PULSE (scales with RSVP count) ───────────── */
/* --ev-pulse-intensity: 0.0–1.0 set inline on each card */
.hp-card[style*="--ev-pulse-intensity"],
.hp-card-large[style*="--ev-pulse-intensity"],
.hp-scroll-card[style*="--ev-pulse-intensity"] {
  animation: hp-card-glow calc(2.5s - calc(var(--ev-pulse-intensity, 0) * 1.2s)) ease-in-out infinite;
}

@keyframes hp-card-glow {
  0%, 100% {
    box-shadow: 0 0 0 rgba(255, 92, 53, 0);
  }
  50% {
    box-shadow: 0 0 calc(8px + calc(var(--ev-pulse-intensity, 0) * 16px))
                rgba(255, 92, 53, calc(0.1 + calc(var(--ev-pulse-intensity, 0) * 0.3)));
  }
}

/* ── EVENT CARDS ─────────────────────────────────────────── */

/* Large card (top events #1 #2 #3) */
.hp-card-large {
  background: linear-gradient(135deg, rgba(255,255,255,0.07) 0%, rgba(255,255,255,0.03) 100%);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border-radius: var(--hp-card-radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.11);
  box-shadow: 0 4px 20px rgba(0,0,0,0.25), inset 0 1px 0 rgba(255,255,255,0.08);
  padding: var(--hp-space-2);
  margin-bottom: var(--hp-card-gap);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 140px;
  position: relative;
  overflow: hidden;
}
.hp-card-large:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.hp-card-large .hp-card-cover {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.18;
  border-radius: var(--hp-card-radius-lg);
}
.hp-card-large .hp-card-body {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: 100%;
}
.hp-card-large .hp-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
}
.hp-card-large .hp-card-title {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.3;
  margin: 0;
  color: var(--text-primary, #fff);
  flex: 1;
}
.hp-card-large .hp-card-meta {
  font-size: var(--hp-font-meta);
  color: var(--text-secondary, #aaa);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.hp-card-large .hp-card-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Standard card (live now, starting soon) */
.hp-card {
  background: linear-gradient(135deg, rgba(255,255,255,0.07) 0%, rgba(255,255,255,0.03) 100%);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border-radius: var(--hp-card-radius);
  border: 1px solid rgba(255, 255, 255, 0.11);
  box-shadow: 0 2px 14px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.07);
  padding: 14px var(--hp-space-2);
  margin-bottom: var(--hp-card-gap);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  min-height: 110px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.hp-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}
.hp-card .hp-card-title {
  font-size: var(--hp-font-title);
  font-weight: 600;
  margin: 0;
  color: var(--text-primary, #fff);
  line-height: 1.3;
}
.hp-card .hp-card-meta {
  font-size: var(--hp-font-meta);
  color: var(--text-secondary, #aaa);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.hp-card .hp-card-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Compact card (this week list) */
.hp-card-compact {
  background: linear-gradient(135deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0.02) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: 0 2px 10px rgba(0,0,0,0.15), inset 0 1px 0 rgba(255,255,255,0.06);
  padding: 12px var(--hp-space-2);
  margin-bottom: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: background 0.15s ease;
}
.hp-card-compact:hover {
  background: var(--bg-hover, rgba(255,255,255,0.05));
}
.hp-card-compact .hp-card-date-pill {
  flex-shrink: 0;
  text-align: center;
  min-width: 40px;
  background: rgba(255,255,255,0.06);
  border-radius: 8px;
  padding: 6px 8px;
  line-height: 1.1;
}
.hp-card-compact .hp-card-date-pill .day {
  font-size: 16px;
  font-weight: 700;
  display: block;
  color: var(--text-primary, #fff);
}
.hp-card-compact .hp-card-date-pill .dow {
  font-size: 10px;
  text-transform: uppercase;
  opacity: 0.6;
  color: var(--text-secondary, #aaa);
}
.hp-card-compact .hp-card-info {
  flex: 1;
  min-width: 0;
}
.hp-card-compact .hp-card-title {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 3px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-primary, #fff);
}
.hp-card-compact .hp-card-meta {
  font-size: 12px;
  color: var(--text-secondary, #aaa);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Social proof elements */
.hp-social-proof {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary, #aaa);
}
.hp-votes {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
  color: var(--hp-trending);
}
.hp-popular-label {
  color: var(--hp-social);
  font-size: 11px;
  font-weight: 600;
}
.hp-friends-label {
  color: #34C759;
  font-size: 11px;
  font-weight: 600;
}

/* ── LIVE MAP ────────────────────────────────────────────── */
.hp-live-map {
  height: 220px;
  border-radius: var(--hp-card-radius);
  overflow: hidden;
  margin-bottom: var(--hp-space-2);
  border: 1px solid var(--border-color, rgba(255,255,255,0.08));
  isolation: isolate;
}

@media (min-width: 640px) {
  .hp-live-map { height: 280px; }
}

/* ── TONIGHT — Horizontal Scroll ─────────────────────────── */
.hp-scroll-row {
  display: flex;
  gap: var(--hp-card-gap);
  overflow-x: auto;
  padding-bottom: var(--hp-space-1);
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.hp-scroll-row::-webkit-scrollbar { display: none; }

.hp-scroll-card {
  flex-shrink: 0;
  width: 220px;
  scroll-snap-align: start;
  background: var(--bg-secondary, #1a1a2e);
  border-radius: var(--hp-card-radius);
  border: 1px solid var(--border-color, rgba(255,255,255,0.08));
  padding: 14px;
  cursor: pointer;
  transition: transform 0.18s ease;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 130px;
}
.hp-scroll-card:hover { transform: translateY(-2px); }
.hp-scroll-card .hp-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary, #fff);
  margin: 0;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hp-scroll-card .hp-card-meta {
  font-size: 12px;
  color: var(--text-secondary, #aaa);
}
.hp-scroll-card .hp-card-footer {
  margin-top: auto;
}

/* ── ADD EVENT CTA ───────────────────────────────────────── */
.hp-add-cta {
  padding: var(--hp-space-4) var(--hp-space-2);
  text-align: center;
}
.hp-add-cta-title {
  font-size: var(--hp-font-h2);
  font-weight: 600;
  margin: 0 0 var(--hp-space-2) 0;
  color: var(--text-primary, #fff);
}
.hp-add-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 0 var(--hp-space-3);
  background: var(--accent-color, #7c3aed);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.15s ease;
  width: 100%;
  max-width: 360px;
  justify-content: center;
}
.hp-add-cta-btn:hover { opacity: 0.9; transform: translateY(-1px); }

/* ── EMPTY STATES ────────────────────────────────────────── */
.hp-empty {
  text-align: center;
  padding: var(--hp-space-4) var(--hp-space-2);
  color: var(--text-secondary, #aaa);
  font-size: 14px;
  opacity: 0.6;
}

/* ── DESKTOP SUB-NAV ─────────────────────────────────────── */
/* Disabled — Option A uses bottom nav on all screen sizes */
.hp-desktop-subnav { display: none !important; }

/* ── BOTTOM NAV (mobile + desktop) ──────────────────────── */
/* Hidden by default; shown on dashboard / events / map pages */
.hp-mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;           /* mobile: full width */
  right: 0;
  height: 60px;
  background: var(--bg-primary, #0f0f1a);
  border-top: 1px solid var(--border-color, rgba(255,255,255,0.1));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 1050;     /* below modals, above page content */
  grid-template-columns: repeat(4, 1fr);
}

/* Desktop: EV theme has no sidebar — nav is full width, slightly taller */
@media (min-width: 769px) {
  .hp-mobile-nav {
    left: 0;
    height: 52px;
  }
}

.hp-mobile-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 500;
  color: var(--text-secondary, #aaa);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s ease;
  padding: 8px 0;
}
.hp-mobile-nav a i { font-size: 16px; }

@media (min-width: 769px) {
  .hp-mobile-nav a { font-size: 12px; }
  .hp-mobile-nav a i { font-size: 18px; }
}

.hp-mobile-nav a.active {
  color: var(--accent-color, #7c3aed);
  position: relative;
}
.hp-mobile-nav a.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 20%;
  right: 20%;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--accent-color, #7c3aed);
}
.hp-mobile-nav a.active.live-tab { color: var(--hp-live); }
.hp-mobile-nav a.active.live-tab::before { background: var(--hp-live); }

/* ── DESKTOP TWEAKS ─────────────────────────────────────── */
@media (min-width: 640px) {
  :root {
    --hp-font-h1: 36px;
    --hp-font-h2: 24px;
    --hp-font-title: 17px;
  }

  .hp-top-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--hp-card-gap);
  }
  .hp-top-grid .hp-card-large:first-child {
    grid-column: 1 / -1;
  }

  .hp-section-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--hp-card-gap);
  }

  /* Show desktop sub-nav on tablet+ */
  .hp-desktop-subnav {
    display: flex;
  }
}

@media (min-width: 1024px) {
  :root {
    --hp-font-h1: 40px;
  }
  .hp-hero { border-radius: 0 0 32px 32px; }

  .hp-top-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }
  .hp-top-grid .hp-card-large:first-child {
    grid-column: 1 / 1;
  }

  .hp-section-cols {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ── BOTTOM NAV VISIBILITY ──────────────────────────────── */
/* Show on dashboard, events, map — all screen sizes */
body.page-dashboard .hp-mobile-nav,
body.page-events .hp-mobile-nav,
body.page-map .hp-mobile-nav {
  display: grid;
}

/* ── MOBILE-ONLY TWEAKS ─────────────────────────────────── */
@media (max-width: 768px) {
  .hp-scroll-card { width: 180px; }
  .hp-hero-headline { font-size: 24px; }
  /* Extra bottom padding so last card isn't hidden behind nav */
  .hp-page { padding-bottom: 80px; }
}

/* ── SEGMENT FILTER TABS (Events + Map pages) ────────────── */
.ev-segment-tabs {
  display: flex;
  gap: 6px;
  padding: 12px 0 10px;
  border-bottom: 1px solid var(--border-color, rgba(255,255,255,0.1));
  margin-bottom: 14px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.ev-segment-tabs::-webkit-scrollbar { display: none; }

.ev-segment-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 20px;
  border: 1px solid var(--border-color, rgba(255,255,255,0.15));
  background: var(--bg-secondary, rgba(255,255,255,0.05));
  color: var(--text-secondary, #aaa);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  flex-shrink: 0;
  font-family: inherit;
}
.ev-segment-tab:hover {
  border-color: var(--accent-color, #7c3aed);
  color: var(--text-primary, #fff);
}
.ev-segment-tab.active {
  background: var(--accent-color, #7c3aed);
  border-color: var(--accent-color, #7c3aed);
  color: #fff;
  font-weight: 600;
}
.ev-segment-tab.live-tab.active {
  background: var(--hp-live, #FF3B30);
  border-color: var(--hp-live, #FF3B30);
}

/* ═══════════════════════════════════════════════════════════
   PHASE 1 — SHARED COMPONENTS
   ═══════════════════════════════════════════════════════════ */

/* ── GLASS HERO BAR (legacy — no longer used, kept for safety) */
.ev-page-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 16px;
  margin-bottom: 4px;
  background: linear-gradient(135deg, rgba(15,15,30,0.88) 0%, rgba(28,18,52,0.82) 100%);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.10),
    0 8px 32px rgba(0,0,0,0.28);
}
.ev-page-hero-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 30px;
  letter-spacing: 2px;
  color: #fff;
  line-height: 1;
  margin: 0;
}
.ev-page-hero-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
/* Icon-only view toggle buttons inside hero */
.ev-view-toggle-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
  color: var(--text-secondary, #aaa);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.15s ease;
}
.ev-view-toggle-btn:hover { border-color: var(--accent-color, #7c3aed); color: #fff; }
.ev-view-toggle-btn.active {
  background: var(--accent-color, #7c3aed);
  border-color: var(--accent-color, #7c3aed);
  color: #fff;
}
/* "Create event" inline button — hidden on mobile (FAB takes over) */
.ev-hero-create-btn { }
@media (max-width: 768px) {
  .ev-hero-create-btn { display: none !important; }
}

/* ── CONTROL ROW (replaces ev-page-hero + ev-filter-row) ── */
.ev-control-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0 6px;
  margin-bottom: 4px;
}
.ev-control-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  flex-wrap: wrap;
}
.ev-control-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
/* Desktop-only create btn */
.ev-hero-create-btn {
  background: #FF8000 !important;
  border-color: #FF8000 !important;
  font-size: 13px;
  padding: 7px 14px;
  border-radius: 10px;
}
@media (max-width: 768px) {
  .ev-hero-create-btn { display: none !important; }
}

/* ── FILTER ROW (filter btn + near-me side by side) ─────── */
.ev-filter-row {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 6px 0 4px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}
.ev-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
  color: var(--text-primary, #fff);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
}
.ev-filter-btn:hover { border-color: var(--accent-color, #7c3aed); }
.ev-filter-btn.has-filter {
  border-color: var(--accent-color, #7c3aed);
  background: rgba(124,58,237,0.14);
  color: var(--accent-color, #7c3aed);
}
.ev-filter-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--accent-color, #7c3aed);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

/* ── FILTER SHEET (bottom sheet + overlay) ──────────────── */
.ev-filter-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.52);
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.ev-filter-overlay.open { opacity: 1; pointer-events: all; }

.ev-filter-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2001;
  background: var(--bg-primary, #0f0f1a);
  border-top: 1px solid rgba(255,255,255,0.10);
  border-radius: 20px 20px 0 0;
  padding: 0 16px 24px;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  max-height: 72vh;
  overflow-y: auto;
}
.ev-filter-sheet.open { transform: translateY(0); }

.ev-filter-sheet-handle {
  width: 38px;
  height: 4px;
  background: rgba(255,255,255,0.18);
  border-radius: 2px;
  margin: 12px auto 0;
}
.ev-filter-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0 12px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  margin-bottom: 14px;
}
.ev-filter-sheet-header h3 {
  font-size: 15px;
  font-weight: 700;
  margin: 0;
  color: var(--text-primary, #fff);
}
.ev-filter-sheet-close {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.05);
  color: var(--text-secondary, #aaa);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}
.ev-filter-chips-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.ev-filter-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.09);
  background: rgba(255,255,255,0.04);
  color: var(--text-secondary, #aaa);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: all 0.15s ease;
}
.ev-filter-chip:hover { border-color: rgba(255,255,255,0.22); color: var(--text-primary, #fff); }
.ev-filter-chip.active {
  border-color: var(--accent-color, #7c3aed);
  background: rgba(124,58,237,0.15);
  color: var(--text-primary, #fff);
}
.ev-filter-chip.ev-filter-chip--all {
  grid-column: 1 / -1;
  justify-content: center;
}
.ev-filter-chip .chip-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── DATE PILL ROW ───────────────────────────────────────── */
.ev-date-pills {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 4px 0 10px;
}
.ev-date-pills::-webkit-scrollbar { display: none; }
.ev-date-pill {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  color: var(--text-secondary, #aaa);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  font-family: inherit;
  transition: all 0.15s ease;
}
.ev-date-pill:hover { border-color: var(--accent-color, #7c3aed); color: var(--text-primary, #fff); }
.ev-date-pill.active {
  background: var(--accent-color, #7c3aed);
  border-color: var(--accent-color, #7c3aed);
  color: #fff;
  font-weight: 600;
}

/* ── FLOATING ACTION BUTTON (Create Event, mobile only) ─── */
.ev-fab {
  position: fixed;
  bottom: calc(60px + 14px);  /* above bottom nav */
  right: 16px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #FF8000;
  color: #fff;
  border: none;
  font-size: 22px;
  cursor: pointer;
  z-index: 1040;
  display: none;             /* shown only on events/map pages, mobile */
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(255,128,0,0.45);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.ev-fab:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(255,128,0,0.65);
}
@media (max-width: 768px) {
  body.page-events .ev-fab,
  body.page-map .ev-fab { display: flex; }
}

/* ── PAGE BOTTOM PADDING (above bottom nav + FAB) ────────── */
body.page-events .tab-panel.active,
body.page-map #page-map {
  padding-bottom: 130px;
}

/* ============================================================
   PHASE 2 — Events page card system, infinite scroll, sort
   ============================================================ */

/* ── SORT PILL ROW ───────────────────────────────────────── */
.ev-sort-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px 0 6px;
}
.ev-sort-row::-webkit-scrollbar { display: none; }

.ev-sort-pill {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.60);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}
.ev-sort-pill:hover {
  border-color: rgba(255,255,255,0.22);
  color: rgba(255,255,255,0.85);
}
.ev-sort-pill.active {
  background: rgba(124,58,237,0.18);
  border-color: var(--accent-color, #7c3aed);
  color: #fff;
}

/* ── EVENTS CONTAINER (replaces metrics-grid for HP cards) ── */
.ev-events-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 6px;
}

/* For 'tonight' / 'live' segments, allow 2-col on wider screens */
.ev-events-container[data-segment="tonight"],
.ev-events-container[data-segment="live"] {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
@media (min-width: 640px) {
  .ev-events-container[data-segment="tonight"],
  .ev-events-container[data-segment="live"] {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 1024px) {
  .ev-events-container[data-segment="tonight"],
  .ev-events-container[data-segment="live"] {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ── HP CARDS INSIDE EVENTS CONTAINER ───────────────────── */
/* Ensure cards fill grid cells properly */
.ev-events-container .hp-card,
.ev-events-container .hp-card-large,
.ev-events-container .hp-card-compact {
  margin: 0;
}

/* ── STANDARD CARD HEADER (icon + title block) ───────────── */
.ev-card-standard {
  /* Slightly more padding to accommodate header row */
  padding: 14px 16px !important;
}
.ev-card-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}
.ev-card-cat-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 16px;
}
.ev-card-title-block {
  flex: 1;
  min-width: 0;
}
.ev-card-title-block .hp-card-title {
  margin-bottom: 4px;
}
.ev-card-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

/* ── SOCIAL ROW ──────────────────────────────────────────── */
.ev-card-social {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: rgba(255,255,255,0.55);
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.ev-card-social .ev-social-here {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #BF5AF2;
  font-weight: 600;
}
.ev-card-social .ev-social-going { color: #30D158; font-weight: 600; }
.ev-card-social .ev-social-inter { color: #FF8000; font-weight: 600; }
.ev-card-social .ev-social-friends { color: #FF9F0A; font-weight: 600; }
.ev-card-social .ev-social-score  { color: #FF2D55; font-weight: 600; }

/* ── RSVP BUTTONS INSIDE HP CARDS ───────────────────────── */
.ev-card-rsvp {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.07);
}
.ev-card-rsvp .btn-sm {
  flex: 1;
  padding: 7px 10px;
  font-size: 12px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
/* For compact (week) cards, make RSVP buttons smaller */
.ev-card-week .ev-card-rsvp {
  margin-top: 8px;
  padding-top: 8px;
}
.ev-card-week .ev-card-rsvp .btn-sm {
  font-size: 11px;
  padding: 5px 8px;
}

/* ── EMPTY STATE ─────────────────────────────────────────── */
.ev-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 60px 20px;
  color: rgba(255,255,255,0.35);
  grid-column: 1 / -1;
}
.ev-empty-state i {
  font-size: 48px;
  opacity: 0.5;
}
.ev-empty-state p,
.ev-empty-state span {
  font-size: 14px;
}

/* ── INFINITE SCROLL SENTINEL + LOADER ───────────────────── */
.ev-scroll-sentinel {
  height: 1px;
  width: 100%;
  grid-column: 1 / -1;
  visibility: hidden;
}
.ev-scroll-loader {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px;
  color: rgba(255,255,255,0.4);
  font-size: 20px;
  grid-column: 1 / -1;
}

/* ── GLASS CALENDAR VIEW ─────────────────────────────────── */
#panel-events-calendar {
  background: linear-gradient(135deg,
    rgba(15,15,30,0.75) 0%,
    rgba(20,10,40,0.70) 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  padding: 16px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.08),
    0 8px 32px rgba(0,0,0,0.25);
}
/* Calendar event dots */
#panel-events-calendar .calendar-event-dot {
  background: var(--accent-color, #7c3aed);
  opacity: 0.85;
}
/* Calendar day cells */
#panel-events-calendar .calendar-day {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  transition: background 0.15s ease;
}
#panel-events-calendar .calendar-day:hover,
#panel-events-calendar .calendar-day.has-events:hover {
  background: rgba(124,58,237,0.12);
  border-color: rgba(124,58,237,0.30);
}
#panel-events-calendar .calendar-day.today {
  background: rgba(124,58,237,0.16);
  border-color: var(--accent-color, #7c3aed);
}
#panel-events-calendar .calendar-day.selected {
  background: rgba(124,58,237,0.25);
  border-color: var(--accent-color, #7c3aed);
  box-shadow: 0 0 12px rgba(124,58,237,0.25);
}
