/* Festival timetable theme */

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

:root {
  --day-color: #ff6b35;
  --day-color-hover: #ff8c5a;
  --day-color-active: #e55a2b;
  --day-bg: rgba(255, 107, 53, 0.1);
  --day-border: #ff6b35;

  --stage-color: #4ecdc4;
  --stage-color-hover: #6dd5ce;
  --stage-color-active: #3bb8b0;
  --stage-bg: rgba(78, 205, 196, 0.1);
  --stage-border: #4ecdc4;

  --band-color: #a855f7;
  --band-color-hover: #c084fc;
  --band-color-active: #9333ea;
  --band-bg: rgba(168, 85, 247, 0.1);
  --band-border: #a855f7;

  --text-high-contrast: #ffffff;
  --text-secondary: #e5e5e5;
  --bg-dark: #12060c;
  --bg-medium: #1e0c14;
  --bg-light: #2e1520;
  --accent-red: #7a2848;
  --accent-cream: #c4a882;
  --accent-gold: #c4a882;
  --shadow-glow: 0 0 20px rgba(122, 40, 72, 0.45);
  --border: rgba(255, 255, 255, 0.12);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: #000;
  color: var(--text-high-contrast);
  line-height: 1.4;
  overflow-x: hidden;
}

/* Top bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 1rem;
  background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-medium) 100%);
  border-bottom: 3px solid var(--accent-red);
  box-shadow: var(--shadow-glow);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}

.brandLogo {
  flex-shrink: 0;
  filter: drop-shadow(0 0 8px rgba(196, 168, 130, 0.35));
}

.brandText {
  font-size: clamp(0.85rem, 3.5vw, 1.15rem);
  font-weight: 900;
  letter-spacing: 0.5px;
  line-height: 1.15;
  text-shadow: 0 0 15px rgba(122, 40, 72, 0.8);
}

.sessionButton {
  border: 2px solid var(--accent-red);
  background: var(--bg-dark);
  color: var(--accent-red);
  padding: 0.5rem 0.85rem;
  border-radius: 20px;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.sessionButton:hover {
  background: var(--accent-red);
  color: var(--text-high-contrast);
}

/* Filters */
.controls {
  background: var(--bg-medium);
  padding: 1rem;
  border-bottom: 2px solid var(--bg-light);
  position: sticky;
  top: 56px;
  z-index: 99;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
}

.filters-container {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  transition: all 0.3s ease;
  flex: 1;
}

.filters.hidden {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  margin-bottom: 0;
}

.filter-btn {
  padding: 0.6rem 1rem;
  border: 2px solid transparent;
  background: var(--bg-dark);
  color: var(--text-high-contrast);
  border-radius: 25px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  min-width: 64px;
  text-align: center;
  outline: none;
}

.filters-toggle {
  background: var(--bg-dark);
  border: 2px solid var(--accent-red);
  color: var(--accent-red);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  cursor: pointer;
  font-size: 0.8rem;
  flex-shrink: 0;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.filters-toggle:hover {
  background: var(--accent-red);
  color: var(--text-high-contrast);
}

.filter-btn[data-filter="day"] {
  border-color: var(--day-border);
  background: var(--day-bg);
  color: var(--day-color);
}

.filter-btn[data-filter="day"].active {
  background: var(--day-color);
  color: var(--text-high-contrast);
  border-color: var(--day-color-active);
  box-shadow: 0 0 12px rgba(255, 107, 53, 0.5);
}

.filter-btn[data-filter="stage"] {
  border-color: var(--stage-border);
  background: var(--stage-bg);
  color: var(--stage-color);
}

.filter-btn[data-filter="stage"].active {
  background: var(--stage-color);
  color: var(--text-high-contrast);
  border-color: var(--stage-color-active);
  box-shadow: 0 0 12px rgba(78, 205, 196, 0.5);
}

/* Timetable */
.main {
  padding: 0;
}

.timetable {
  padding: 1rem;
}

.day-section {
  margin-bottom: 2rem;
}

.day-header {
  background: linear-gradient(135deg, var(--day-color), var(--day-color-hover));
  color: var(--text-high-contrast);
  padding: 1.25rem;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  font-weight: 900;
  font-size: 1.2rem;
  text-align: center;
  box-shadow: 0 4px 12px rgba(255, 107, 53, 0.4);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
  border: 2px solid var(--day-border);
  letter-spacing: 0.5px;
}

.stage-grid {
  display: grid;
  gap: 1rem;
}

@media (min-width: 768px) {
  .stage-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  }
}

.stage-column {
  background: var(--bg-medium);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.stage-header {
  background: linear-gradient(135deg, var(--stage-color), var(--stage-color-hover));
  padding: 1rem;
  text-align: center;
  font-weight: 800;
  border-bottom: 3px solid var(--stage-border);
  font-size: 1.05rem;
  color: var(--text-high-contrast);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
  box-shadow: 0 2px 8px rgba(78, 205, 196, 0.3);
}

.show-list {
  padding: 0.5rem;
}

.show-item {
  background: linear-gradient(135deg, var(--band-bg), rgba(168, 85, 247, 0.2));
  color: var(--text-high-contrast);
  padding: 0.75rem;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 8px rgba(168, 85, 247, 0.3);
  border: 2px solid var(--band-border);
  margin-bottom: 0.5rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.show-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(168, 85, 247, 0.5);
  border-color: var(--band-color-hover);
  background: linear-gradient(135deg, var(--band-color), var(--band-color-hover));
}

.show-item.favorited {
  border-color: var(--accent-gold);
  box-shadow: 0 4px 12px rgba(255, 215, 0, 0.35);
}

.show-item.favorited:hover {
  border-color: #ffed4e;
}

.show-item .band-name {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: bold;
  margin-bottom: 0.25rem;
  line-height: 1.2;
}

.show-item .band-name > span:first-child {
  flex: 1;
}

.show-item .time {
  font-size: 0.8rem;
  opacity: 0.85;
}

.group-favorite-star {
  font-size: 0.85em;
  color: var(--accent-gold);
  flex-shrink: 0;
}

.star {
  border: 0;
  background: transparent;
  color: #666;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0;
  width: 44px;
  height: 44px;
  margin: -13px -11px -13px 0;
  border-radius: 999px;
  line-height: 1;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, color 0.15s ease;
}

.star.filled {
  color: var(--accent-gold);
  filter: drop-shadow(0 0 4px rgba(255, 215, 0, 0.6));
}

.star:active {
  transform: scale(1.2);
}

.loading,
.no-results {
  text-align: center;
  padding: 2rem;
  color: #888;
  font-size: 1.1rem;
}

/* Dialog modals */
.modal::backdrop {
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
}

.modal {
  border: 2px solid var(--accent-red);
  border-radius: 12px;
  background: var(--bg-medium);
  color: var(--text-high-contrast);
  margin: auto;
  max-width: 90%;
  width: calc(100vw - 24px);
  max-height: 85vh;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  padding: 0;
}

.modalContent {
  padding: 0;
  margin: 0;
}

.modalHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #333;
}

.modalTitle {
  font-size: 1.2rem;
  font-weight: bold;
  color: var(--accent-red);
}

.iconButton {
  border: none;
  background: transparent;
  color: var(--text-high-contrast);
  font-size: 1.25rem;
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 4px;
}

.iconButton:hover {
  background: rgba(255, 255, 255, 0.1);
}

.modalBody {
  padding: 1rem 1.25rem 1.25rem;
  overflow-y: auto;
  max-height: calc(85vh - 4rem);
}

.band-group-favorites {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  background: rgba(255, 215, 0, 0.12);
  border: 1px solid rgba(255, 215, 0, 0.35);
  font-size: 0.95rem;
  line-height: 1.35;
  color: var(--text-high-contrast);
}

.band-group-favorites__icon {
  flex-shrink: 0;
  color: var(--accent-gold);
}

.band-group-favorites strong {
  color: var(--accent-gold);
  font-weight: 600;
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.field span {
  color: var(--text-secondary);
  font-size: 12px;
}

.field input {
  border: 2px solid var(--accent-red);
  background: #000;
  color: var(--text-high-contrast);
  padding: 10px;
  border-radius: 8px;
  font-size: 1rem;
}

.field input:focus {
  outline: none;
  border-color: #ff6666;
  box-shadow: 0 0 0 2px rgba(255, 68, 68, 0.2);
}

.actions {
  display: flex;
  justify-content: flex-end;
}

.primary {
  border: 0;
  background: var(--accent-red);
  color: #000;
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: bold;
  cursor: pointer;
}

.primary:hover {
  background: #ff6666;
}

.hint {
  color: #888;
  font-size: 12px;
  margin-top: 10px;
}

/* Band briefing (enrichment HTML inside modal) */
.band-briefing {
  font-size: 14px;
  line-height: 1.5;
}

.band-briefing h2 {
  margin: 1.1em 0 0.4em;
  font-size: 1.05rem;
  color: var(--accent-red);
}

.band-briefing h2:first-child {
  margin-top: 0;
}

.band-briefing p {
  margin: 0.5em 0;
}

.band-briefing ul {
  margin: 0.4em 0 0.8em;
  padding-left: 1.2em;
}

.band-briefing li {
  margin: 0.2em 0;
}

.band-briefing table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.6em 0 1em;
  font-size: 13px;
}

.band-briefing th,
.band-briefing td {
  border: 1px solid var(--border);
  padding: 6px 8px;
  text-align: left;
}

.band-briefing th {
  background: rgba(255, 255, 255, 0.04);
}

.band-briefing a {
  color: #ff6666;
}

.band-briefing a:hover {
  color: #ff8888;
}

.band-briefing--placeholder h3 {
  margin: 0 0 0.5em;
}

.enrichment-error {
  white-space: pre-wrap;
  font-size: 12px;
  color: #888;
  background: rgba(0, 0, 0, 0.25);
  padding: 8px;
  border-radius: 8px;
  overflow-x: auto;
}

.updateBanner {
  position: fixed;
  bottom: 20px;
  left: 20px;
  right: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: var(--accent-red);
  color: #fff;
  padding: 15px;
  border-radius: 8px;
  z-index: 1001;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.3s ease-out;
}

.updateBannerTitle {
  font-weight: bold;
  margin-bottom: 4px;
}

.updateBannerMeta {
  font-size: 12px;
  opacity: 0.85;
}

.updateBannerBtn {
  background: var(--accent-cream);
  color: var(--bg-dark);
  border: none;
  padding: 8px 12px;
  border-radius: 4px;
  font-weight: bold;
  cursor: pointer;
  font-size: 14px;
  flex-shrink: 0;
}

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

@media (max-width: 767px) {
  .filter-btn {
    font-size: 0.8rem;
    padding: 0.55rem 0.85rem;
    min-width: 72px;
  }

  .day-header {
    font-size: 1.1rem;
    padding: 1rem;
  }
}
