/* ======================================
   RADAR - Styles
   Mobile-first, dark theme, responsive
   ====================================== */

/* ---- CSS Variables ---- */
:root {
  --primary: #6c5ce7;
  --primary-light: #a29bfe;
  --primary-dark: #5a4bd1;
  --accent: #00f5a0;
  --accent-blue: #00d2ff;
  --bg-dark: #0a0a1a;
  --bg-card: #141428;
  --bg-card-hover: #1a1a3e;
  --bg-surface: #1e1e3a;
  --bg-input: #1a1a30;
  --text-primary: #ffffff;
  --text-secondary: #a0a0c0;
  --text-muted: #6a6a8a;
  --border: #2a2a4a;
  --border-light: #3a3a5a;
  --danger: #ff6b6b;
  --warning: #feca57;
  --success: #00f5a0;
  --shadow: 0 4px 20px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.6);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --radius-full: 50px;
  --header-height: 60px;
  --filter-height: 50px;
  --bottom-nav-height: 65px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  min-height: 100dvh;
}

a { color: var(--primary-light); text-decoration: none; }
a:hover { color: var(--accent); }

input, button, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

img { max-width: 100%; height: auto; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-light); }

/* ---- Utilities ---- */
.hidden { display: none !important; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
}
.btn-primary:hover { background: linear-gradient(135deg, var(--primary-light), var(--primary)); transform: translateY(-1px); }

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--primary); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 8px 12px;
}
.btn-ghost:hover { color: var(--text-primary); background: rgba(255,255,255,0.05); }

.btn-full { width: 100%; }
.btn-small { padding: 6px 14px; font-size: 0.8rem; }

/* ---- Splash Screen ---- */
.splash-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s, visibility 0.5s;
}

.splash-screen.fade-out {
  opacity: 0;
  visibility: hidden;
}

.splash-content {
  text-align: center;
}

.radar-logo-animated {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto 24px;
}

.radar-ring {
  position: absolute;
  border-radius: 50%;
  border: 2px solid var(--primary);
  opacity: 0;
  animation: radarPulse 2s ease-out infinite;
}

.ring-1 { inset: 0; animation-delay: 0s; }
.ring-2 { inset: 15px; animation-delay: 0.4s; }
.ring-3 { inset: 30px; animation-delay: 0.8s; }

.radar-dot {
  position: absolute;
  width: 16px;
  height: 16px;
  background: var(--accent);
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 20px var(--accent);
}

@keyframes radarPulse {
  0% { opacity: 0; transform: scale(0.5); }
  50% { opacity: 0.8; }
  100% { opacity: 0; transform: scale(1.2); }
}

.splash-title {
  font-size: 2.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary-light), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 4px;
}

.splash-subtitle {
  color: var(--text-secondary);
  margin-top: 8px;
  font-size: 0.9rem;
}

/* ---- Header ---- */
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: rgba(10, 10, 26, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 1000;
}

.header-left, .header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.logo-icon { font-size: 1.5rem; }

.logo-text {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: 2px;
  background: linear-gradient(135deg, var(--primary-light), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Mode Toggle (desktop) */
.mode-toggle {
  display: none;
  background: var(--bg-surface);
  border-radius: var(--radius-full);
  padding: 3px;
  gap: 2px;
}

.mode-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  border: none;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.mode-btn.active {
  background: var(--primary);
  color: white;
}

.mode-btn .mode-icon {
  width: 16px;
  height: 16px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  position: relative;
}

.icon-btn:hover { background: rgba(255,255,255,0.08); color: var(--text-primary); }
.icon-btn svg { width: 22px; height: 22px; }

.notification-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 18px;
  height: 18px;
  background: var(--danger);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---- Search Bar ---- */
.search-bar {
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  background: var(--bg-dark);
  border-bottom: 1px solid var(--border);
  z-index: 999;
  padding: 10px 16px;
  animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.search-container {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 0 16px;
  transition: var(--transition);
}

.search-container:focus-within { border-color: var(--primary); }

.search-icon { width: 20px; height: 20px; color: var(--text-muted); flex-shrink: 0; }

#search-input {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-primary);
  padding: 12px 0;
  outline: none;
  font-size: 0.95rem;
}

#search-input::placeholder { color: var(--text-muted); }

.search-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
}
.search-close svg { width: 18px; height: 18px; }

.search-results {
  max-height: 60vh;
  overflow-y: auto;
  margin-top: 8px;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.search-result-item:hover { background: var(--bg-surface); }

.search-result-img {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--bg-surface);
}

.search-result-info h4 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.search-result-info p {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* ---- Filter Bar ---- */
.filter-bar {
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  height: var(--filter-height);
  background: rgba(10, 10, 26, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  z-index: 998;
  display: flex;
  align-items: center;
}

.filter-scroll {
  display: flex;
  gap: 8px;
  padding: 0 16px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  white-space: nowrap;
  width: 100%;
}

.filter-scroll::-webkit-scrollbar { display: none; }

.filter-chip {
  padding: 6px 16px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}

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

.filter-chip.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.chip-icon { font-size: 0.9rem; }

/* ---- Main Content ---- */
.app-main {
  padding-top: calc(var(--header-height) + var(--filter-height));
  padding-bottom: calc(var(--bottom-nav-height) + var(--safe-bottom));
  min-height: 100vh;
  min-height: 100dvh;
}

.mode-view { display: none; }
.mode-view.active { display: block; }

/* ---- MODO RADAR: Map ---- */
.map-container {
  position: fixed;
  top: calc(var(--header-height) + var(--filter-height));
  left: 0;
  right: 0;
  bottom: calc(var(--bottom-nav-height) + var(--safe-bottom));
  z-index: 1;
}

/* Custom map tiles style */
.leaflet-tile-pane { filter: saturate(0.3) brightness(0.65) contrast(1.1); }

.leaflet-control-zoom { display: none; }
.leaflet-control-attribution { font-size: 9px !important; opacity: 0.5; }

/* Map controls */
.map-controls {
  position: fixed;
  right: 16px;
  bottom: calc(var(--bottom-nav-height) + var(--safe-bottom) + 100px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 500;
}

.map-control-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--bg-card);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.map-control-btn:hover { background: var(--bg-card-hover); }
.map-control-btn.active { background: var(--primary); color: white; }
.map-control-btn svg { width: 22px; height: 22px; }

/* Time filter pills */
.time-filters {
  position: fixed;
  top: calc(var(--header-height) + var(--filter-height) + 12px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 500;
  background: rgba(10, 10, 26, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 4px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
}

.time-pill {
  padding: 6px 14px;
  border: none;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.time-pill:hover { color: var(--text-primary); }
.time-pill.active { background: var(--accent); color: var(--bg-dark); }

/* Event Preview Card (bottom sheet) */
.event-preview {
  position: fixed;
  bottom: calc(var(--bottom-nav-height) + var(--safe-bottom));
  left: 0;
  right: 0;
  background: var(--bg-card);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  z-index: 600;
  transform: translateY(0);
  transition: transform 0.3s ease;
  box-shadow: 0 -4px 30px rgba(0,0,0,0.5);
  max-height: 40vh;
  overflow-y: auto;
}

.preview-handle {
  width: 40px;
  height: 4px;
  background: var(--border-light);
  border-radius: 2px;
  margin: 10px auto;
  cursor: pointer;
}

.preview-content {
  padding: 0 16px 16px;
}

.preview-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  cursor: pointer;
}

.preview-image {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--bg-surface);
  flex-shrink: 0;
}

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

.preview-category {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.preview-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.preview-meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.preview-price {
  font-weight: 700;
  color: var(--accent);
  font-size: 0.95rem;
  margin-top: 6px;
}

.preview-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

/* Category colors */
.cat-concierto { background: rgba(255,107,107,0.2); color: #ff6b6b; }
.cat-fiesta { background: rgba(254,202,87,0.2); color: #feca57; }
.cat-cultural { background: rgba(72,219,251,0.2); color: #48dbfb; }
.cat-teatro { background: rgba(162,155,254,0.2); color: #a29bfe; }
.cat-gastronomia { background: rgba(255,159,67,0.2); color: #ff9f43; }
.cat-deporte { background: rgba(0,245,160,0.2); color: #00f5a0; }
.cat-turismo { background: rgba(0,210,255,0.2); color: #00d2ff; }
.cat-taller { background: rgba(253,121,168,0.2); color: #fd79a8; }
.cat-feria { background: rgba(225,112,85,0.2); color: #e17055; }
.cat-otro { background: rgba(160,160,192,0.2); color: #a0a0c0; }

/* Custom Map Markers */
.event-marker {
  background: none;
  border: none;
}

.marker-pin {
  width: 36px;
  height: 36px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  position: relative;
}

.marker-pin.promoted {
  width: 44px;
  height: 44px;
  animation: markerPulse 2s infinite;
}

@keyframes markerPulse {
  0%, 100% { box-shadow: 0 2px 8px rgba(0,0,0,0.3); }
  50% { box-shadow: 0 2px 20px rgba(108,92,231,0.6); }
}

.marker-icon {
  transform: rotate(45deg);
  font-size: 16px;
}

.marker-cluster-custom {
  background: rgba(108, 92, 231, 0.7);
  border: 2px solid var(--primary-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 14px;
  backdrop-filter: blur(4px);
}

/* User location marker */
.user-marker {
  width: 20px;
  height: 20px;
  background: var(--accent-blue);
  border: 3px solid white;
  border-radius: 50%;
  box-shadow: 0 0 15px rgba(0, 210, 255, 0.5);
  animation: userPulse 2s infinite;
}

@keyframes userPulse {
  0%, 100% { box-shadow: 0 0 15px rgba(0, 210, 255, 0.5); }
  50% { box-shadow: 0 0 30px rgba(0, 210, 255, 0.8); }
}

/* ---- MODO CARTELERA ---- */
.cartelera-view {
  padding: 0 16px;
}

.cartelera-header {
  position: sticky;
  top: calc(var(--header-height) + var(--filter-height));
  background: var(--bg-dark);
  padding: 12px 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.date-nav {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  flex: 1;
}
.date-nav::-webkit-scrollbar { display: none; }

.date-nav-btn {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.date-nav-btn:hover { border-color: var(--primary); }

.date-nav-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.cartelera-sort select {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  cursor: pointer;
}

/* Collections */
.collections-section {
  margin: 8px 0 24px;
}

.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.collections-scroll {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: none;
}
.collections-scroll::-webkit-scrollbar { display: none; }

.collection-card {
  min-width: 220px;
  max-width: 220px;
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.collection-card:hover { transform: translateY(-3px); border-color: var(--primary); }

.collection-header {
  padding: 16px;
  background: linear-gradient(135deg, rgba(108,92,231,0.3), rgba(0,245,160,0.1));
}

.collection-icon { font-size: 1.5rem; margin-bottom: 6px; display: block; }

.collection-title {
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.3;
}

.collection-count {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.collection-events {
  padding: 8px 12px 12px;
}

.collection-event-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.8rem;
}

.collection-event-item:last-child { border-bottom: none; }
.collection-event-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Events Grid */
.events-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.events-count {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.events-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

/* Event Card */
.event-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid var(--border);
  position: relative;
}

.event-card:hover { transform: translateY(-2px); border-color: var(--primary); }

.event-card.promoted {
  border-color: var(--primary);
  box-shadow: 0 0 20px rgba(108, 92, 231, 0.2);
}

.event-card-promoted-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(108, 92, 231, 0.9);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  z-index: 2;
}

.event-card-image {
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: var(--bg-surface);
}

.event-card-body {
  padding: 14px;
}

.event-card-category {
  display: inline-block;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.event-card-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.event-card-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.event-card-meta-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.event-card-meta-row svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: var(--text-muted);
}

.event-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
}

.event-card-price {
  font-weight: 700;
  color: var(--accent);
  font-size: 0.95rem;
}

.event-card-price.free {
  background: linear-gradient(135deg, var(--accent), var(--accent-blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.event-card-interest {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.event-card-interest svg { width: 14px; height: 14px; }

/* Load More */
.load-more {
  text-align: center;
  padding: 20px 0;
}

.load-more-btn {
  padding: 12px 32px;
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.load-more-btn:hover { border-color: var(--primary); }

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}

.empty-icon { font-size: 3rem; margin-bottom: 16px; }
.empty-state h3 { font-size: 1.2rem; margin-bottom: 8px; color: var(--text-primary); }

/* ---- Event Detail Modal ---- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: var(--bg-card);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.5);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: var(--transition);
}

.modal-close:hover { background: rgba(0,0,0,0.8); }
.modal-close svg { width: 20px; height: 20px; }

/* Event Detail Content */
.event-detail-cover {
  width: 100%;
  height: 250px;
  object-fit: cover;
  background: var(--bg-surface);
}

.event-detail-body {
  padding: 20px;
}

.event-detail-category {
  display: inline-block;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.event-detail-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 16px;
  line-height: 1.3;
}

.event-detail-info {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.detail-info-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.detail-info-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.detail-info-icon svg {
  width: 20px;
  height: 20px;
  color: var(--primary-light);
}

.detail-info-text h4 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.detail-info-text p {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.event-detail-price-section {
  background: var(--bg-surface);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.detail-price-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.detail-price-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent);
}

.event-detail-description {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 20px;
}

.event-detail-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}

.detail-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
}

.detail-action-btn:hover { border-color: var(--primary); }
.detail-action-btn.active { background: var(--primary); border-color: var(--primary); }
.detail-action-btn svg { width: 18px; height: 18px; }

.detail-buy-btn {
  grid-column: 1 / -1;
  padding: 14px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.detail-buy-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 20px rgba(108,92,231,0.4); }

.event-detail-social {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 16px 0;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.social-stat {
  display: flex;
  align-items: center;
  gap: 6px;
}

.social-stat svg { width: 16px; height: 16px; }

/* Navigation Links */
.event-detail-nav-links {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.nav-link-btn {
  flex: 1;
  padding: 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.nav-link-btn:hover { border-color: var(--primary); color: var(--text-primary); }

/* ---- Auth Modal ---- */
.auth-modal-content {
  max-width: 420px;
  margin: 0 auto;
  border-radius: var(--radius-lg);
  padding: 40px 24px;
}

.auth-header {
  text-align: center;
  margin-bottom: 28px;
}

.auth-logo { font-size: 2.5rem; display: block; margin-bottom: 12px; }
.auth-header h2 { font-size: 1.5rem; font-weight: 800; margin-bottom: 6px; }
.auth-header p { color: var(--text-secondary); font-size: 0.9rem; }

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-secondary);
}

.form-group input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  outline: none;
  transition: var(--transition);
}

.form-group input:focus { border-color: var(--primary); }
.form-group input::placeholder { color: var(--text-muted); }

.auth-switch {
  text-align: center;
  margin-top: 20px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.auth-switch a { font-weight: 600; }

/* ---- User Menu ---- */
.user-menu {
  position: fixed;
  inset: 0;
  z-index: 1500;
}

.user-menu-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.4);
}

.user-menu-content {
  position: absolute;
  top: var(--header-height);
  right: 0;
  width: 300px;
  max-width: 90vw;
  background: var(--bg-card);
  border-radius: 0 0 0 var(--radius-lg);
  border: 1px solid var(--border);
  padding: 20px;
  box-shadow: var(--shadow-lg);
  animation: slideInRight 0.2s ease;
}

@keyframes slideInRight {
  from { transform: translateX(20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.user-menu-guest p { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 16px; line-height: 1.5; }

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.user-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.user-name { font-weight: 600; font-size: 0.95rem; }
.user-email { font-size: 0.8rem; color: var(--text-muted); }

.user-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.user-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 8px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.9rem;
  transition: var(--transition);
}

.user-nav a:hover { background: rgba(255,255,255,0.05); color: var(--text-primary); }
.user-nav a svg { width: 18px; height: 18px; }
.user-nav .logout-link { color: var(--danger); }

/* ---- Toast Notifications ---- */
.toast-container {
  position: fixed;
  top: calc(var(--header-height) + 10px);
  right: 16px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 380px;
  width: calc(100vw - 32px);
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastIn 0.3s ease;
  font-size: 0.9rem;
}

.toast.toast-out { animation: toastOut 0.3s ease forwards; }

@keyframes toastIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes toastOut {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(100%); opacity: 0; }
}

.toast-success { border-left: 3px solid var(--success); }
.toast-error { border-left: 3px solid var(--danger); }
.toast-info { border-left: 3px solid var(--accent-blue); }

/* ---- Install Banner ---- */
.install-banner {
  position: fixed;
  bottom: calc(var(--bottom-nav-height) + var(--safe-bottom) + 10px);
  left: 16px;
  right: 16px;
  z-index: 900;
  animation: slideUp 0.3s ease;
}

.install-content {
  background: var(--bg-card);
  border: 1px solid var(--primary);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-lg);
}

.install-icon { font-size: 1.5rem; }
.install-text { flex: 1; }
.install-text strong { font-size: 0.9rem; }
.install-text p { font-size: 0.75rem; color: var(--text-secondary); margin-top: 2px; }

.install-dismiss {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
}

/* ---- Bottom Navigation (Mobile) ---- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--bottom-nav-height) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: rgba(10, 10, 26, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 999;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 12px;
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 0.65rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.nav-item svg { width: 22px; height: 22px; }
.nav-item.active { color: var(--primary-light); }
.nav-item:hover { color: var(--text-primary); }

/* ---- Loading Skeleton ---- */
.skeleton {
  background: linear-gradient(90deg, var(--bg-surface) 25%, var(--bg-card-hover) 50%, var(--bg-surface) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-card {
  height: 280px;
  border-radius: var(--radius);
}

/* ---- Onboarding Chips ---- */
.onb-cat-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
}
.onb-cat-chip:has(input:checked) {
  border-color: var(--primary);
  background: rgba(108,92,231,0.15);
  color: var(--primary-light);
}
.onb-cat-chip input { display: none; }

/* ---- Smart Alert Item ---- */
.alert-item {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.alert-item-info { flex: 1; }
.alert-item-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.alert-tag {
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: rgba(108,92,231,0.1);
  color: var(--primary-light);
  font-size: 0.75rem;
}
.alert-delete-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--danger);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.78rem;
}
.alert-delete-btn:hover { border-color: var(--danger); }

/* ---- Reviews Section ---- */
.reviews-section { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--border); }
.reviews-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.review-item {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.review-item:last-child { border-bottom: none; }
.review-user { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.review-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--primary); display: flex; align-items: center;
  justify-content: center; font-size: 0.8rem; font-weight: 700; flex-shrink: 0;
}
.review-name { font-weight: 600; font-size: 0.9rem; }
.review-date { font-size: 0.75rem; color: var(--text-muted); }
.review-stars { color: #feca57; font-size: 0.9rem; margin-bottom: 4px; }
.review-comment { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.5; }

.review-form { background: var(--bg-surface); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.star-rating { display: flex; gap: 4px; margin-bottom: 10px; }
.star-btn {
  background: none; border: none; font-size: 1.5rem; cursor: pointer;
  color: var(--border-light); transition: var(--transition);
}
.star-btn.active, .star-btn:hover { color: #feca57; }

.review-textarea {
  width: 100%; padding: 10px; background: var(--bg-input);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text-primary); resize: vertical; min-height: 60px;
  font-family: inherit; font-size: 0.85rem;
}
.review-textarea:focus { border-color: var(--primary); outline: none; }

/* ---- City Button Active ---- */
.city-opt.active { border-color: var(--primary) !important; background: rgba(108,92,231,0.1) !important; color: var(--primary-light) !important; }

/* ---- Rating Stars (in event card) ---- */
.event-card-rating { display: flex; align-items: center; gap: 4px; font-size: 0.8rem; color: #feca57; }

/* ---- Ghost Mode Indicator ---- */
.ghost-indicator {
  position: fixed; bottom: calc(var(--bottom-nav-height) + var(--safe-bottom) + 6px);
  left: 16px; padding: 4px 12px; background: rgba(108,92,231,0.9);
  color: white; font-size: 0.72rem; font-weight: 600; border-radius: var(--radius-full);
  z-index: 800; display: none;
}
.ghost-indicator.visible { display: block; }

/* ======= RESPONSIVE ======= */

/* Tablet (768px+) */
@media (min-width: 768px) {
  :root {
    --bottom-nav-height: 0px;
  }

  .bottom-nav { display: none; }

  .mode-toggle { display: flex; }

  .app-main {
    padding-bottom: 20px;
  }

  .map-container {
    bottom: 0;
  }

  .events-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .cartelera-view {
    max-width: 900px;
    margin: 0 auto;
  }

  .event-preview {
    bottom: 20px;
    left: 20px;
    right: auto;
    width: 380px;
    border-radius: var(--radius);
  }

  .modal-content {
    max-width: 600px;
    border-radius: var(--radius-lg);
    max-height: 85vh;
    margin: auto;
  }

  .auth-modal-content {
    border-radius: var(--radius-lg);
  }

  .map-controls {
    bottom: 100px;
  }

  .install-banner {
    bottom: 20px;
    left: auto;
    right: 20px;
    max-width: 380px;
  }
}

/* Desktop (1024px+) */
@media (min-width: 1024px) {
  .events-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .cartelera-view {
    max-width: 1100px;
    padding: 0 32px;
  }

  .header-right .search-toggle-btn { display: flex; }

  .collection-card {
    min-width: 260px;
    max-width: 260px;
  }
}

/* Large Desktop (1440px+) */
@media (min-width: 1440px) {
  .events-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .cartelera-view {
    max-width: 1400px;
  }
}

/* Small phones */
@media (max-width: 360px) {
  .filter-chip { padding: 5px 10px; font-size: 0.75rem; }
  .time-pill { padding: 5px 10px; font-size: 0.72rem; }
  .event-card-image { height: 150px; }
  .logo-text { font-size: 1.1rem; }
}

/* Landscape mobile */
@media (max-height: 500px) and (orientation: landscape) {
  :root {
    --header-height: 48px;
    --filter-height: 40px;
    --bottom-nav-height: 50px;
  }

  .event-preview { max-height: 50vh; }
  .modal-content { max-height: 95vh; }
}

/* Dark mode is default, but support light if system prefers */
@media (prefers-color-scheme: light) {
  /* Keep dark theme — RADAR is designed for nightlife/events discovery */
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* Print styles */
@media print {
  .app-header, .bottom-nav, .filter-bar, .map-controls,
  .time-filters, .install-banner, .toast-container { display: none !important; }
  .app-main { padding: 0; }
  .event-card { break-inside: avoid; }
}
