/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #f8f9fa;
  --surface: #ffffff;
  --surface-2: #f1f3f5;
  --border: #e0e0e0;
  --border-active: #333;
  --text: #1a1a1a;
  --text-muted: #888;
  --accent: #e63312;
  --accent-light: #fff0ed;
  --green: #16a34a;
  --green-light: #f0fdf4;
  --purple: #7c3aed;
  --radius: 10px;
  --header-h: 56px;
  --tabs-h: 44px;
  --qf-h: 40px;
  --time-h: 44px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ===== Header ===== */
#header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 1100;
  box-shadow: var(--shadow-sm);
  overflow: visible;
}

.header-left {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-shrink: 0;
}

.header-left h1 {
  font-size: 18px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.5px;
}

.subtitle {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

/* ===== Search Bar ===== */
.header-center {
  flex: 1;
  max-width: 400px;
  margin: 0 16px;
}

.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--surface-2);
  border: 1.5px solid transparent;
  border-radius: 22px;
  height: 38px;
  padding: 0 14px;
  transition: all 0.2s;
}

.search-wrap:focus-within {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.search-icon { flex-shrink: 0; color: var(--text-muted); margin-right: 8px; }

#search-input {
  flex: 1;
  background: none;
  border: none;
  color: var(--text);
  font-size: 14px;
  outline: none;
  min-width: 0;
}

#search-input::placeholder { color: #bbb; }

.search-clear {
  width: 20px;
  height: 20px;
  border: none;
  background: var(--text-muted);
  border-radius: 50%;
  color: white;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.search-results {
  position: absolute;
  top: 44px;
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-height: min(360px, calc(100vh - 120px));
  overflow-y: auto;
  z-index: 5000;
  box-shadow: var(--shadow-lg);
}

.search-results.hidden { display: none; }

.search-result-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--surface-2);
  transition: background 0.1s;
}

.search-result-item:hover { background: var(--surface-2); }
.search-result-item:last-child { border-bottom: none; }

.search-result-thumb {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--surface-2);
}

.search-result-info { flex: 1; min-width: 0; }

.search-result-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.search-result-type {
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
  color: white;
  flex-shrink: 0;
}

.search-result-item.search-result-active {
  background: var(--accent-light);
  border-left: 3px solid var(--accent);
}

.search-no-results {
  padding: 20px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

/* ===== Header Buttons ===== */
.header-right {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.header-right button {
  width: 38px;
  height: 38px;
  border: 1.5px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 0.15s;
}

.header-right button:hover { background: var(--surface-2); border-color: var(--border-active); }

.filter-count {
  position: absolute;
  top: -3px;
  right: -3px;
  background: var(--accent);
  color: white;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* ===== Day Tabs ===== */
#day-tabs {
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  height: var(--tabs-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  z-index: 1000;
  padding: 0 12px;
  gap: 6px;
  align-items: center;
}

#day-tabs::-webkit-scrollbar { display: none; }

.day-tab {
  flex-shrink: 0;
  padding: 7px 16px;
  border: 1.5px solid var(--border);
  border-radius: 22px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.day-tab:hover { border-color: var(--text-muted); color: var(--text); }

.day-tab[aria-selected="true"] {
  background: var(--text);
  color: white;
  border-color: var(--text);
}

/* ===== Quick Filters ===== */
#quick-filters {
  position: fixed;
  top: calc(var(--header-h) + var(--tabs-h));
  left: 0;
  right: 0;
  height: var(--qf-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  z-index: 1000;
  padding: 0 12px;
  gap: 6px;
  align-items: center;
}

#quick-filters::-webkit-scrollbar { display: none; }

.quick-filter {
  flex-shrink: 0;
  padding: 6px 14px;
  border: 1.5px solid var(--border);
  border-radius: 22px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.quick-filter:hover { border-color: var(--text); color: var(--text); }

.quick-filter.active {
  background: var(--text);
  border-color: var(--text);
  color: white;
}

/* ===== Time Control ===== */
#time-control {
  position: fixed;
  top: calc(var(--header-h) + var(--tabs-h) + var(--qf-h));
  left: 0;
  right: 0;
  height: var(--time-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 10px;
  z-index: 1000;
}

.time-window {
  flex-shrink: 0;
  padding: 6px 14px;
  border: 1.5px solid var(--border);
  border-radius: 22px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.time-window span {
  font-size: 10px;
  font-weight: 400;
  opacity: 0.7;
}

.time-window:hover { border-color: var(--text); color: var(--text); }

.time-window.active {
  background: var(--text);
  border-color: var(--text);
  color: white;
}

.time-window.active span { opacity: 0.8; }

/* ===== Filter Panel ===== */
.filter-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 340px;
  height: 100%;
  background: var(--surface);
  border-left: 1px solid var(--border);
  z-index: 2000;
  overflow-y: auto;
  transition: transform 0.25s ease;
  padding: 20px;
  box-shadow: var(--shadow-lg);
}

.filter-panel.hidden { transform: translateX(100%); }

.filter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.filter-header h2 { font-size: 20px; font-weight: 700; }

.filter-header button {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--surface-2);
  border-radius: 50%;
  color: var(--text);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.filter-section { margin-bottom: 24px; }
.filter-section h3 {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-chips.scrollable { max-height: 220px; overflow-y: auto; }

/* ===== Filter Grid (event type toggles) ===== */
.filter-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.type-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}

.type-toggle:hover { border-color: var(--text-muted); }

.type-toggle .toggle-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.type-toggle .toggle-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  flex: 1;
}

.type-toggle .toggle-check {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-radius: 4px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

/* Active state: colored left border + check filled */
.type-toggle.active {
  border-color: var(--type-color, var(--text));
  border-left-width: 4px;
}

.type-toggle.active .toggle-label {
  color: var(--text);
  font-weight: 600;
}

.type-toggle.active .toggle-check {
  background: var(--type-color, var(--text));
  border-color: var(--type-color, var(--text));
}

.type-toggle.active .toggle-check::after {
  content: '✓';
  color: white;
  font-size: 12px;
  font-weight: 700;
}

/* ===== Segmented Control (badge/cost) ===== */
.filter-segmented {
  display: flex;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.seg-btn {
  flex: 1;
  padding: 8px 12px;
  border: none;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  border-right: 1px solid var(--border);
}

.seg-btn:last-child { border-right: none; }
.seg-btn:hover { background: var(--surface-2); }

.seg-btn.active {
  background: var(--text);
  color: white;
}

/* ===== Tag chips ===== */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border: 1.5px solid var(--border);
  border-radius: 22px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--surface);
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}

.chip input { display: none; }
.chip:hover { border-color: var(--text-muted); color: var(--text); }

.chip.active {
  background: var(--text);
  border-color: var(--text);
  color: white;
  font-weight: 600;
}

.chip .dot { display: none; }

.filter-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.btn-reset {
  padding: 8px 16px;
  border: 1.5px solid var(--border);
  border-radius: 22px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-reset:hover { border-color: var(--accent); color: var(--accent); }

.event-count {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
}

/* ===== Map ===== */
#map {
  position: fixed;
  top: calc(var(--header-h) + var(--tabs-h) + var(--qf-h) + var(--time-h));
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
}

/* Clean map — no filter tricks, using CartoDB Positron (light tiles) */
.leaflet-control-attribution { display: none !important; }

/* Cluster icons */
.marker-cluster {
  background: rgba(230, 51, 18, 0.15) !important;
}

.marker-cluster div {
  background: var(--accent) !important;
  color: white !important;
  font-weight: 700 !important;
  font-size: 13px !important;
  box-shadow: var(--shadow-sm) !important;
}

.marker-cluster-small { background: rgba(230, 51, 18, 0.12) !important; }
.marker-cluster-medium { background: rgba(230, 51, 18, 0.18) !important; }
.marker-cluster-large { background: rgba(230, 51, 18, 0.25) !important; }

/* Event markers */
.event-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2.5px solid white;
  box-shadow: var(--shadow-md);
  font-size: 15px;
  transition: transform 0.15s;
}

.event-marker:hover { transform: scale(1.15); }

.venue-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  border-radius: 19px;
  border: 2.5px solid white;
  box-shadow: var(--shadow-md);
  font-size: 12px;
  font-weight: 700;
  color: white;
  padding: 0 10px;
  gap: 4px;
}

/* ===== Event Detail Panel — LEFT SIDE ===== */
.event-detail {
  position: fixed;
  top: var(--header-h);
  left: 0;
  bottom: 0;
  width: 380px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  z-index: 1500;
  overflow-y: auto;
  transition: transform 0.3s ease;
  padding: 0;
  box-shadow: var(--shadow-lg);
}

.event-detail.hidden { transform: translateX(-100%); }

.btn-detail-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  border: 1.5px solid var(--border);
  border-radius: 22px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 12px;
  transition: all 0.15s;
}

.btn-detail-back:hover {
  background: var(--surface-2);
  border-color: var(--text);
}

.close-detail {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 30px;
  height: 30px;
  border: none;
  background: rgba(255,255,255,0.9);
  border-radius: 50%;
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  z-index: 10;
  backdrop-filter: blur(4px);
}

#detail-content {
  padding: 20px;
}

/* Thumbnail */
.detail-thumb-wrap {
  position: relative;
  margin: -20px -20px 16px -20px;
  height: 180px;
  overflow: hidden;
}

.detail-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-thumb-wrap .detail-badge {
  position: absolute;
  bottom: 12px;
  left: 12px;
}

.detail-thumb-gradient {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 70px;
  background: linear-gradient(transparent, var(--surface));
}

.detail-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 14px;
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 10px;
  color: white;
}

.detail-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 6px;
  line-height: 1.3;
}

.detail-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 10px 0 14px;
  font-size: 13px;
  color: var(--text-muted);
}

.detail-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.detail-venue { font-weight: 600; color: var(--text); }

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 10px;
}

.detail-tag {
  padding: 3px 10px;
  border-radius: 12px;
  background: var(--surface-2);
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

.detail-credentials {
  margin-top: 12px;
  padding: 10px 14px;
  background: var(--surface-2);
  border-radius: var(--radius);
  font-size: 12px;
  color: var(--text-muted);
}

.detail-credentials strong { color: var(--text); }

.detail-presented {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-muted);
}

/* Event description */
.detail-description {
  margin-top: 14px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text);
}

.detail-description p {
  margin-bottom: 8px;
}

.detail-description p:last-child {
  margin-bottom: 0;
}

.desc-loading {
  color: var(--text-muted);
  font-style: italic;
  font-size: 12px;
}

/* Action buttons */
.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.btn-directions, .btn-sxsw-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border: 1.5px solid var(--border);
  border-radius: 22px;
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
}

.btn-directions:hover, .btn-sxsw-link:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.btn-directions svg, .btn-sxsw-link svg, .btn-share svg { flex-shrink: 0; }

.btn-share {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border: 1.5px solid var(--border);
  border-radius: 22px;
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-share:hover {
  background: #3b82f6;
  border-color: #3b82f6;
  color: white;
}

/* Toast notification */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: white;
  padding: 10px 24px;
  border-radius: 22px;
  font-size: 13px;
  font-weight: 600;
  z-index: 6000;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.3s ease, toastOut 0.3s ease 2s forwards;
}

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

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

/* Venue event list */
.venue-events-list {
  margin-top: 14px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.venue-event-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--surface-2);
  cursor: pointer;
  transition: background 0.1s;
  border-radius: var(--radius);
  padding: 10px 8px;
  margin: 0 -8px;
}

.venue-event-item:hover { background: var(--surface-2); }
.venue-event-item:last-child { border-bottom: none; }

.venue-event-name {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
}

.venue-event-time {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.venue-event-type {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
  color: white;
  margin-left: 6px;
}

/* ===== Cluster Event Cards ===== */
.cluster-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cluster-card {
  display: flex;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s;
  background: var(--surface);
}

.cluster-card:hover {
  border-color: var(--accent);
  background: var(--accent-light);
}

.cluster-card-img {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

.cluster-card-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
}

.cluster-card-body {
  flex: 1;
  min-width: 0;
}

.cluster-card-type {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 600;
  color: white;
  margin-bottom: 4px;
}

.cluster-card-title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 3px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cluster-card-meta {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

.cluster-card-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
  margin-top: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cluster-card-free {
  display: inline-block;
  margin-top: 4px;
  padding: 1px 8px;
  border-radius: 8px;
  background: var(--green-light);
  color: var(--green);
  font-size: 10px;
  font-weight: 700;
}

/* Unofficial badge */
.unofficial-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--purple);
  color: white;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-left: 6px;
}

/* ===== Route info bar ===== */
.leaflet-routing-container { display: none !important; }

.route-info-bar {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 10px 20px;
  z-index: 1400;
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  box-shadow: var(--shadow-lg);
  white-space: nowrap;
}

.route-info-bar.hidden { display: none; }

.route-info-text { color: var(--text); font-weight: 600; }
.route-info-text span { color: var(--accent); }

.btn-clear-route {
  padding: 6px 14px;
  border: 1.5px solid var(--border);
  border-radius: 22px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-clear-route:hover { border-color: var(--accent); color: var(--accent); }

/* ===== Loading ===== */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 5000;
  transition: opacity 0.3s;
}

.loading-overlay.fade-out { opacity: 0; pointer-events: none; }

.loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay p {
  margin-top: 16px;
  font-size: 14px;
  color: var(--text-muted);
}

/* ===== Marker Tooltips (hover/tap preview) ===== */
.event-tooltip {
  background: white !important;
  border: 1px solid var(--border) !important;
  border-radius: 12px !important;
  box-shadow: var(--shadow-lg) !important;
  padding: 0 !important;
  max-width: 260px;
}

.event-tooltip .leaflet-tooltip-content { margin: 0; }

.event-tooltip::before {
  border-top-color: white !important;
}

.tooltip-card {
  overflow: hidden;
  border-radius: 12px;
}

.tooltip-img {
  width: 100%;
  height: 100px;
  object-fit: cover;
  display: block;
}

.tooltip-body {
  padding: 10px 12px;
}

.tooltip-type {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 600;
  color: white;
  margin-bottom: 4px;
}

.tooltip-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 4px;
}

.tooltip-meta {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

.tooltip-free {
  display: inline-block;
  margin-top: 4px;
  padding: 1px 8px;
  border-radius: 8px;
  background: var(--green-light);
  color: var(--green);
  font-size: 10px;
  font-weight: 700;
}

.tooltip-venue {
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text);
}

.tooltip-venue span {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
}

/* ===== Leaflet Popups ===== */
.leaflet-popup-content-wrapper {
  background: var(--surface) !important;
  color: var(--text) !important;
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow-lg) !important;
}

.leaflet-popup-tip { background: var(--surface) !important; }

/* GPS locate button on map */
.locate-control a {
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 34px !important;
  height: 34px !important;
  background: white !important;
  color: #333 !important;
}

.locate-control a:hover {
  background: var(--surface-2) !important;
}

/* Highlight marker — big obvious pin with label */
.highlight-pin {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
}

.highlight-label {
  background: white;
  border: 2px solid var(--accent);
  border-radius: 10px;
  padding: 6px 12px;
  text-align: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  max-width: 200px;
  margin-bottom: 6px;
  animation: bounceLabel 0.5s ease;
}

.highlight-label strong {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 176px;
}

.highlight-label span {
  display: block;
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 176px;
}

.highlight-dot {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  animation: bouncePin 1s ease infinite;
  z-index: 2;
}

.highlight-pulse {
  position: absolute;
  bottom: -6px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid;
  opacity: 0;
  animation: expandPulse 1.5s ease infinite;
  z-index: 1;
}

@keyframes bounceLabel {
  0% { transform: translateY(-10px); opacity: 0; }
  60% { transform: translateY(3px); opacity: 1; }
  100% { transform: translateY(0); }
}

@keyframes bouncePin {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes expandPulse {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(3); opacity: 0; }
}

/* User location */
.user-location {
  width: 16px;
  height: 16px;
  background: #3b82f6;
  border: 3px solid white;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.25), var(--shadow-sm);
}

/* ===== Mobile ===== */
@media (max-width: 640px) {
  :root {
    --header-h: 48px;
    --tabs-h: 38px;
    --qf-h: 36px;
    --time-h: 36px;
  }

  /* Compact header */
  #header { padding: 0 10px; }
  .header-left h1 { font-size: 15px; }
  .subtitle { display: none; }
  .header-center { margin: 0 6px; }
  .search-wrap { height: 32px; border-radius: 16px; padding: 0 10px; }
  #search-input { font-size: 13px; }
  .header-right { gap: 4px; }
  .header-right button { width: 34px; height: 34px; }

  /* Compact day tabs */
  #day-tabs { padding: 0 6px; gap: 4px; }
  .day-tab { padding: 4px 10px; font-size: 11px; }

  /* Compact quick filters */
  #quick-filters { padding: 0 6px; gap: 4px; }
  .quick-filter { padding: 4px 10px; font-size: 11px; }

  /* Compact time windows */
  #time-control { padding: 0 6px; gap: 4px; }
  .time-window { padding: 4px 10px; font-size: 11px; }
  .time-window span { font-size: 9px; }

  /* Full width filter panel */
  .filter-panel { width: 100%; }

  /* Bottom sheet detail panel */
  .event-detail {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-height: 70vh;
    border-right: none;
    border-top: 1px solid var(--border);
    border-radius: 16px 16px 0 0;
  }

  .event-detail.hidden { transform: translateY(100%); }

  #detail-content { padding: 16px; }
  .detail-thumb-wrap { margin: -16px -16px 12px -16px; height: 140px; }

  /* Search results dropdown */
  .search-results { top: 38px; }
}

/* ===== Location prompt ===== */
.location-prompt {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-lg);
  z-index: 1600;
  max-width: 360px;
  animation: slideUp 0.3s ease;
}

.location-prompt.hidden { display: none; }

.location-prompt-text {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.3;
}

.location-prompt-text small {
  display: block;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 400;
  margin-top: 2px;
}

.btn-enable-location {
  flex-shrink: 0;
  padding: 8px 16px;
  border: none;
  border-radius: 20px;
  background: #3b82f6;
  color: white;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-enable-location:hover { background: #2563eb; }

.btn-dismiss-location {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border: none;
  background: var(--surface-2);
  border-radius: 50%;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

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