:root {
  --bg: #1e293b;
  --panel: #273548;
  --accent: #3aa6ff;
  --text: #f5f5f5;
  --muted: #9ca3af;
  --border: rgba(255,255,255,0.15);
}

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

body {
  font-family: 'Google Sans', Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

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

a:hover {
  text-decoration: underline;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px;
}

#lastUpdated, #tzLabel {
  display: none !important;
}

/* Header */
.header {
  text-align: center;
  margin-bottom: 24px;
}
.header h1 {
  font-size: 2rem;
  margin-bottom: 0.4rem;
}
.header p {
  color: var(--muted);
  font-size: 0.95rem;
}

/* Controls */
.controls {
  position: sticky;
  top: 0;
  z-index: 1; /* must be higher than calendar but below dropdown */
  background: rgba(39, 53, 72, 0.9);
  backdrop-filter: blur(6px);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 14px;
  margin-bottom: 16px;
}

.hidden { display: none !important; }

.topbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
}

.search-wrap {
  flex: 1;
}

.search-wrap input {
  width: 100%;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
}

/* Buttons */
.btn {
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border 0.2s;
}

.btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.btn:active {
  background: rgba(255, 255, 255, 0.12);
}

.btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}

.btn.secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
}

.btn.secondary.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* Month / Week toggle (left-aligned, smaller but same style) */
.view-mode-toggle {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-top: 8px;
}

/* Highlight the current day in week view */
.week-day.today {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  background: rgba(52, 152, 219, 0.15);
  border-radius: 10px;
}

.monthbar {
  display: flex;
  align-items: stretch;
  justify-content: center;
  margin: 16px 0;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06); /* unified background */
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.arrow-btn {
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 1.4rem;
  font-weight: bold;
  cursor: pointer;
  width: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s, transform 0.15s;
}

/* Hover effects */
.arrow-btn:hover {
  background: rgba(52, 152, 219, 0.25);
  color: var(--accent);
  transform: scale(1.05);
}

/* Center section (month/week label) */
.calendar-title {
  flex: 1;
  text-align: center;
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: 0.4px;
  color: var(--text);
  padding: 8px 0;
  background: rgba(255, 255, 255, 0.06); /* same as parent so it blends */
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-weight: 600;
  padding: 4px 0;
  background: rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.calendar-weekday {
  font-size: 0.9rem;
  color: var(--text-muted, rgba(255, 255, 255, 0.75));
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}
/*.filters.collapsed { display: none; } */

.select, .multi-btn {
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font-size: 14px;
}

/* Multi-select dropdown */
.multi {
  position: relative;
  z-index: 2; /* create stacking context above calendar */
  display: inline-block;
}

.multi-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  cursor: pointer;
}

.multi-panel {
  position: absolute;
  top: 110%;
  left: 0;
  z-index: 3;
  display: none;
  background: linear-gradient(180deg, rgba(39,53,72,1) 0%, rgba(39,53,72,0.97) 100%);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px;
  min-width: 200px;
  max-height: 250px;
  overflow-y: auto;
  box-shadow: 0 6px 18px rgba(0,0,0,0.5);
  backdrop-filter: blur(6px);
}

/* Show panel when open */
.multi.open .multi-panel {
  display: block;
}

/* Search bar inside dropdown */
.multi-search {
  width: 100%;
  padding: 8px 14px;
  margin-bottom: 6px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

/* Checkbox list inside dropdown */
.multi-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.multi-list label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  cursor: pointer;
}

.multi-list input[type="checkbox"] {
  accent-color: var(--accent);
}

/* Pills shown when multiple genres selected */
.pill {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 6px;
  font-size: 12px;
}

/* Calendar */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
}
.calendar-day {
  background: var(--panel);
  padding: 8px;
  min-height: 110px;
  border-radius: 6px;
}
.calendar-day.today {
  outline: 2px solid var(--accent);
}

#calendarView,
.calendar-grid,
.calendar-day,
.calendar-header {
  position: relative;
  z-index: 0;
}

.day-number {
  font-size: 12px;
  opacity: 0.7;
}
.event-item {
  background: var(--accent);
  color: #fff;
  border-radius: 6px;
  padding: 4px 6px;
  font-size: 12px;
  margin-top: 3px;
  cursor: pointer;
}
.event-chip {
  background: rgba(0,0,0,0.2);
  border-radius: 999px;
  padding: 1px 6px;
  margin-left: 4px;
  font-size: 11px;
}

/* Event Cards */
.event-cards {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
}
.event-card {
  background: var(--panel);
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  transition: transform 0.2s;
}
.event-card:hover {
  transform: translateY(-3px);
}
.event-image {
  width: 100%;
  height: auto;
  object-fit: contain;
  background: #2d3748;
}
.event-content {
  padding: 14px;
}
.event-title {
  font-weight: 600;
  font-size: 1.1rem;
}
.event-date {
  color: var(--accent);
  margin: 6px 0;
}
.event-description {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 8px 0;
}
.links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.link {
  background: rgba(255,255,255,0.08);
  color: var(--accent);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 13px;
  border: 1px solid var(--border);
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index:  5;
}
.modal {
  background: var(--panel);
  border-radius: 10px;
  max-width: 700px;
  width: 100%;
  overflow: hidden;
  z-index:  6;
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255,255,255,0.05);
  padding: 12px 16px;
}
.modal-body {
  padding: 16px;
}

/* Mobile */
@media (max-width: 768px) {

  #lastUpdated, #tzLabel {
    display: none !important;
  }

  .header h1 {
    font-size: 1.4rem;
    text-align: center;
    margin-bottom: 0.25rem;
  }
  
  .header p {
    font-size: 0.85rem;
    text-align: center;
    opacity: 0.8;
  }
  
  /* --- General adjustments --- */
  .controls {
    border-radius: 0;
    margin: 0 -20px 10px;
    padding: 8px 14px;
  }

  /* Stack top buttons */
  .topbar {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  /* Search bar full width */
  .search-wrap {
    width: 100%;
  }

  /* View toggle (List / Calendar) */
  .view-mode-toggle {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-top: 8px;
  }

  /* Monthbar (arrows + title) */
  .monthbar {
    gap: 4px;
    margin: 10px 0;
    padding: 4px 0;
  }

  .arrow-btn {
    width: 36px;
    font-size: 1.2rem;
  }

  .calendar-title {
    font-size: 1.1rem;
    padding: 8px 0;
  }

  /* --- Filters --- */
  #filters {
    flex-wrap: wrap;
    gap: 8px;
  }

  #filtersToggleBtn {
    width: 100%;
  }

  /* --- Calendar grid --- */
  .calendar-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Week view scroll fix */
  .calendar-grid.week {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .calendar-weekday {
    font-size: 0.75rem;
  }
  
  .week-day {
    padding: 10px;
    border-radius: 8px;
  }

  .search-wrap, .select, multi, .multi-btn, .btn {
    min-height: 44px; /* recommended for mobile accessibility */
  }
}
