/* ============================================
   SF Events Aggregator V2 — Styles
   Dark theme matching site (bg #000, text #e0e0e0)
   ============================================ */

/* ---------- View Switcher Tabs ---------- */
.ev2-view-switcher {
  display: flex;
  gap: 0;
  margin-bottom: 16px;
  border-bottom: 2px solid #333;
}
.ev2-view-tab {
  padding: 10px 24px;
  cursor: pointer;
  color: #888;
  font-size: 0.95rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 3px solid transparent;
  transition: color 0.2s, border-color 0.2s;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: inherit;
}
.ev2-view-tab:hover { color: #ccc; }
.ev2-view-tab.active {
  color: #e0e0e0;
  border-bottom-color: #6c5ce7;
}

/* ---------- Filter Bar ---------- */
.ev2-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 16px;
  padding: 12px;
  background: #111;
  border-radius: 8px;
}

/* ---------- City Toggle Pills ---------- */
.ev2-city-toggle {
  display: flex;
  gap: 0;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid #444;
  flex-shrink: 0;
}
.ev2-city-pill {
  padding: 6px 16px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  background: #1a1a1a;
  color: #888;
  border: none;
  border-right: 1px solid #333;
  transition: all 0.2s;
  font-family: inherit;
  letter-spacing: 0.04em;
}
.ev2-city-pill:last-child { border-right: none; }
.ev2-city-pill:hover { color: #ccc; background: #222; }
.ev2-city-pill.active {
  background: #6c5ce7;
  color: #fff;
}
.ev2-city-pill[data-city="sf"].active { background: #ff6b6b; }
.ev2-city-pill[data-city="nyc"].active { background: #74b9ff; }
.ev2-city-pill[data-city="all"].active { background: #6c5ce7; }
.ev2-category-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ev2-chip {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  cursor: pointer;
  border: 1px solid #444;
  color: #ccc;
  background: #1a1a1a;
  transition: all 0.2s;
  font-family: inherit;
}
.ev2-chip:hover { border-color: #888; }
.ev2-chip.active {
  color: #000;
  border-color: transparent;
}
.ev2-price-dropdown,
.ev2-date-night-toggle {
  padding: 6px 12px;
  background: #1a1a1a;
  color: #ccc;
  border: 1px solid #444;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  font-family: inherit;
}
.ev2-date-night-toggle.active {
  background: #fd79a8;
  color: #000;
  border-color: #fd79a8;
}
.ev2-filter-separator {
  width: 1px;
  height: 24px;
  background: #333;
  margin: 0 4px;
}

/* ---------- View Containers ---------- */
.ev2-view { display: none; }
.ev2-view.active { display: block; }

/* ---------- Calendar View ---------- */
.ev2-cal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.ev2-cal-header h3 { margin: 0; color: #e0e0e0; font-size: 1.1rem; }
.ev2-cal-nav {
  background: none;
  border: 1px solid #444;
  color: #ccc;
  padding: 4px 12px;
  cursor: pointer;
  border-radius: 4px;
  font-family: inherit;
}
.ev2-cal-nav:hover { background: #222; }
.ev2-cal-mode-toggle {
  display: flex;
  gap: 0;
  margin-bottom: 8px;
}
.ev2-cal-mode-btn {
  padding: 4px 14px;
  font-size: 0.8rem;
  cursor: pointer;
  background: #1a1a1a;
  color: #888;
  border: 1px solid #333;
  font-family: inherit;
}
.ev2-cal-mode-btn:first-child { border-radius: 4px 0 0 4px; }
.ev2-cal-mode-btn:last-child { border-radius: 0 4px 4px 0; }
.ev2-cal-mode-btn.active {
  background: #6c5ce7;
  color: #fff;
  border-color: #6c5ce7;
}
.ev2-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.ev2-cal-day-header {
  text-align: center;
  font-size: 0.75rem;
  color: #666;
  padding: 4px 0;
  text-transform: uppercase;
}
.ev2-cal-cell {
  min-height: 70px;
  background: #0d0d0d;
  border: 1px solid #1a1a1a;
  border-radius: 4px;
  padding: 4px;
  cursor: pointer;
  transition: background 0.15s;
  position: relative;
}
.ev2-cal-cell:hover { background: #1a1a1a; }
.ev2-cal-cell.today { border-color: #6c5ce7; }
.ev2-cal-cell.selected { background: #1a1a2e; border-color: #6c5ce7; }
.ev2-cal-cell.other-month { opacity: 0.3; }
.ev2-cal-day-num {
  font-size: 0.8rem;
  color: #999;
  margin-bottom: 2px;
}
.ev2-cal-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}
.ev2-cal-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.ev2-cal-badge {
  position: absolute;
  top: 2px;
  right: 4px;
  font-size: 0.65rem;
}
.ev2-cal-day-events {
  background: #111;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 12px;
  margin-top: 8px;
}
.ev2-cal-day-events h4 { margin: 0 0 8px 0; color: #e0e0e0; font-size: 0.95rem; }
.ev2-cal-event-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid #1a1a1a;
  font-size: 0.85rem;
}
.ev2-cal-event-row:last-child { border-bottom: none; }
.ev2-cal-event-title { color: #e0e0e0; }
.ev2-cal-event-meta { color: #888; font-size: 0.78rem; }
.ev2-cal-event-cat {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.7rem;
  color: #000;
  font-weight: 600;
}

/* ---------- Feed View ---------- */
.ev2-feed-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.ev2-feed-tab {
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.82rem;
  cursor: pointer;
  background: #1a1a1a;
  color: #888;
  border: 1px solid #333;
  transition: all 0.2s;
  font-family: inherit;
}
.ev2-feed-tab.active {
  background: #6c5ce7;
  color: #fff;
  border-color: #6c5ce7;
}
.ev2-feed-list { display: flex; flex-direction: column; gap: 10px; }
.ev2-feed-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: #0d0d0d;
  border: 1px solid #1a1a1a;
  border-radius: 8px;
  padding: 14px;
  transition: border-color 0.2s;
}
.ev2-feed-card:hover { border-color: #333; }
.ev2-feed-score {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  color: #000;
}
.ev2-feed-score.high { background: #00b894; }
.ev2-feed-score.mid { background: #fdcb6e; }
.ev2-feed-score.low { background: #e17055; }
.ev2-feed-body { flex: 1; min-width: 0; }
.ev2-feed-title {
  font-size: 1rem;
  font-weight: 600;
  color: #e0e0e0;
  margin-bottom: 2px;
}
.ev2-feed-venue { color: #888; font-size: 0.82rem; margin-bottom: 4px; }
.ev2-feed-datetime { color: #666; font-size: 0.78rem; margin-bottom: 6px; }
.ev2-feed-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ev2-feed-cat-tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 0.72rem;
  color: #000;
  font-weight: 600;
}
.ev2-feed-price {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.72rem;
  font-weight: 600;
  background: #333;
  color: #ccc;
}
.ev2-feed-price.free { background: #00b894; color: #000; }
.ev2-feed-date-heart { font-size: 0.9rem; }
.ev2-feed-actions { display: flex; align-items: flex-start; gap: 6px; flex-shrink: 0; }
.ev2-going-btn {
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 0.75rem;
  cursor: pointer;
  background: #1a1a1a;
  color: #888;
  border: 1px solid #444;
  transition: all 0.2s;
  font-family: inherit;
}
.ev2-going-btn:hover { border-color: #00b894; color: #00b894; }
.ev2-going-btn.active {
  background: #00b894;
  color: #000;
  border-color: #00b894;
}

/* ---------- Map View ---------- */
.ev2-map-container {
  height: 500px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #333;
}
.ev2-map-container .leaflet-popup-content-wrapper {
  background: #1a1a1a;
  color: #e0e0e0;
  border-radius: 8px;
}
.ev2-map-container .leaflet-popup-tip { background: #1a1a1a; }
.ev2-map-popup-title { font-weight: 700; font-size: 0.9rem; margin-bottom: 4px; }
.ev2-map-popup-venue { color: #888; font-size: 0.8rem; }
.ev2-map-popup-score { font-size: 0.78rem; margin-top: 4px; }
.ev2-map-popup-link {
  display: inline-block;
  margin-top: 6px;
  color: #6c5ce7;
  font-size: 0.78rem;
  text-decoration: none;
}
.ev2-map-popup-link:hover { text-decoration: underline; }

/* ---------- Free This Week Banner ---------- */
.ev2-free-banner {
  background: linear-gradient(135deg, #00b894 0%, #fdcb6e 100%);
  color: #000;
  padding: 14px 18px;
  border-radius: 8px;
  margin-bottom: 16px;
}
.ev2-free-banner h4 {
  margin: 0 0 6px 0;
  font-size: 0.95rem;
}
.ev2-free-banner ul {
  margin: 0;
  padding-left: 18px;
  font-size: 0.82rem;
}
.ev2-free-banner li { margin-bottom: 2px; }

/* ---------- Budget Widget ---------- */
.ev2-budget-widget {
  background: #111;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 16px;
}
.ev2-budget-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.ev2-budget-header h4 { margin: 0; font-size: 0.9rem; color: #e0e0e0; }
.ev2-budget-amount { font-size: 0.85rem; color: #00b894; font-weight: 600; }
.ev2-budget-bar {
  height: 8px;
  background: #1a1a1a;
  border-radius: 4px;
  overflow: hidden;
}
.ev2-budget-fill {
  height: 100%;
  border-radius: 4px;
  background: #00b894;
  transition: width 0.3s;
}
.ev2-budget-fill.warn { background: #fdcb6e; }
.ev2-budget-fill.danger { background: #e17055; }
.ev2-budget-going-list {
  margin-top: 8px;
  font-size: 0.78rem;
  color: #888;
}
.ev2-budget-going-item {
  display: flex;
  justify-content: space-between;
  padding: 2px 0;
}

/* ---------- Weekly Regulars Card ---------- */
.ev2-regulars-card {
  background: #111;
  border: 1px solid #333;
  border-radius: 8px;
  margin-bottom: 16px;
  overflow: hidden;
}
.ev2-regulars-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  cursor: pointer;
  user-select: none;
}
.ev2-regulars-header h4 { margin: 0; font-size: 0.9rem; color: #e0e0e0; }
.ev2-regulars-toggle {
  color: #888;
  font-size: 0.8rem;
  transition: transform 0.2s;
}
.ev2-regulars-card.open .ev2-regulars-toggle { transform: rotate(180deg); }
.ev2-regulars-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.ev2-regulars-card.open .ev2-regulars-body { max-height: 600px; }
.ev2-regulars-day {
  padding: 8px 14px;
  border-top: 1px solid #1a1a1a;
}
.ev2-regulars-day-title {
  font-size: 0.82rem;
  color: #6c5ce7;
  font-weight: 600;
  text-transform: capitalize;
  margin-bottom: 4px;
}
.ev2-regulars-event {
  font-size: 0.8rem;
  color: #ccc;
  padding: 2px 0;
}
.ev2-regulars-event span { color: #888; }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .ev2-view-tab { padding: 8px 14px; font-size: 0.82rem; }
  .ev2-filter-bar { padding: 8px; }
  .ev2-cal-cell { min-height: 50px; }
  .ev2-cal-dot { width: 6px; height: 6px; }
  .ev2-map-container { height: 350px; }
  .ev2-feed-card { flex-direction: column; }
  .ev2-feed-score { width: 36px; height: 36px; font-size: 0.78rem; }
  .ev2-feed-tabs { flex-wrap: wrap; }
  .ev2-sources-controls { flex-direction: column; }
  .ev2-source-item { flex-direction: column; gap: 4px; }
}

/* ---------- Sources View ---------- */
.ev2-sources-container { max-width: 900px; }
.ev2-sources-header h3 { margin: 0 0 4px; font-size: 1.2rem; color: #e0e0e0; }
.ev2-sources-count { font-size: 0.85rem; color: #888; font-weight: 400; margin-left: 8px; }
.ev2-sources-stats { display: flex; gap: 16px; margin-bottom: 12px; font-size: 0.85rem; }
.ev2-src-stat.enabled { color: #00b894; }
.ev2-src-stat.disabled { color: #888; }
.ev2-sources-loading { color: #888; padding: 32px; text-align: center; }

.ev2-sources-controls {
  display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap;
}
.ev2-sources-search {
  flex: 1; min-width: 200px; padding: 8px 12px;
  background: #111; border: 1px solid #333; border-radius: 6px;
  color: #e0e0e0; font-size: 0.9rem;
}
.ev2-sources-search::placeholder { color: #666; }
.ev2-sources-search:focus { outline: none; border-color: #6c5ce7; }
.ev2-sources-method-filter, .ev2-sources-status-filter {
  padding: 8px 12px; background: #111; border: 1px solid #333;
  border-radius: 6px; color: #e0e0e0; font-size: 0.85rem;
}

.ev2-sources-group { margin-bottom: 16px; }
.ev2-sources-group-header {
  padding: 6px 12px; background: #111; display: flex;
  justify-content: space-between; align-items: center;
  border-radius: 4px; margin-bottom: 4px;
}
.ev2-sources-cat-name { font-weight: 600; text-transform: capitalize; color: #ccc; font-size: 0.95rem; }
.ev2-sources-cat-count {
  background: #222; color: #888; padding: 2px 8px;
  border-radius: 10px; font-size: 0.8rem;
}

.ev2-sources-list { display: flex; flex-direction: column; gap: 2px; }
.ev2-source-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 12px 6px 20px; border-radius: 4px;
  transition: background 0.15s;
}
.ev2-source-item:hover { background: #111; }
.ev2-source-item.disabled { opacity: 0.5; }

.ev2-source-main { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.ev2-src-status { font-size: 0.75rem; flex-shrink: 0; }
.ev2-src-name { font-weight: 500; color: #e0e0e0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev2-src-method {
  font-size: 0.7rem; padding: 1px 6px; border-radius: 3px;
  background: #222; color: #aaa; white-space: nowrap; flex-shrink: 0;
}
.ev2-src-method-css { color: #74b9ff; }
.ev2-src-method-ical { color: #55efc4; }
.ev2-src-method-rss { color: #ffd93d; }
.ev2-src-method-json-api { color: #a29bfe; }
.ev2-src-method-llm-extract { color: #fd79a8; }

/* ---------- Source Status Badges ---------- */
.ev2-src-status-badge, .ev2-src-stat-badge {
  font-size: 0.7rem; padding: 1px 8px; border-radius: 3px;
  white-space: nowrap; flex-shrink: 0; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.03em;
}
.ev2-status-working { background: #00b894; color: #fff; }
.ev2-status-configured { background: #0984e3; color: #fff; }
.ev2-status-needs-manual { background: #e17055; color: #fff; }
.ev2-status-dead { background: #d63031; color: #fff; }

.ev2-sources-stats {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
}
.ev2-src-stat-badge { font-size: 0.75rem; padding: 2px 10px; border-radius: 4px; }

.ev2-source-meta { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.ev2-src-url {
  color: #6c5ce7; font-size: 0.8rem; text-decoration: none;
  max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ev2-src-url:hover { text-decoration: underline; }
.ev2-src-venue { color: #666; font-size: 0.8rem; white-space: nowrap; }
