:root {
  --bg: #06080d;
  --panel: rgba(15, 20, 29, 0.78);
  --panel-strong: rgba(22, 28, 39, 0.95);
  --line: rgba(255, 159, 67, 0.34);
  --text: #f6ede5;
  --muted: #b7a89a;
  --accent: #ff8a1f;
  --accent-2: #ffb15c;
  --danger: #ff5f56;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.4);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; }
body {
  font-family: Inter, system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top center, rgba(255, 138, 31, 0.2), transparent 32%),
    radial-gradient(circle at bottom center, rgba(255, 138, 31, 0.08), transparent 40%),
    linear-gradient(180deg, #05070b 0%, #0b1017 100%);
}

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

.site-shell {
  width: min(1400px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 20px 24px;
  margin-bottom: 24px;
}

.brand {
  display: block;
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.04em;
}

.subtitle {
  color: var(--muted);
  margin-top: 6px;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.nav-links a,
.btn,
.chip {
  border: 1px solid rgba(255, 177, 92, 0.23);
  background: linear-gradient(180deg, rgba(255,138,31,0.11), rgba(255,138,31,0.04));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.02), 0 0 0 1px rgba(255,138,31,0.07), 0 8px 20px rgba(0,0,0,0.35);
  border-radius: 18px;
  padding: 12px 16px;
}

.nav-links a:hover,
.btn:hover,
.chip:hover,
.chip.active {
  border-color: rgba(255, 177, 92, 0.52);
  box-shadow: 0 0 0 1px rgba(255,138,31,0.16), 0 0 24px rgba(255,138,31,0.18), 0 12px 30px rgba(0,0,0,0.35);
}

.glass-panel {
  background: linear-gradient(180deg, rgba(20, 25, 34, 0.9), rgba(8, 12, 19, 0.86));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 28px;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,0.04);
  backdrop-filter: blur(10px);
}

.warm-glow {
  position: relative;
  overflow: hidden;
}
.warm-glow::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at top center, rgba(255,138,31,0.24), transparent 50%);
}

.hero-panel,
.hero-inline,
.section-panel,
.gallery-toolbar,
.featured-photo {
  padding: 24px;
  margin-bottom: 24px;
}

.hero-panel {
  display: flex;
  justify-content: space-between;
  gap: 22px;
  align-items: end;
}
.hero-panel h1,
.hero-inline h1,
.section-panel h1,
.section-panel h2,
.featured-photo h2 {
  margin: 6px 0 10px;
  font-size: clamp(1.7rem, 3vw, 2.6rem);
}
.hero-panel p,
.hero-inline p,
.section-panel p,
.featured-meta,
.meta-block {
  color: var(--muted);
  line-height: 1.55;
}
.eyebrow {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.hero-actions,
.hero-inline-actions,
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.45);
}
.btn-primary {
  background: linear-gradient(180deg, rgba(255, 138, 31, 0.34), rgba(255, 138, 31, 0.16));
  color: #fff;
}
.btn-secondary {
  background: rgba(255,255,255,0.05);
  color: #fff;
}
.btn-link { color: var(--accent-2); font-weight: 700; }

.stats-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 24px;
}
.status-card {
  padding: 24px;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
}
.status-card.active-card {
  border-color: rgba(255, 138, 31, 0.45);
  box-shadow: 0 0 0 1px rgba(255,138,31,0.16), 0 0 26px rgba(255,138,31,0.16), var(--shadow);
}
.status-label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
  color: var(--accent-2);
}
.status-value {
  font-size: clamp(2.4rem, 5vw, 4rem);
  font-weight: 800;
  margin: 8px 0;
}
.status-sub { color: var(--muted); }

.two-column-grid,
.map-layout,
.featured-photo {
  display: grid;
  gap: 24px;
  grid-template-columns: 1.25fr 0.85fr;
}

.map-layout-priority {
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  align-items: stretch;
}

.three-panel-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: 1.1fr 0.9fr 1fr;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.stack-list {
  display: grid;
  gap: 12px;
}
.stack-item {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.045);
  border-radius: 18px;
  padding: 14px 16px;
}
.compact-list .stack-item { padding: 12px 14px; }
.item-title {
  font-weight: 700;
  color: #fff;
}
.item-meta, .tiny-meta {
  color: #d3c7bb;
  font-size: 0.92rem;
}
.item-right { text-align: right; }
.empty-state, .empty-state-card { color: var(--muted); }
.empty-state-card { padding: 24px; }

.map-panel,
.sidebar-panel {
  padding: 18px;
}

.sidebar-panel-slim {
  align-self: start;
  position: sticky;
  top: 24px;
}

.map-panel-wide {
  min-width: 0;
}

.map-canvas {
  width: 100%;
  min-height: 76vh;
  border-radius: 22px;
  overflow: hidden;
}

.gallery-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.gallery-card {
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.gallery-card:hover { transform: translateY(-3px); }
.gallery-card img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  display: block;
}
.gallery-card-body { padding: 14px; }

.featured-photo { align-items: start; }
.featured-image-wrap {
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid rgba(255,255,255,0.08);
}
.featured-image {
  width: 100%;
  display: block;
  max-height: 72vh;
  object-fit: contain;
  background: #020406;
}
.meta-block { display: grid; gap: 12px; }

.leaflet-container {
  background: #0e141d;
  font: inherit;
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: #141b25;
  color: #fff;
  border: 1px solid rgba(255,138,31,0.22);
}

.leaflet-popup-content {
  color: #fff;
  font-size: 0.95rem;
  line-height: 1.5;
}

@media (max-width: 980px) {
  .site-header,
  .hero-panel,
  .two-column-grid,
  .map-layout,
  .featured-photo,
  .stats-grid {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }
  .site-shell { width: min(100% - 18px, 1400px); }
  .map-canvas { min-height: 60vh; }
}

.flash-stack { display:grid; gap:12px; margin-bottom:18px; }
.flash-message {
  padding:14px 18px;
  color: #fff;
}
.flash-message.success { border-color: rgba(109, 215, 140, 0.35); }
.flash-message.error { border-color: rgba(255, 95, 86, 0.35); }

.auth-wrap {
  min-height: 70vh;
  display: grid;
  place-items: center;
}
.auth-card {
  width: min(520px, 100%);
  padding: 28px;
  display: grid;
  gap: 16px;
}
.auth-card h1 { margin: 0; }

input, textarea, select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
  color: #fff;
  font: inherit;
}

input::placeholder,
textarea::placeholder {
  color: #c6b9ac;
  opacity: 1;
}

label { display: grid; gap: 8px; }
label span {
  color: #e6d8ca;
  font-size: 0.9rem;
  font-weight: 600;
}
textarea { resize: vertical; }

.admin-form { display: grid; gap: 12px; }
.admin-stack { display: grid; gap: 16px; }
.stack-card {
  padding: 18px;
  border-radius: 20px;
  background: rgba(255,255,255,0.035);
  border: 1px solid rgba(255,255,255,0.08);
}
.admin-actions { display:flex; gap:12px; flex-wrap:wrap; }
.btn-danger {
  background: linear-gradient(180deg, rgba(255,95,86,0.18), rgba(255,95,86,0.08));
  border-color: rgba(255,95,86,0.32);
  color: #fff;
}
.admin-media-grid {
  display:grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}
.media-admin-card { padding: 16px; display:grid; gap: 14px; }
.admin-preview img,
.admin-preview video,
.video-thumb video {
  width: 100%;
  border-radius: 20px;
  display: block;
  aspect-ratio: 4/3;
  object-fit: cover;
  background: #020406;
}
.video-thumb { position: relative; }
.video-badge {
  position: absolute;
  right: 12px;
  top: 12px;
  background: rgba(0,0,0,0.66);
  border: 1px solid rgba(255,177,92,0.35);
  color: var(--accent-2);
  font-weight: 800;
  font-size: 0.78rem;
  padding: 6px 10px;
  border-radius: 999px;
}
.grid-2, .grid-3 {
  display:grid;
  gap: 12px;
}
.grid-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }

@media (max-width: 980px) {
  .grid-2, .grid-3, .admin-media-grid { grid-template-columns: 1fr; }
}

video {
  width: 100%;
  display: block;
  border-radius: 18px;
  background: #020406;
}

@media (max-width: 1180px) {
  .three-panel-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .stats-grid,
  .two-column-grid,
  .map-layout,
  .featured-photo,
  .map-layout-priority {
    grid-template-columns: 1fr;
  }

  .sidebar-panel-slim {
    position: static;
  }

  .map-canvas {
    min-height: 62vh;
  }

  .site-shell {
    width: min(100%, calc(100% - 20px));
  }
}

.map-layout-collapsible {
  transition: grid-template-columns 0.22s ease;
}

.collapsible-rail {
  width: 100%;
  overflow: hidden;
  transition: opacity 0.2s ease, transform 0.2s ease, max-width 0.22s ease, padding 0.22s ease, margin 0.22s ease, border-width 0.22s ease;
}

.map-layout-collapsible.rail-collapsed {
  grid-template-columns: minmax(0, 1fr);
}

.map-layout-collapsible.rail-collapsed .collapsible-rail {
  opacity: 0;
  transform: translateX(-10px);
  max-width: 0;
  padding: 0;
  margin: 0;
  border-width: 0;
  pointer-events: none;
}

.device-list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

@media (max-width: 980px) {
  .map-layout-collapsible,
  .map-layout-collapsible.rail-collapsed {
    grid-template-columns: 1fr;
  }

  .map-layout-collapsible.rail-collapsed .collapsible-rail {
    display: none;
  }

  .map-canvas {
    min-height: 68vh;
  }
}

/* readability + map pin support */

.nav-links a,
.chip {
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.45);
}

.hero-panel p,
.hero-inline p,
.section-panel p,
.featured-meta,
.meta-block,
.empty-state,
.empty-state-card,
.status-sub {
  color: #d7cabd;
}

.glass-panel,
.section-panel,
.stack-card,
.stack-item {
  color: #fff;
}

.glass-panel strong,
.section-panel strong,
.stack-card strong,
.stack-item strong {
  color: #fff;
}

.btn:focus,
.nav-links a:focus,
.chip:focus,
input:focus,
textarea:focus,
select:focus {
  outline: 2px solid rgba(255, 177, 92, 0.65);
  outline-offset: 2px;
}

.stack-item:hover,
.stack-card:hover {
  background: rgba(255,255,255,0.07);
}

.trip-pin-icon {
  background: transparent;
  border: 0;
}

.trip-pin-icon svg {
  display: block;
  overflow: visible;
}

.trip-pin-icon text {
  fill: #fff;
  font-weight: 800;
  paint-order: stroke;
  stroke: rgba(0,0,0,0.15);
  stroke-width: 1px;
}

/* Make dropdown text readable on dark backgrounds */
select,
.admin-select,
select option {
  color: #111 !important;
  background-color: #fff !important;
}

select:focus,
.admin-select:focus {
  color: #111 !important;
  background-color: #fff !important;
}

/* ============================= */
/* Choices.js Icon Dropdown Fix  */
/* Ensures text is readable on dark backgrounds */
/* ============================= */

.icon-select + .choices .choices__inner,
.icon-select + .choices .choices__inner * {
  background-color: #fff !important;  /* white background for contrast */
  color: #222 !important;             /* dark text */
  font-weight: 500 !important;
}

.icon-select + .choices .choices__placeholder,
.icon-select + .choices .choices__placeholder * {
  color: #666 !important;             /* placeholder darker for visibility */
}

.icon-select + .choices .choices__list--dropdown .choices__item,
.icon-select + .choices .choices__list--dropdown .choices__item * {
  background-color: #fff !important;  /* dropdown option background */
  color: #222 !important;             /* dropdown option text */
}

.icon-select + .choices .choices__list--dropdown .choices__item--highlighted,
.icon-select + .choices .choices__list--dropdown .choices__item--highlighted * {
  background-color: #ffb15c !important; /* highlight color */
  color: #111 !important;               /* highlighted text color */
}

.icon-select-preview,
.icon-select-preview * {
  color: #222 !important;               /* preview text */
}

/* ============================= */
/* HARD OVERRIDE - Choices.js FIX */
/* ============================= */

.choices {
  color: #fff !important;
}

.choices__inner {
  background: #121821 !important;
  color: #fff !important;
  border: 1px solid rgba(255,138,31,0.3) !important;
}

.choices__input {
  background: transparent !important;
  color: #fff !important;
}

.choices__list--dropdown {
  background: #1a2230 !important;
  border: 1px solid rgba(255,138,31,0.3) !important;
}

.choices__list--dropdown .choices__item {
  background: transparent !important;
  color: #f6ede5 !important;
}

.choices__list--dropdown .choices__item--highlighted {
  background: #ff8a1f !important;
  color: #111 !important;
}

.choices__placeholder {
  color: #aaa !important;
}

/* ICON PREVIEW FIX */
.icon-select-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff !important;
}

.icon-select-preview img {
  width: 24px;
  height: 24px;
}

/* Choices.js Dark Theme with SVG / Thumbnail Previews */
.icon-select + .choices .choices__inner {
  min-height: 56px !important;   /* ensure space for preview */
  display: flex !important;
  align-items: center !important;
  gap: 0.5rem;
}

.icon-select-preview {
  display: flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
}

.icon-select-preview img {
  width: 32px !important;
  height: 32px !important;
  object-fit: contain !important;
  flex-shrink: 0 !important;
}

.icon-select + .choices .choices__list--dropdown .choices__item img {
  width: 28px !important;
  height: 28px !important;
  object-fit: contain !important;
  margin-right: 8px !important;
}

.icon-select + .choices .choices__list--dropdown .choices__item--highlighted img {
  transform: scale(1.1);
}

/* Text color overrides */
.icon-select + .choices .choices__list--dropdown .choices__item,
.icon-select + .choices .choices__inner span {
  color: #f6ede5 !important;
}


