/* ============================================================
   EN VILLE — REVAMP: Bottom Nav + Events Page + Map Page
   Appended to homepage.css via <link> in index.html
   v1 — 2026-04-15
   ============================================================ */

/* ============================================================
   BOTTOM NAV — mobile only (max-width: 768px)
   Scenario A: 4 tabs + raised centre FAB
   ============================================================ */
.ev-bottom-nav {
  display: none; /* desktop: hidden */
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 900;
  height: 64px;
  background: rgba(10, 10, 22, 0.94);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  align-items: center;
  justify-content: space-around;
  padding: 0 4px;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

@media (max-width: 768px) {
  .ev-bottom-nav { display: flex; }

  /* Push main content above bottom nav */
  .main-content { padding-bottom: 76px; }

  /* Map page: no extra padding (sheet handles clearance) */
  body.page-map .main-content { padding-bottom: 0; }

  /* Hide legacy topbar on hero pages — hp-hero provides search + id */
  body.page-dashboard .topbar,
  body.page-events    .topbar,
  body.page-map       .topbar { display: none; }
}

.ev-bnav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 10px;
  color: rgba(255, 255, 255, 0.38);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.18s;
  flex: 1;
  border: none;
  background: none;
  position: relative;
}
.ev-bnav-item i    { font-size: 20px; transition: transform 0.18s; }
.ev-bnav-item span { font-size: 10px; font-weight: 500; letter-spacing: 0.3px; }
.ev-bnav-item.active       { color: var(--accent-color, #FF5C35); }
.ev-bnav-item.active i     { transform: scale(1.12); }

/* Centre FAB */
.ev-bnav-fab-wrap {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  padding-bottom: 4px;
}

.ev-bnav-fab {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-color, #FF5C35) 0%, #FF3366 100%);
  border: none;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  box-shadow: 0 6px 22px rgba(255, 92, 53, 0.52), 0 2px 6px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.14s, box-shadow 0.14s;
  margin-bottom: 14px; /* Float above nav bar */
}
.ev-bnav-fab:active {
  transform: scale(0.91);
  box-shadow: 0 3px 10px rgba(255, 92, 53, 0.38);
}

/* ============================================================
   EVENTS PAGE — content offset driven by hp-hero height
   ============================================================ */
.ev-page-content {
  padding-top: var(--hp-hero-full, 200px);
  transition: padding-top 0.25s ease;
}

/* Filter count badge on filter button */
.ev-filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  background: var(--accent-color, #FF5C35);
  color: #fff;
  border-radius: 50%;
  font-size: 9px;
  font-weight: 700;
  margin-left: 4px;
}

/* ============================================================
   MAP PAGE — Full-screen Google Maps DNA
   ============================================================ */
#page-map {
  padding: 0 !important;
  margin: 0;
  overflow: hidden;
}

.ev-map-fullscreen {
  position: relative;
  width: 100%;
  overflow: hidden;
  /* Height + marginTop set by map.js init() */
}

/* Leaflet map fills the container */
.ev-map-fullscreen #event-map {
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* ── Floating top bar ── */
.ev-map-topbar {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  z-index: 500;
  display: flex;
  gap: 8px;
  align-items: center;
}

.ev-map-search-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(10, 10, 22, 0.88);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 12px;
  padding: 11px 14px;
  color: rgba(255, 255, 255, 0.45);
  box-shadow: 0 4px 16px rgba(0,0,0,0.35);
}
.ev-map-search-wrap i { font-size: 13px; flex-shrink: 0; }

.ev-map-search-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: #fff;
  font-size: 14px;
  font-family: inherit;
}
.ev-map-search-input::placeholder { color: rgba(255,255,255,0.38); }

.ev-map-filter-fab {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: rgba(10, 10, 22, 0.88);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.11);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: background 0.2s, border-color 0.2s;
  box-shadow: 0 4px 16px rgba(0,0,0,0.35);
}
.ev-map-filter-fab.has-filter {
  background: var(--accent-color, #FF5C35);
  border-color: var(--accent-color, #FF5C35);
}

.ev-map-filter-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 17px;
  height: 17px;
  background: #ff3b30;
  color: #fff;
  border-radius: 50%;
  font-size: 9px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(10, 10, 22, 0.9);
}

/* ── Segment pills floating over map ── */
.ev-map-segments {
  position: absolute;
  top: 70px;
  left: 12px;
  right: 12px;
  z-index: 500;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.ev-map-segments::-webkit-scrollbar { display: none; }

.ev-map-seg {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 15px;
  background: rgba(10, 10, 22, 0.84);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 20px;
  color: rgba(255, 255, 255, 0.65);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.18s, color 0.18s, box-shadow 0.18s;
  white-space: nowrap;
  box-shadow: 0 2px 10px rgba(0,0,0,0.28);
}
.ev-map-seg.active {
  background: var(--accent-color, #FF5C35);
  border-color: var(--accent-color, #FF5C35);
  color: #fff;
  box-shadow: 0 3px 14px rgba(255, 92, 53, 0.42);
}

/* Pulsing live dot */
.ev-map-live-dot {
  width: 7px;
  height: 7px;
  background: #ff3b30;
  border-radius: 50%;
  flex-shrink: 0;
  animation: ev-live-pulse 1.2s ease-in-out infinite;
}
@keyframes ev-live-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.48; transform: scale(0.72); }
}

/* ── Near-me FAB ── */
.ev-map-near-fab {
  position: absolute;
  bottom: 180px;
  right: 14px;
  z-index: 500;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(10, 10, 22, 0.88);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.11);
  color: rgba(255, 255, 255, 0.8);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
  box-shadow: 0 4px 14px rgba(0,0,0,0.3);
}
.ev-map-near-fab.active {
  background: var(--accent-color, #FF5C35);
  border-color: var(--accent-color, #FF5C35);
  color: #fff;
}

/* ── Draggable Bottom Sheet ── */
.ev-map-sheet {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 600;
  background: rgba(10, 10, 22, 0.97);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-top: 1px solid rgba(255, 255, 255, 0.10);
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  box-shadow: 0 -8px 32px rgba(0,0,0,0.4);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: height 0.28s cubic-bezier(0.34, 1.26, 0.64, 1);
}
/* Height snap states */
.ev-map-sheet[data-state="peek"] { height: 160px; }
.ev-map-sheet[data-state="mid"]  { height: 50vh;  }
.ev-map-sheet[data-state="full"] { height: 90vh;  }

/* Drag handle */
.ev-map-sheet-handle-wrap {
  padding: 10px 0 5px;
  display: flex;
  justify-content: center;
  cursor: grab;
  flex-shrink: 0;
  user-select: none;
}
.ev-map-sheet-handle-wrap:active { cursor: grabbing; }

.ev-map-sheet-handle-pill {
  width: 36px;
  height: 4px;
  background: rgba(255, 255, 255, 0.22);
  border-radius: 2px;
}

/* Sheet header */
.ev-map-sheet-header {
  padding: 0 16px 8px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ev-map-sheet-count {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.5);
  display: flex;
  align-items: center;
  gap: 5px;
}
.ev-map-sheet-count i { color: var(--accent-color, #FF5C35); }

/* Date pills row inside sheet */
.ev-map-date-pills {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}
.ev-map-date-pills::-webkit-scrollbar { display: none; }

/* Scrollable event cards */
.ev-map-sheet-content {
  flex: 1;
  overflow-y: auto;
  padding: 4px 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.12) transparent;
}

/* ── Event cards in sheet ── */
.ev-map-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-left: 3px solid var(--cat-color, #FF5C35);
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.14s;
  flex-shrink: 0;
}
.ev-map-card:hover,
.ev-map-card:active { background: rgba(255, 255, 255, 0.08); }

.ev-map-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--cat-color, #FF5C35) 16%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cat-color, #FF5C35);
  font-size: 14px;
  flex-shrink: 0;
}

.ev-map-card-body {
  flex: 1;
  min-width: 0;
}
.ev-map-card-title {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ev-map-card-meta {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.42);
  display: flex;
  gap: 8px;
  margin-top: 3px;
  flex-wrap: wrap;
}
.ev-map-card-meta i { font-size: 10px; }

.ev-map-card-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  flex-shrink: 0;
}
.ev-map-card-live {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  color: #ff3b30;
}
.ev-map-card-going {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-color, #FF5C35);
}
.ev-map-card-arrow {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.22);
}

/* Empty / loading states */
.ev-map-sheet-empty,
.ev-map-sheet-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: rgba(255, 255, 255, 0.32);
  padding: 40px 20px;
  font-size: 14px;
  text-align: center;
}
.ev-map-sheet-loading i { font-size: 24px; }

/* ── Desktop: fixed height sheet ── */
@media (min-width: 769px) {
  .ev-map-sheet[data-state="peek"],
  .ev-map-sheet[data-state="mid"],
  .ev-map-sheet[data-state="full"] {
    height: 36vh;
  }
  .ev-map-near-fab { bottom: 220px; }
}
