:root {
  --font-display: "Space Grotesk", "Inter", system-ui, -apple-system, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;

  --brand: #c2410c;
  --brand-2: #f59e0b;
  --bg: #f7f8fb;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #6b7280;
  --border: #e2e6ef;
  --shadow: 0 10px 28px rgba(17, 24, 39, 0.08);

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --pad-card: 16px;
  --pad-hero: 14px 16px;
}

[data-bs-theme="dark"] {
  --bg: #0b1222;
  --card: #111827;
  --text: #e8ecf8;
  --muted: #9da8c1;
  --border: #1f2a3f;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

[data-bs-theme="dark"] .btn-outline-secondary {
  color: #9fb0d8;
  border-color: #5d6f95;
}

[data-bs-theme="dark"] .btn-outline-secondary:hover,
[data-bs-theme="dark"] .btn-outline-secondary:focus {
  color: #e8ecf8;
  border-color: #9fb0d8;
  background: rgba(159, 176, 216, 0.12);
}

[data-bs-theme="dark"] .link-secondary {
  color: #9fb0d8 !important;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
}

h1, h2, h3 {
  font-family: var(--font-display);
}

.navbar-branding {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.navbar-brand {
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text) !important;
}

.navbar-branding .navbar-nav .nav-link,
.navbar-branding .navbar-toggler {
  color: var(--text);
}

.navbar-branding .navbar-nav .nav-link:hover,
.navbar-branding .navbar-nav .nav-link:focus {
  color: var(--text);
  background: rgba(0, 0, 0, 0.04);
  border-radius: var(--radius-sm);
}

.logo-mark {
  border-radius: var(--radius-sm);
}

.theme-toggle {
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  box-shadow: var(--shadow);
}

.theme-toggle:hover {
  filter: brightness(0.95);
}

.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  box-shadow: var(--shadow);
}

.btn-primary:hover,
.btn-primary:focus {
  filter: brightness(0.95);
  border-color: var(--brand);
}

.card {
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card-body {
  padding: var(--pad-card);
}

.card-title {
  font-weight: 700;
  color: var(--text);
}

.card-subtitle,
.text-muted {
  color: var(--muted) !important;
}

.page-heading {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hero-block {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--pad-hero);
  box-shadow: var(--shadow);
}

.breadcrumb {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  white-space: nowrap;
  overflow-x: auto;
  font-size: 0.95rem;
}

.breadcrumb-item {
  display: inline-flex;
  align-items: center;
}

.breadcrumb-item + .breadcrumb-item::before {
  content: "/";
  color: var(--muted);
  padding: 0 0.5rem;
}

.breadcrumb-item.active {
  color: var(--text);
  opacity: 0.9;
}

.hero-visual {
  border-radius: var(--radius-lg);
  position: relative;
  min-height: 360px;
  overflow: hidden;
}

.hero-visual-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 0;
}

.hero-visual::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.88), rgba(15, 23, 42, 0.68));
  border-radius: var(--radius-lg);
  z-index: 1;
  pointer-events: none;
}

.hero-visual-content {
  position: relative;
  z-index: 2;
  padding: 96px 34px;
  color: #fff;
}

.hero-entity-brand {
  display: flex;
  width: max-content;
  align-items: center;
  justify-content: center;
  max-width: min(240px, 54vw);
  padding: 12px 16px;
  margin: 0 auto 16px auto;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: 0 12px 34px rgba(15, 23, 42, 0.36);
  backdrop-filter: blur(6px);
}

.hero-entity-logo {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 60px;
  object-fit: contain;
}

.hero-visual h1 {
  color: #fff;
  margin-bottom: 8px;
  text-shadow: 0 3px 18px rgba(0, 0, 0, 0.42);
}

.hero-visual .text-muted {
  color: rgba(255, 255, 255, 0.92) !important;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.4);
  font-weight: 500;
}

.hero-visual .pill {
  background: rgba(15, 23, 42, 0.58);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(4px);
  font-weight: 700;
}

@media (max-width: 768px) {
  .hero-entity-brand {
    max-width: min(200px, 64vw);
    padding: 10px 12px;
  }

  .hero-entity-logo {
    max-height: 50px;
  }
}

.filter-bar {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
  margin: 0;
}

.filter-bar label {
  font-weight: 600;
  color: var(--text);
}

.filter-bar .search-label {
  margin-bottom: 6px;
}

.filter-bar .form-select,
.filter-bar .form-control {
  border-radius: var(--radius-sm);
}

.search-shell {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--card) 94%, var(--brand-2) 6%);
  padding: 0 10px;
  cursor: text;
}

.search-shell:focus-within {
  border-color: var(--brand-2);
  box-shadow: none;
}

.search-icon {
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  line-height: 0;
}

.search-icon svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.search-input {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  -moz-appearance: textfield;
  -webkit-appearance: none;
  appearance: none;
  border: 0 !important;
  border-color: transparent !important;
  border-radius: 0;
  outline: none !important;
  background: transparent;
  box-shadow: none !important;
  color: var(--text);
  font: inherit;
  padding: 10px 0;
  margin: 0;
}

.search-input::placeholder {
  color: color-mix(in srgb, var(--muted) 90%, transparent);
}

.search-input:focus,
.search-input:focus-visible {
  border: 0 !important;
  outline: none !important;
  box-shadow: none !important;
}

.search-input::-webkit-search-decoration,
.search-input::-webkit-search-cancel-button,
.search-input::-webkit-search-results-button,
.search-input::-webkit-search-results-decoration {
  -webkit-appearance: none;
}

.search-input::-moz-focus-inner {
  border: 0;
}

.search-help {
  color: var(--muted);
}

.combined-checks {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
}

.circuito-options {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  min-height: 0;
  padding: 0;
}

.circuito-options .circuito-check {
  margin-right: 0;
}

.circuito-options .form-check-input {
  cursor: pointer;
}

.circuito-options .form-check-label {
  cursor: pointer;
}

.circuito-golden-ticket {
  margin: 0;
}

.circuito-golden-ticket .form-check-input,
.circuito-golden-ticket .form-check-label {
  cursor: pointer;
}

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

.filter-actions-spacer {
  visibility: hidden;
}

.filter-actions .btn {
  white-space: nowrap;
}

@media (max-width: 767.98px) {
  .filter-actions {
    justify-content: flex-start;
  }
}

[data-bs-theme="dark"] .search-shell {
  background: color-mix(in srgb, var(--card) 88%, #1e293b 12%);
}

.thumb-poster {
  max-height: 180px;
  height: 180px;
  object-fit: cover;
  object-position: top;
  width: 100%;
  border-radius: var(--radius-sm);
}

.poster-large {
  max-height: 520px;
  object-fit: contain;
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: rgba(249, 115, 22, 0.12);
  color: var(--text);
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.85rem;
}

.badge-golden-ticket {
  background: linear-gradient(135deg, var(--brand-2), var(--brand));
  color: #0b1222;
  border: 1px solid rgba(15, 23, 42, 0.18);
  font-weight: 700;
  letter-spacing: 0.2px;
}

.golden-ticket-callout {
  border: 0;
  background: transparent;
  padding: 0;
}

[data-bs-theme="dark"] .golden-ticket-callout {
  background: transparent;
  border-color: transparent;
}

footer {
  background: var(--card);
  border-top: 1px solid var(--border);
  color: var(--text);
}

/* FullCalendar theme tweaks */
.fc .fc-toolbar.fc-header-toolbar {
  margin-bottom: 1.5rem;
}

.fc .fc-toolbar-title {
  text-transform: capitalize;
  color: var(--text);
  font-family: var(--font-display);
}

.fc .fc-button-primary {
  background: var(--brand);
  border-color: var(--brand);
  box-shadow: var(--shadow);
}

.fc .fc-button-primary:not(:disabled):hover,
.fc .fc-button-primary:not(:disabled):focus {
  filter: brightness(0.95);
  border-color: var(--brand);
}

.map-container {
  height: 420px;
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
}

#mapPage.map-container {
  height: clamp(520px, 68vh, 820px);
}

@media (max-width: 991.98px) {
  #mapPage.map-container {
    height: clamp(420px, 62vh, 700px);
  }
}

.map-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.map-meta .map-title {
  font-family: var(--font-display);
  font-weight: 700;
  margin: 0;
}

.map-hint {
  color: var(--muted);
  font-size: 0.95rem;
}

.fc-theme-standard .fc-scrollgrid {
  border-color: var(--border);
}

.fc .fc-col-header-cell-cushion {
  color: var(--muted);
  font-weight: 600;
  text-decoration: none;
}

.fc .fc-daygrid-day-number {
  color: var(--muted);
  text-decoration: none;
}

.fc .fc-daygrid-day.fc-day-today {
  background: rgba(249, 115, 22, 0.08);
}

.fc .fc-daygrid-event {
  background: rgba(249, 115, 22, 0.15);
  border: 1px solid var(--brand);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 2px 6px;
}
