/* --- Layout -------------------------------------------------------- */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #222;
}

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

#header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.4rem 1rem;
  background: #1a1a2e;
  color: #fff;
  z-index: 1000;
  flex-shrink: 0;
}

#header h1 {
  font-size: 1.2rem;
  white-space: nowrap;
}

#status {
  font-size: 0.85rem;
  opacity: 0.8;
}

#status.loading {
  animation: pulse 1.2s ease-in-out infinite;
}

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

#header-links {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

#header-links a {
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

#header-links a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

#version {
  font-family: monospace;
  font-size: 0.55em;
  font-weight: 400;
  opacity: 0.5;
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
}

#version:hover {
  opacity: 0.8;
}

#map {
  flex: 1;
}

/* --- Info Panel ---------------------------------------------------- */

#info-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 380px;
  max-width: 100vw;
  height: 100%;
  background: #fff;
  box-shadow: -4px 0 12px rgba(0, 0, 0, 0.25);
  z-index: 2000;
  overflow-y: auto;
  padding: 1rem;
  transition: transform 0.25s ease;
}

#info-panel.hidden {
  transform: translateX(100%);
  pointer-events: none;
}

#info-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: #666;
}

#info-close:hover {
  color: #000;
}

#info-content h2 {
  font-size: 1.1rem;
  margin-bottom: 0.6rem;
  color: #1a1a2e;
}

#info-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 0.8rem;
}

#info-content th,
#info-content td {
  text-align: left;
  padding: 0.25rem 0.4rem;
  border-bottom: 1px solid #eee;
  font-size: 0.85rem;
  vertical-align: top;
}

#info-content th {
  color: #666;
  font-weight: 600;
  width: 40%;
}

#info-content .section-title {
  font-weight: 700;
  font-size: 0.9rem;
  margin-top: 0.8rem;
  margin-bottom: 0.3rem;
  color: #1a1a2e;
  border-bottom: 2px solid #e8e8e8;
  padding-bottom: 0.2rem;
}

#info-content .badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-normal {
  background: #d4edda;
  color: #155724;
}

.badge-schnell {
  background: #fff3cd;
  color: #856404;
}

.badge-status-ok {
  background: #d4edda;
  color: #155724;
}

.badge-status-other {
  background: #f8d7da;
  color: #721c24;
}

/* --- Cluster colours ---------------------------------------------- */

.marker-cluster-small {
  background-color: rgba(76, 175, 80, 0.6) !important;
}
.marker-cluster-small div {
  background-color: rgba(76, 175, 80, 0.8) !important;
}

.marker-cluster-medium {
  background-color: rgba(255, 193, 7, 0.6) !important;
}
.marker-cluster-medium div {
  background-color: rgba(255, 193, 7, 0.8) !important;
}

.marker-cluster-large {
  background-color: rgba(244, 67, 54, 0.6) !important;
}
.marker-cluster-large div {
  background-color: rgba(244, 67, 54, 0.8) !important;
}

/* --- About button -------------------------------------------------- */

#about-btn {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.8rem;
  padding: 0.2rem 0.4rem;
  cursor: pointer;
  flex-shrink: 0;
}

#about-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* --- About modal --------------------------------------------------- */

#about-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s ease;
}

#about-overlay.hidden {
  display: none;
}

#about-modal {
  position: relative;
  background: #fff;
  border-radius: 8px;
  width: 700px;
  max-width: 92vw;
  max-height: 85vh;
  overflow-y: auto;
  padding: 2rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

#about-close {
  position: absolute;
  top: 0.5rem;
  right: 0.7rem;
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: #666;
}

#about-close:hover {
  color: #000;
}

#about-content h1 {
  font-size: 1.4rem;
  margin-bottom: 0.8rem;
  color: #1a1a2e;
}

#about-content h2 {
  font-size: 1.1rem;
  margin-top: 1.2rem;
  margin-bottom: 0.4rem;
  color: #1a1a2e;
}

#about-content p {
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 0.6rem;
}

#about-content ul {
  font-size: 0.9rem;
  line-height: 1.6;
  padding-left: 1.5rem;
  margin-bottom: 0.6rem;
}

#about-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 0.8rem;
  font-size: 0.85rem;
}

#about-content th,
#about-content td {
  text-align: left;
  padding: 0.3rem 0.6rem;
  border-bottom: 1px solid #eee;
}

#about-content th {
  font-weight: 600;
  color: #555;
}

#about-content code {
  background: #f4f4f4;
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  font-size: 0.85em;
}

#about-content pre {
  background: #f4f4f4;
  padding: 0.8rem;
  border-radius: 4px;
  overflow-x: auto;
  font-size: 0.85rem;
  margin-bottom: 0.8rem;
}

#about-content a {
  color: #1565c0;
}

/* --- Responsive --------------------------------------------------- */

@media (max-width: 500px) {
  #info-panel {
    width: 100vw;
  }

  #about-modal {
    max-width: 98vw;
    max-height: 90vh;
    padding: 1rem;
  }

  #header h1 {
    font-size: 1rem;
  }
}

