/* === Band Tracker — Dark Theme === */
:root {
  --bg-primary: #1a1a2e;
  --bg-secondary: #16213e;
  --bg-panel: #0f3460;
  --accent: #e94560;
  --accent-hover: #ff6b6b;
  --success: #00ff88;
  --text-primary: #eee;
  --text-secondary: #aaa;
  --text-muted: #666;
  --border: #0f3460;
  --radius: 8px;
  --shadow: 0 4px 12px rgba(0,0,0,0.5);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  height: 100vh;
  overflow: hidden;
}

#map { height: 100vh; width: 100vw; z-index: 1; }

/* === Search === */
.search-container {
  position: fixed;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  width: 90%;
  max-width: 500px;
}

.search-box {
  display: flex;
  background: var(--bg-secondary);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

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

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

.search-box button {
  padding: 12px 16px;
  background: var(--bg-panel);
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 16px;
  transition: all 0.2s;
}

.search-box button:hover { background: var(--accent); color: white; }

.search-dropdown {
  position: absolute;
  top: 100%;
  left: 0; right: 0;
  margin-top: 4px;
  background: var(--bg-secondary);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  max-height: 300px;
  overflow-y: auto;
  box-shadow: var(--shadow);
}

.search-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.2s;
}

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

.search-item img {
  width: 40px; height: 40px;
  border-radius: 50%;
  margin-right: 12px;
  object-fit: cover;
}

.search-item .artist-name { font-weight: 600; font-size: 15px; }
.search-item .artist-meta { font-size: 12px; color: var(--text-muted); }

.search-loading, .search-empty {
  padding: 16px;
  text-align: center;
  color: var(--text-secondary);
}

/* === Favorites Toggle === */
.fav-toggle {
  position: fixed;
  top: 15px;
  left: 15px;
  z-index: 1000;
  width: 44px; height: 44px;
  background: var(--bg-secondary);
  border: 2px solid var(--border);
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: all 0.2s;
}

.fav-toggle:hover { background: var(--accent); transform: scale(1.05); }

.fav-toggle .badge {
  position: absolute;
  top: -5px; right: -5px;
  background: var(--accent);
  color: white;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

/* === Sidebar === */
.fav-sidebar {
  position: fixed;
  top: 0; left: 0;
  width: 320px; height: 100vh;
  background: var(--bg-secondary);
  border-right: 2px solid var(--border);
  z-index: 2000;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
}

.fav-sidebar.open { transform: translateX(0); }

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 2px solid var(--border);
}

.sidebar-header h2 { font-size: 18px; }

.close-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
}

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

.fav-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

.empty-msg {
  text-align: center;
  color: var(--text-muted);
  padding: 40px 20px;
}

.fav-item {
  display: flex;
  align-items: center;
  padding: 12px;
  margin-bottom: 8px;
  background: var(--bg-primary);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: all 0.2s;
}

.fav-item:hover { border-color: var(--accent); }

.fav-item img {
  width: 48px; height: 48px;
  border-radius: 50%;
  margin-right: 12px;
  object-fit: cover;
}

.fav-item .fav-info { flex: 1; }

.fav-item .fav-name { font-weight: 600; font-size: 14px; margin-bottom: 2px; }
.fav-item .fav-dates { font-size: 12px; color: var(--text-muted); }

.fav-item .fav-actions { display: flex; gap: 4px; }

.fav-actions button {
  background: var(--bg-panel);
  border: none;
  color: var(--text-secondary);
  padding: 6px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
}

.fav-actions button:hover { background: var(--accent); color: white; }

.fav-actions .btn-toggle.active { background: var(--success); color: var(--bg-primary); }

.sidebar-footer {
  padding: 16px;
  border-top: 2px solid var(--border);
}

/* === Band Panel === */
.band-panel {
  position: fixed;
  top: 80px;
  right: 15px;
  width: 340px;
  max-height: calc(100vh - 100px);
  background: var(--bg-secondary);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  z-index: 1000;
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.panel-header {
  display: flex;
  align-items: center;
  padding: 16px;
  gap: 12px;
  border-bottom: 2px solid var(--border);
}

#band-image {
  width: 60px; height: 60px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent);
}

.band-title { flex: 1; }
#band-name { font-size: 18px; margin-bottom: 4px; }
#band-stats { font-size: 12px; color: var(--text-muted); }

.panel-body { flex: 1; overflow-y: auto; padding: 16px; }

.panel-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.btn-primary, .btn-danger {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s;
}

.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-hover); }

.btn-danger {
  background: transparent;
  border: 2px solid var(--accent);
  color: var(--accent);
}

.btn-danger:hover { background: var(--accent); color: white; }

/* === Event List === */
.event-list { display: flex; flex-direction: column; gap: 8px; }

.event-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  background: var(--bg-primary);
  border-radius: var(--radius);
  border-left: 3px solid var(--text-muted);
  transition: all 0.2s;
}

.event-item.upcoming { border-left-color: var(--accent); }
.event-item.next { border-left-color: var(--success); background: rgba(0,255,136,0.1); }

.event-date { text-align: center; min-width: 48px; }
.event-date .day { font-size: 22px; font-weight: 700; color: var(--accent); }
.event-item.next .event-date .day { color: var(--success); }
.event-date .month { font-size: 11px; text-transform: uppercase; color: var(--text-muted); }

.event-info { flex: 1; }
.event-info .venue { font-weight: 600; font-size: 14px; margin-bottom: 2px; }
.event-info .location { font-size: 12px; color: var(--text-muted); }

/* === Toast === */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 24px;
  background: var(--bg-secondary);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  z-index: 3000;
  box-shadow: var(--shadow);
  animation: toastIn 0.3s ease;
}

.toast.error { border-color: var(--accent); color: var(--accent-hover); }
.toast.success { border-color: var(--success); color: var(--success); }

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

/* === Marker Styles === */
.custom-marker {
  background: var(--accent);
  border: 3px solid white;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0,0,0,0.6);
}

.marker-past { background: #666 !important; border-color: #999 !important; }
.marker-next {
  background: var(--success) !important;
  border-color: white !important;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(0,255,136,0.7); }
  70% { box-shadow: 0 0 0 12px rgba(0,255,136,0); }
  100% { box-shadow: 0 0 0 0 rgba(0,255,136,0); }
}

/* === Route Line === */
.tour-route {
  stroke: var(--accent);
  stroke-width: 3;
  stroke-opacity: 0.7;
  stroke-dasharray: 10, 8;
  animation: dash 30s linear infinite;
}

@keyframes dash {
  to { stroke-dashoffset: -1000; }
}

/* === Tooltip === */
.leaflet-tooltip {
  background: var(--bg-secondary) !important;
  border: 2px solid var(--border) !important;
  color: var(--text-primary) !important;
  border-radius: var(--radius) !important;
  padding: 8px 12px !important;
  font-size: 13px !important;
  box-shadow: var(--shadow) !important;
}

.leaflet-tooltip-left:before, .leaflet-tooltip-right:before {
  border-left-color: var(--border) !important;
  border-right-color: var(--border) !important;
}

.hidden { display: none !important; }

/* === Mobile === */
@media (max-width: 600px) {
  .search-container { width: calc(100% - 80px); left: 70px; transform: none; }
  .fav-sidebar { width: 100%; }
  .band-panel {
    width: calc(100% - 30px);
    top: auto;
    bottom: 15px;
    max-height: 50vh;
  }
  #band-image { width: 44px; height: 44px; }
  #band-name { font-size: 15px; }
}
