:root {
  --header-dark: #5c3d1e;
  --header-mid: #8b5a2b;
  --panel-head: #7a4f26;
  --panel-bg: #f5e6c8;
  --row-label: #8b2500;
  --row-value: #2c1810;
  --accent: #c45c00;
  --good: #1a6b3d;
  --bad: #8b2635;
  --cream: #faf3e8;
}

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

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: linear-gradient(180deg, #6b7a3a 0%, #c9a86c 35%, #f0dcc0 100%);
  min-height: 100vh;
  color: var(--row-value);
}

.top-banner {
  background: linear-gradient(90deg, #4a5f28, #7a8f45, #c4a060);
  color: #fff;
  padding: 1rem 1.25rem 1.25rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: start;
}

.top-banner .moon-icon { font-size: 2.5rem; }
.top-banner .center { text-align: center; }
.top-banner .center h2 { font-size: 1.1rem; font-weight: 600; }
.top-banner .center .sub { font-size: 0.85rem; opacity: 0.95; margin-top: 0.2rem; }
.top-banner .date-big {
  font-size: 1.35rem;
  font-weight: 700;
  text-align: right;
  line-height: 1.3;
}

.search-bar {
  background: rgba(255,255,255,0.95);
  margin: 0 0.75rem;
  padding: 0.75rem;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: end;
}

.search-bar input {
  padding: 0.5rem;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 0.9rem;
}

.search-bar .btn {
  padding: 0.55rem 1rem;
  background: var(--header-mid);
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
}

.search-bar .btn-gps {
  background: #6b7a3a;
}

.lang-select {
  padding: 0.5rem 0.65rem;
  border: 1px solid #c9a060;
  border-radius: 8px;
  font-size: 0.9rem;
  background: #fffaf0;
  font-weight: 600;
  color: var(--header-dark);
  min-width: 6.5rem;
}

.chips { display: flex; flex-wrap: wrap; gap: 0.35rem; width: 100%; }
.chip {
  padding: 0.25rem 0.6rem;
  background: #fff4e0;
  border: 1px solid #c9a060;
  border-radius: 999px;
  font-size: 0.75rem;
  cursor: pointer;
}

.main { max-width: 720px; margin: 0 auto 2rem; padding: 0 0.75rem; }

.panel {
  margin-top: 0.75rem;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.panel-head {
  background: var(--panel-head);
  color: #fff;
  padding: 0.65rem 1rem;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.panel-head::after { content: '▼'; font-size: 0.7rem; opacity: 0.8; }
.panel.collapsed .panel-head::after { content: '▶'; }
.panel.collapsed .panel-body { display: none; }

.panel-body {
  background: var(--panel-bg);
  padding: 0;
}

.data-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid rgba(139, 90, 43, 0.2);
}

.data-cell {
  padding: 0.65rem 0.85rem;
  border-right: 1px solid rgba(139, 90, 43, 0.15);
  min-height: 3rem;
}

.data-cell:last-child { border-right: none; }
.data-cell.full { grid-column: 1 / -1; }

.cell-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--row-label);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.cell-value {
  font-size: 0.88rem;
  color: var(--row-value);
  margin-top: 0.2rem;
  line-height: 1.35;
}

.cell-value.good { color: var(--good); font-weight: 600; }
.cell-value.bad { color: var(--bad); }

.status-bar {
  text-align: center;
  padding: 2rem;
  color: #fff;
}
.status-bar.error {
  background: #fff0f0;
  color: var(--bad);
  margin: 1rem;
  border-radius: 8px;
}
.hidden { display: none !important; }

.spinner {
  width: 36px; height: 36px;
  border: 3px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 0.75rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

.footer-note {
  text-align: center;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.9);
  padding: 1rem;
}

/* Festivals panel */
.panel-festivals-highlight .panel-head {
  background: linear-gradient(90deg, #8b2500, #c45c00);
}

.fest-badge {
  background: rgba(255, 255, 255, 0.25);
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.8rem;
  margin-left: 0.35rem;
}

.festivals-body {
  padding: 0.85rem 1rem 1rem !important;
}

.festivals-count {
  font-size: 0.8rem;
  color: var(--row-label);
  font-weight: 600;
  margin-bottom: 0.65rem;
}

.fest-group {
  margin-bottom: 0.75rem;
}

.fest-group:last-child {
  margin-bottom: 0;
}

.fest-group-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
  margin-bottom: 0.4rem;
}

.fest-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.fest-chip {
  display: inline-block;
  padding: 0.35rem 0.65rem;
  background: #fff;
  border: 1px solid #d4a574;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--row-value);
  line-height: 1.3;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.fest-chip.fest-major {
  background: linear-gradient(135deg, #fff8e7, #ffe4b5);
  border-color: #c45c00;
  color: #8b2500;
}

.fest-chip.fest-solar {
  background: linear-gradient(135deg, #e8f4e8, #d4ecd4);
  border-color: #4a7c4a;
  color: #1a4d1a;
}

.fest-chip.fest-recurring {
  background: #faf3e8;
  border-color: #b8956a;
}

@media (max-width: 500px) {
  .data-row { grid-template-columns: 1fr; }
  .data-cell { border-right: none; }
}
