/* assets/css/style.css */

:root {
  --bg: #0b1220;
  --panel: #111827;
  --accent: #0ea5e9;
  --accent-2: #22d3ee;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --border: #374151;
  --shadow: 0 8px 24px rgba(0,0,0,.25);
  --radius: 12px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
}

header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #001018;
  padding: 1rem;
  box-shadow: var(--shadow);
}

.title-container {
  display: flex;
  gap: 12px;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
}

header h1 {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.2;
}

header .subtitle {
  font-size: 0.85rem;
  opacity: .9;
  margin: 0;
}

main {
  padding: 1rem;
  max-width: 1200px;
  margin: 0 auto;
}

.controls-wrapper {
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1.5rem;
  backdrop-filter: blur(8px);
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.controls > div {
  flex: 1 1 200px; /* Flexibel wachsen und schrumpfen, Basisbreite 200px */
}

label {
  font-size: 0.8rem;
  color: var(--muted);
  display: block;
  margin-bottom: 6px;
}

select, input[type="number"] {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #0e1526;
  color: var(--text);
  outline: none;
  font-size: 1rem;
}

select:focus, input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-2);
}

option[disabled] {
  color: #6b7280;
}

.status-wrapper {
  margin-bottom: 1.5rem;
}

.status {
  font-size: 0.9rem;
  color: var(--muted);
}
.status.err { color: #fca5a5; }
.status.suggest a { color: #93c5fd; cursor: pointer; text-decoration: underline; }

/* Neues Karten-Layout */
.results-grid {
  display: grid;
  gap: 1rem;
}

/* 1 Spalte auf kleinen Screens, 2 auf mittleren, 3 auf grossen */
@media (min-width: 768px) {
  .results-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .results-grid { grid-template-columns: repeat(3, 1fr); }
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
}

.card-header {
  display: flex;
  gap: 1rem;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid var(--border);
}

.card-icon { width: 32px; height: 32px; flex-shrink: 0; }
.card-title { font-weight: 600; font-size: 1.1rem; }
.card-distance { margin-left: auto; font-size: 0.9rem; color: var(--muted); white-space: nowrap; }

.card-body {
  padding: 1rem;
  flex-grow: 1;
}

/* NEU: Styling für den Provider-Namen als Badge */
.prov-name {
  background-color: #273250;
  color: #c7d2fe;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  display: inline-block;
  margin-bottom: 1rem;
}

.location-name { font-weight: 600; margin-bottom: 0.25rem; }
.location-address { font-size: 0.9rem; color: var(--muted); }

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 1rem;
}

.chip {
  font-size: 0.75rem;
  background: #1f2937;
  color: #cbd5e1;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #374151;
  white-space: nowrap;
}

.card-footer {
  padding: 1rem;
  background: rgba(0,0,0,0.1);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.link {
  font-size: 0.9rem;
  color: #93c5fd;
  text-decoration: none;
  font-weight: 500;
}
.link:hover { text-decoration: underline; }

.expand-btn {
  font: inherit; font-size: 0.9rem;
  background: #273250;
  color: var(--text);
  border: 1px solid #374151;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
}
.expand-btn:hover { background: #374151; }

.details-panel {
  display: none; /* Wird per JS umgeschaltet */
  background: #0b1220;
  padding: 1rem;
  font-size: 0.9rem;
  border-top: 1px dashed #233150;
}
.details-kv {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 8px;
}
.details-kv:not(:last-child) { margin-bottom: 8px; }
.details-kv .key { color: var(--muted); }

/* Loader */
.loader-bar {
  display: none;
  height: 4px;
  width: 100%;
  background: #0f172a;
  overflow: hidden;
  border-radius: 999px;
  margin: 2rem 0;
}
.loader-bar::after {
  content: "";
  display: block;
  height: 100%;
  width: 40%;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  animation: slide 1.5s infinite;
}
@keyframes slide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(250%); }
}

footer {
  text-align: center;
  padding: 2rem 1rem;
  margin-top: 2rem;
  font-size: 0.9rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
}
footer a {
  color: #93c5fd;
  text-decoration: none;
}
footer a:hover {
  text-decoration: underline;
}