:root {
  --bg: #0b0c0e;
  --panel: #16181c;
  --border: #2a2d33;
  --text: #f2f2f0;
  --muted: #9a9ea6;
  --accent: #f2b807;
  --accent-2: #e0480f;
}

* { box-sizing: border-box; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

html, body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

body {
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  z-index: 1000;
}

.brand { display: flex; align-items: center; }
.brand-logo { height: 28px; width: auto; display: block; }

.pill-dropdown { position: relative; }

.pill-dropdown-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #0f1013;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 14px;
  color: var(--text);
  font-size: 0.82rem;
  cursor: pointer;
  white-space: nowrap;
}
.pill-dropdown-trigger:hover { border-color: var(--accent); }

.pill-icon { width: 15px; height: 15px; flex-shrink: 0; }
.pill-dropdown-trigger .pill-icon { color: var(--accent); }
.pill-chevron {
  width: 14px;
  height: 14px;
  color: var(--muted);
  flex-shrink: 0;
  transition: transform 0.15s ease;
}
.pill-dropdown-trigger[aria-expanded="true"] .pill-chevron { transform: rotate(180deg); }

.pill-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 190px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px;
  margin: 0;
  list-style: none;
  z-index: 1200;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
.pill-dropdown-menu[hidden] { display: none; }
.pill-dropdown-menu li { margin: 0; }
.pill-dropdown-menu button,
.pill-dropdown-menu a {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 6px;
  background: none;
  border: none;
  color: var(--text);
  font-size: 0.85rem;
  cursor: pointer;
  text-decoration: none;
  text-align: left;
}
.pill-dropdown-menu button:hover,
.pill-dropdown-menu a:hover { background: #1f2227; }
.pill-dropdown-menu [aria-current="page"],
.pill-dropdown-menu [aria-selected="true"] { color: var(--accent); }
.pill-dropdown-menu .menu-icon { width: 15px; height: 15px; flex-shrink: 0; color: var(--muted); }

.search-wrap { position: relative; flex: 1 1 240px; min-width: 180px; }

#search {
  width: 100%;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #0f1013;
  color: var(--text);
  font-size: 0.95rem;
}
#search:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.suggestions {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  max-height: 320px;
  overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.suggestions button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  font-size: 0.9rem;
}
.suggestions button:hover, .suggestions button:focus { background: #1f2227; }
.suggestions small { display: block; color: var(--muted); }

.filters { display: flex; gap: 8px; flex-wrap: wrap; }

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 0.82rem;
  cursor: pointer;
  white-space: nowrap;
}
.filter-chip:hover { border-color: var(--accent); color: var(--text); }
.filter-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #1a1400;
  font-weight: 600;
}

.count { color: var(--muted); font-size: 0.82rem; white-space: nowrap; }

#map { flex: 1; background: var(--bg); }

.sitefooter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 6px 16px;
  background: var(--panel);
  color: var(--muted);
  font-size: 0.7rem;
  border-top: 1px solid var(--border);
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  margin-left: 4px;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--accent); }
.site-nav .nav-sep { margin: 0 6px; color: var(--border); }

.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 20px 60px;
  line-height: 1.6;
  overflow-y: auto;
  width: 100%;
}
.page h1 { color: var(--accent); font-size: 1.4rem; }
.page h2 { font-size: 1.05rem; margin-top: 28px; }
.page a { color: var(--accent); }
.page .back-link { display: inline-block; margin-bottom: 20px; color: var(--muted); text-decoration: none; }
.page .back-link:hover { color: var(--accent); }

.page-wide { max-width: 1100px; }
.page-info { max-width: 900px; }

.table-wrap { overflow-x: auto; }

.scroll-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 8px;
  padding: 6px 10px;
  border-radius: 6px;
  background: rgba(242, 184, 7, 0.12);
  border: 1px solid rgba(242, 184, 7, 0.35);
  color: var(--accent);
  font-size: 0.8rem;
  width: fit-content;
  transition: opacity 0.2s ease;
}
.scroll-hint[hidden] { display: none; }

#cinema-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  table-layout: fixed;
}
#cinema-table th, #cinema-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  overflow-wrap: break-word;
}
#cinema-table th:nth-child(1), #cinema-table td:nth-child(1) { width: 25%; }
#cinema-table th:nth-child(2), #cinema-table td:nth-child(2) { width: 21%; }
#cinema-table th:nth-child(3), #cinema-table td:nth-child(3) { width: 20%; }
#cinema-table th:nth-child(4), #cinema-table td:nth-child(4) { width: 10%; white-space: nowrap; }
#cinema-table th:nth-child(5), #cinema-table td:nth-child(5) { width: 17%; }
#cinema-table th:nth-child(6), #cinema-table td:nth-child(6) { width: 7%; white-space: nowrap; text-align: center; }
#cinema-table th {
  cursor: pointer;
  color: var(--muted);
  font-weight: 600;
  position: sticky;
  top: 0;
  background: var(--bg);
  user-select: none;
}
#cinema-table th:hover { color: var(--text); }
#cinema-table th.sort-asc::after { content: " \25B2"; color: var(--accent); }
#cinema-table th.sort-desc::after { content: " \25BC"; color: var(--accent); }
#cinema-table tbody tr:hover { background: #1a1c20; }

@media (max-width: 700px) {
  #cinema-table { min-width: 640px; }
}

/* Leaflet overrides for dark theme */
.leaflet-popup-content-wrapper, .leaflet-popup-tip {
  background: var(--panel);
  color: var(--text);
}
.leaflet-popup-content { margin: 12px 14px; font-size: 0.85rem; }
.leaflet-popup-content h3 { margin: 0 0 6px; font-size: 0.95rem; color: var(--accent); }
.leaflet-popup-content dl { margin: 6px 0 0; display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; }
.leaflet-popup-content dt { color: var(--muted); }
.leaflet-popup-content dd { margin: 0; }
.leaflet-popup-content .muted { color: var(--muted); font-size: 0.8em; }
.leaflet-popup-content .popup-note {
  margin: 8px 0 0;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  color: #7fc2ec;
  font-size: 0.8em;
}
.leaflet-container a.leaflet-popup-close-button { color: var(--muted); }

.imax-pin {
  width: 14px;
  height: 14px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  background: var(--accent);
  border: 2px solid #1a1400;
}
.imax-pin.f70 { background: var(--accent-2); }
.imax-pin.nc { background: #3ba7e0; border-color: #0d2436; }

.marker-cluster-small, .marker-cluster-medium, .marker-cluster-large {
  background-color: rgba(242, 184, 7, 0.25);
}
.marker-cluster-small div, .marker-cluster-medium div, .marker-cluster-large div {
  background-color: rgba(242, 184, 7, 0.85);
  color: #1a1400;
  font-weight: 700;
}

@media (max-width: 640px) {
  .topbar { gap: 8px; }
  .count { display: none; }
}

.consent-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px 18px;
  background: var(--panel);
  border-top: 1px solid var(--border);
  box-shadow: 0 -8px 24px rgba(0,0,0,0.4);
}
.consent-bar p { margin: 0; font-size: 0.85rem; color: var(--text); max-width: 640px; }
.consent-bar a { color: var(--accent); }

.consent-actions { display: flex; gap: 8px; flex-shrink: 0; }

.consent-btn {
  padding: 9px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-size: 0.85rem;
  cursor: pointer;
}
.consent-btn:hover { border-color: var(--accent); }
.consent-accept {
  background: var(--accent);
  border-color: var(--accent);
  color: #1a1400;
  font-weight: 600;
}

.cookie-settings-link {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.7rem;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}
.cookie-settings-link:hover { color: var(--accent); }
