/* assets/style.css — WebCarto */

/* ── Variables ─────────────────────────────────────────────────────────────── */
:root {
  --sidebar-width:      300px;
  --navbar-height:      52px;
  --sidebar-bg:         #1e2330;
  --sidebar-border:     #2d3347;
  --sidebar-label-col:  #8b92a8;
  --accent-visu:        #4f88e8;
  --accent-dl:          #f0a030;
  --radius:             8px;
  --result-hover:       rgba(79, 136, 232, 0.12);
}

/* ── Reset / Base ───────────────────────────────────────────────────────────── */
* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Inter", system-ui, sans-serif;
  background: #111520;
  color: #c8cde0;
  overflow: hidden;
}

/* ── Navbar ─────────────────────────────────────────────────────────────────── */
.app-navbar {
  height: var(--navbar-height);
  background-color: #14192a !important;
  border-bottom: 1px solid #252b40;
  padding: 0 1rem;
  z-index: 1000;
  position: fixed;
  top: 0;
  width: 100%;
}

.lang-btn {
  font-size: 0.75rem !important;
  padding: 2px 8px !important;
  border: 1px solid #3a4060;
  border-radius: 4px;
  color: #8b92a8 !important;
  margin-left: 4px;
  line-height: 1.6;
}
.lang-btn.active {
  color: #fff !important;
  background: #3a4060;
}

/* ── Main content ────────────────────────────────────────────────────────────── */
#main-content {
  margin-top: var(--navbar-height);
  height: calc(100vh - var(--navbar-height));
  display: flex;
}

/* ── Map page ────────────────────────────────────────────────────────────────── */
.map-page {
  display: flex;
  flex: 1;
  height: 100%;
  overflow: hidden;
}

/* ── Sidebar ─────────────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width 0.28s ease, min-width 0.28s ease;
  position: relative;
  z-index: 100;
}

.sidebar.closed {
  width: 0;
  min-width: 0;
}

.sidebar-toggle-btn {
  position: absolute;
  top: 50%;
  right: -14px;
  transform: translateY(-50%);
  z-index: 200;
  background: #2d3347;
  border: 1px solid #3a4060;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #8b92a8;
  padding: 0;
  font-size: 11px;
  transition: background 0.15s;
}
.sidebar-toggle-btn:hover { background: #3a4060; color: #fff; }

/* ── Sidebar tabs ────────────────────────────────────────────────────────────── */
.sidebar-tabs {
  border-bottom: 1px solid var(--sidebar-border) !important;
}

.sidebar-tabs .nav-link {
  font-size: 0.8rem;
  padding: 8px 10px;
  color: #8b92a8 !important;
  border: none !important;
  border-radius: 0 !important;
}

.sidebar-tabs .nav-link.active {
  color: #fff !important;
  background: transparent !important;
  border-bottom: 2px solid var(--accent-visu) !important;
}

/* DL tab accent */
.sidebar-tabs .nav-item:last-child .nav-link.active {
  border-bottom-color: var(--accent-dl) !important;
}

/* ── Panel content (scrollable) ──────────────────────────────────────────────── */
.panel-content {
  padding: 12px 14px;
  overflow-y: auto;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: #2d3347 transparent;
}

.panel-content::-webkit-scrollbar { width: 4px; }
.panel-content::-webkit-scrollbar-track { background: transparent; }
.panel-content::-webkit-scrollbar-thumb { background: #2d3347; border-radius: 4px; }

/* ── Sidebar form elements ───────────────────────────────────────────────────── */
.sidebar-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--sidebar-label-col);
  margin-bottom: 6px;
  display: block;
}

.sidebar-hr {
  border-color: var(--sidebar-border);
  margin: 10px 0;
  opacity: 1;
}

.sidebar-hint {
  font-size: 0.7rem;
  display: block;
  margin-top: 4px;
}

/* Radio / Checkbox groups */
.radio-group, .check-group { display: flex; flex-direction: column; gap: 4px; }

.radio-label, .check-label {
  font-size: 0.82rem;
  color: #c8cde0;
  cursor: pointer;
}

/* Override Dash DatePickerRange */
.DateRangePickerInput,
.DateInput_input {
  background: #252b40 !important;
  border-color: #3a4060 !important;
  color: #c8cde0 !important;
  font-size: 0.8rem !important;
}

/* Override dcc.Dropdown */
.sidebar-dropdown .Select-control {
  background: #252b40 !important;
  border-color: #3a4060 !important;
  color: #c8cde0 !important;
  font-size: 0.82rem !important;
}
.sidebar-dropdown .Select-menu-outer {
  background: #1e2330 !important;
  border-color: #3a4060 !important;
  z-index: 9999 !important;
}
.sidebar-dropdown .Select-option {
  background: #1e2330 !important;
  color: #c8cde0 !important;
  font-size: 0.82rem !important;
}
.sidebar-dropdown .Select-option:hover,
.sidebar-dropdown .Select-option.is-focused {
  background: #2d3347 !important;
}

/* ── Results list ────────────────────────────────────────────────────────────── */
.results-list {
  max-height: 300px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #2d3347 transparent;
}

.results-list-group .list-group-item {
  background: #252b40 !important;
  border-color: #2d3347 !important;
  color: #c8cde0 !important;
  font-size: 0.8rem;
  padding: 8px 10px;
  cursor: pointer;
  transition: background 0.1s;
}

.results-list-group .list-group-item:hover,
.results-list-group .list-group-item.active {
  background: var(--result-hover) !important;
}

.result-item .badge {
  font-size: 0.65rem;
}

/* ── Map container ───────────────────────────────────────────────────────────── */
.map-container {
  flex: 1;
  position: relative;
  overflow: hidden;
}

/* ── Map legend ──────────────────────────────────────────────────────────────── */
.map-legend {
  position: absolute;
  bottom: 30px;
  right: 12px;
  background: rgba(20, 25, 42, 0.88);
  border: 1px solid #2d3347;
  border-radius: var(--radius);
  padding: 8px 12px;
  font-size: 0.75rem;
  color: #c8cde0;
  z-index: 500;
  min-width: 140px;
  backdrop-filter: blur(4px);
}

/* ── Coordinates bar ─────────────────────────────────────────────────────────── */
.map-coords {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(20, 25, 42, 0.75);
  padding: 2px 10px;
  border-radius: 4px;
  font-size: 0.72rem;
  color: #8b92a8;
  z-index: 500;
  pointer-events: none;
  font-family: monospace;
}

/* ── Info page ───────────────────────────────────────────────────────────────── */
.info-page-wrapper {
  flex: 1;
  overflow-y: auto;
  background: #111520;
}

.info-page {
  color: #c8cde0;
}

.info-page .card {
  background: #1e2330 !important;
  border-color: #2d3347 !important;
  color: #c8cde0 !important;
}

.info-page .card-title {
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
}

.info-page .table {
  color: #c8cde0;
  font-size: 0.85rem;
}

.info-page .table-striped > tbody > tr:nth-of-type(odd) {
  background: rgba(255,255,255,0.04);
}

.info-page .list-group-item {
  background: transparent !important;
  border-color: #2d3347 !important;
  color: #c8cde0 !important;
  font-size: 0.85rem;
}

/* ── Leaflet overrides ───────────────────────────────────────────────────────── */
.leaflet-control-layers {
  background: rgba(20, 25, 42, 0.9) !important;
  border: 1px solid #2d3347 !important;
  color: #c8cde0 !important;
  font-size: 0.8rem;
}

.leaflet-control-layers label {
  color: #c8cde0 !important;
}

.leaflet-bar a {
  background: rgba(20, 25, 42, 0.9) !important;
  border-color: #2d3347 !important;
  color: #c8cde0 !important;
}

/* ── Responsive ──────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  :root { --sidebar-width: 90vw; }
  .sidebar { position: absolute; height: 100%; }
  .sidebar.closed { width: 0; }
}
