/* Fonts lokal */
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 300;
  src: url('../fonts/CormorantGaramond-300.ttf') format('truetype');
}
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 400;
  src: url('../fonts/CormorantGaramond-400.ttf') format('truetype');
}
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 600;
  src: url('../fonts/CormorantGaramond-600.ttf') format('truetype');
}
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: italic;
  font-weight: 300;
  src: url('../fonts/CormorantGaramond-italic-300.ttf') format('truetype');
}
@font-face {
  font-family: 'Fira Code';
  font-style: normal;
  font-weight: 300;
  src: url('../fonts/FiraCode-300.ttf') format('truetype');
}
@font-face {
  font-family: 'Fira Code';
  font-style: normal;
  font-weight: 400;
  src: url('../fonts/FiraCode-400.ttf') format('truetype');
}

/* ── Variables ─────────────────────────────────────────── */
:root {
  --bg:         #f4f6fb;
  --panel:      #ffffff;
  --panel-2:    #eef1f8;
  --border:     rgba(60, 90, 160, 0.12);
  --border-hi:  rgba(60, 90, 160, 0.3);
  --text:       #1a2540;
  --text-dim:   #7a8aaa;
  --accent:     #2563eb;
  --accent-light: rgba(37, 99, 235, 0.1);
  --shadow:     0 2px 12px rgba(30, 50, 120, 0.08);
  --shadow-lg:  0 8px 32px rgba(30, 50, 120, 0.14);

  /* type colours — slightly saturated for light bg */
  --col-sternwarte:    #2563eb;
  --col-planetarium:   #7c3aed;
  --col-observatorium: #059669;
  --col-dunkel:        #d97706;
}

/* ── Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Fira Code', monospace;
  font-size: 13px;
  display: flex;
  flex-direction: column;
}

/* ── Header ────────────────────────────────────────────── */
#header {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.7rem 1.5rem;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
  flex-shrink: 0;
}

.header-brand {
  display: flex;
  align-items: baseline;
  gap: 1.5rem;
  min-width: 0;
}

#header h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.85rem;
  font-weight: 300;
  letter-spacing: 0.1em;
  color: var(--text);
  text-transform: uppercase;
}

#header h1 span {
  color: var(--accent);
}

#header p {
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.header-search {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
  margin-left: auto;
  padding: 0.45rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: linear-gradient(180deg, #ffffff 0%, var(--panel-2) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.search-label {
  font-size: 0.58rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-dim);
  white-space: nowrap;
}

.header-search input {
  width: min(30vw, 320px);
  min-width: 180px;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font-family: 'Fira Code', monospace;
  font-size: 0.72rem;
}

.header-search input::placeholder {
  color: var(--text-dim);
}

.header-right {
  font-size: 0.65rem;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  white-space: nowrap;
}

/* ── Layout ────────────────────────────────────────────── */
#app {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ── Sidebar ───────────────────────────────────────────── */
#sidebar {
  width: 260px;
  flex-shrink: 0;
  background: var(--panel);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 2px 0 8px rgba(30, 50, 120, 0.04);
}

.sidebar-section {
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--panel-2);
}

.sidebar-section h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.62rem;
  font-weight: 400;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 0.9rem;
}

/* Filter checkboxes */
.filter-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.55rem;
  cursor: pointer;
  user-select: none;
}

.filter-item input[type="checkbox"] { display: none; }

.filter-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid currentColor;
  background: transparent;
  transition: background 0.2s;
  flex-shrink: 0;
}

.filter-item input:checked ~ .filter-dot {
  background: currentColor;
}

.filter-label {
  flex: 1;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text);
}

.filter-count {
  font-size: 0.6rem;
  color: var(--text-dim);
  background: var(--border);
  padding: 0.1rem 0.45rem;
  border-radius: 10px;
}

/* Landmark list */
#landmark-list {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.landmark-item {
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
  border-left: 3px solid transparent;
}

.landmark-item:hover {
  background: var(--accent-light);
}

.landmark-item.active {
  background: var(--accent-light);
  border-left-color: var(--accent);
}

.landmark-item-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1rem;
  font-weight: 400;
  color: var(--text);
  margin-bottom: 0.25rem;
  line-height: 1.2;
}

.landmark-item-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.type-badge {
  font-size: 0.52rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 0.12rem 0.45rem;
  border-radius: 3px;
  border: 1px solid currentColor;
  background: transparent;
}

.landmark-item-land {
  font-size: 0.6rem;
  color: var(--text-dim);
}

/* ── Map ───────────────────────────────────────────────── */
#map {
  flex: 1;
  position: relative;
}

.leaflet-container {
  background: var(--bg);
  font-family: 'Fira Code', monospace;
}

/* Popup */
.leaflet-popup-content-wrapper {
  background: var(--panel);
  border: 1px solid var(--border-hi);
  border-radius: 6px;
  box-shadow: var(--shadow-lg);
  color: var(--text);
}

.leaflet-popup-tip {
  background: var(--panel);
}

.leaflet-popup-close-button {
  color: var(--text-dim) !important;
  font-size: 1.1rem !important;
}

.popup-inner {
  min-width: 220px;
  max-width: 280px;
}

.popup-type {
  font-size: 0.55rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
  font-weight: 400;
}

.popup-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 0.3rem;
}

.popup-land {
  font-size: 0.6rem;
  color: var(--text-dim);
  margin-bottom: 0.7rem;
  letter-spacing: 0.1em;
}

.popup-desc {
  font-size: 0.72rem;
  line-height: 1.65;
  color: var(--text);
  margin-bottom: 0.8rem;
}

.popup-link {
  display: inline-block;
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
  border: 1px solid var(--accent);
  padding: 0.25rem 0.65rem;
  border-radius: 3px;
  transition: background 0.2s;
}

.popup-link:hover {
  background: var(--accent-light);
}

/* Custom marker */
.astro-marker {
  display: flex;
  align-items: center;
  justify-content: center;
}

.astro-marker-inner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid currentColor;
  background: white;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  transition: transform 0.2s;
}

.astro-marker:hover .astro-marker-inner {
  transform: scale(1.4);
}

/* ── Status bar ────────────────────────────────────────── */
.astro-cluster {
  display: flex;
  align-items: center;
  justify-content: center;
}

.astro-cluster-inner {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(37, 99, 235, 0.92);
  border: 2px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.24);
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 400;
  transition: transform 0.2s, box-shadow 0.2s;
}

.astro-cluster:hover .astro-cluster-inner {
  transform: scale(1.08);
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.32);
}

.cluster-popup-list {
  display: grid;
  gap: 0.35rem;
}

.cluster-popup-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.68rem;
  color: var(--text);
}

.cluster-popup-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.cluster-popup-name {
  line-height: 1.3;
}

#statusbar {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.35rem 1.5rem;
  background: var(--panel);
  border-top: 1px solid var(--border);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  flex-shrink: 0;
  box-shadow: 0 -2px 8px rgba(30, 50, 120, 0.04);
}

#statusbar .status-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

#statusbar .status-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}

#coords {
  margin-left: auto;
  font-family: 'Fira Code', monospace;
  color: var(--text-dim);
}

/* ── Leaflet layer control ─────────────────────────────── */
.leaflet-control-layers {
  background: var(--panel) !important;
  border: 1px solid var(--border-hi) !important;
  border-radius: 6px !important;
  box-shadow: var(--shadow-lg) !important;
  padding: 0.1rem 0 !important;
  font-family: 'Fira Code', monospace !important;
  font-size: 0.68rem !important;
  color: var(--text) !important;
}

.leaflet-control-layers-base label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.75rem;
  cursor: pointer;
  transition: background 0.15s;
  letter-spacing: 0.05em;
}

.leaflet-control-layers-base label:hover {
  background: var(--accent-light);
}

.leaflet-control-layers-separator { display: none; }

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 640px) {
  #header {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .header-brand {
    width: 100%;
    gap: 0.75rem;
    flex-wrap: wrap;
  }

  .header-search {
    order: 3;
    width: 100%;
    margin-left: 0;
  }

  .header-search input {
    width: 100%;
    min-width: 0;
  }

  .header-right {
    order: 2;
  }

  #sidebar { display: none; }
}
