:root {
  --bg: #f3f4f6;
  --bg-soft: #ffffff;
  --card: #ffffff;
  --accent: #22c55e;
  --accent-soft: #dcfce7;
  --text: #111827;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --danger: #ef4444;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #e5f3ff 0, #f3f4f6 45%, #e5e7eb 100%);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */

header {
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 0;
  gap: 1.5rem;
}

.logo {
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: #111827;
}

.logo span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 999px;
  background: radial-gradient(circle at 20% 20%, #4ade80 0, #22c55e 40%, #16a34a 100%);
  color: #022c22;
  font-weight: 800;
  font-size: 0.9rem;
}

.header-nav {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Hero / Startseite */

.hero {
  padding: 2rem 0 1rem;
}

.hero-detail {
  padding-top: 1.5rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1.6fr);
  gap: 2rem;
  align-items: center;
}

@media (max-width: 800px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.hero h1,
.hero-title {
  font-size: clamp(1.9rem, 3vw, 2.4rem);
  margin: 0 0 0.75rem;
}

.hero p,
.hero-subtitle {
  margin: 0 0 1rem;
  color: var(--text-muted);
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.hero-badge {
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  background: #f9fafb;
}

.hero-highlight {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #166534;
  font-size: 0.75rem;
  margin-bottom: 0.7rem;
}

/* Search Card */

.search-card {
  background: #ffffff;
  border-radius: 1.25rem;
  border: 1px solid var(--border);
  padding: 1rem;
  box-shadow: 0 18px 35px rgba(148, 163, 184, 0.35);
}

.search-title {
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
  font-weight: 600;
}

.search-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}

@media (max-width: 900px) {
  .search-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .search-row {
    grid-template-columns: minmax(0, 1fr);
  }
}

label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  display: block;
  margin-bottom: 0.15rem;
}

select,
input[type="date"],
input[type="time"],
input[type="email"],
input[type="password"],
input[type="text"],
input[type="number"] {
  width: 100%;
  padding: 0.35rem 0.5rem;
  border-radius: 0.6rem;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text);
  font-size: 0.85rem;
  outline: none;
}

select:focus,
input[type="date"]:focus,
input[type="time"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="text"]:focus,
input[type="number"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.3);
}

.search-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

/* Buttons */

.btn-primary {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  border-radius: 999px;
  border: none;
  color: #022c22;
  font-weight: 600;
  padding: 0.5rem 1.1rem;
  font-size: 0.85rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  text-decoration: none;
}

.btn-secondary {
  background: #ffffff;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
  cursor: pointer;
}

.btn-ghost {
  background: transparent;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.btn-link {
  font-size: 0.8rem;
  text-decoration: none;
  color: #16a34a;
  font-weight: 500;
}

/* Main */

main {
  padding: 0 0 2rem;
  flex: 1;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 1.2rem 0 0.6rem;
}

.section-header h2 {
  font-size: 1rem;
  margin: 0;
}

.section-header p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Events Grid */

/* Raster für Laufkarten auf der Startseite */
.events-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}

/* Tablet: 2 Spalten */
@media (max-width: 1100px) {
  .events-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Handy: 1 Spalte */
@media (max-width: 720px) {
  .events-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.card {
  background: var(--card);
  border-radius: 1rem;
  border: 1px solid var(--border);
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  box-shadow: 0 10px 24px rgba(148, 163, 184, 0.25);
  overflow: hidden;
}

.card-header {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: flex-start;
}

.card-title {
  font-size: 0.95rem;
  font-weight: 600;
}

.card-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.25rem;
}

.chip {
  font-size: 0.7rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  background: #f9fafb;
}

.chip-accent {
  border-color: rgba(34, 197, 94, 0.5);
  background: var(--accent-soft);
  color: #166534;
}

.rating {
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.15rem;
  color: #eab308;
  white-space: nowrap;
}

.rating span {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.card-footer {
  margin-top: 0.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
}

.badge-type {
  font-size: 0.7rem;
  padding: 0.15rem 0.4rem;
  border-radius: 999px;
  background: #f9fafb;
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.empty-state {
  padding: 1rem;
  border-radius: 0.9rem;
  background: #f9fafb;
  border: 1px dashed var(--border);
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 0.8rem;
}

.card-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.card-thumb {
  position: relative;
  height: 180px;
  background: #e5e7eb;
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

.card-thumb-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  font-size: 1.1rem;
  color: #9ca3af;
  font-weight: 600;
}

.card-pill-date {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: #ffffff;
  border-radius: 999px;
  padding: 0.1rem 0.6rem;
  font-size: 0.75rem;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.15);
}

.card-pill-type {
  position: absolute;
  bottom: 0.75rem;
  left: 0.75rem;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  padding: 0.1rem 0.7rem;
  font-size: 0.75rem;
}

.card-body {
  padding: 0.75rem 0.9rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}


/* Breadcrumb & Detailseite */

.breadcrumb {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  margin-top: 1rem;
}

.breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

/* Detail-Layout */

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.badge {
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #f9fafb;
}

.rating-block {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  margin-top: 0.3rem;
  font-size: 0.85rem;
}

.rating-stars button {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1.3rem;
  padding: 0;
  line-height: 1;
  color: #d1d5db;
}

.rating-stars button.filled {
  color: #eab308;
}

.rating-stars button:disabled {
  cursor: default;
}

.rating-info {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.layout-grid {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 1rem;
  margin-top: 1.2rem;
}

.layout-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.2rem;
}

@media (max-width: 1000px) {
  .layout-grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .layout-grid-3 {
    grid-template-columns: minmax(0, 1fr);
  }
}

.section-card {
  padding: 0.85rem 0.9rem;
  border-radius: 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: 0 8px 20px rgba(148, 163, 184, 0.2);
}

.section-card h2 {
  margin-top: 0;
}

.event-image {
  border-radius: 0.8rem;
  overflow: hidden;
  background: #e5e7eb;
  min-height: 170px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.event-image.has-image {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: transparent;
}

.btn-sm {
  padding: 0.3rem 0.7rem;
  font-size: 0.8rem;
}


@media (max-width: 800px) {
  .layout-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.section {
  margin-top: 1rem;
}

.section h2 {
  font-size: 1rem;
  margin: 0 0 0.5rem;
}

.section p {
  margin: 0 0 0.4rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Distanzen */

.distanzen-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.9rem;
}

.distanz-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.6rem;
}

.distanz-name {
  font-weight: 500;
}

.distanz-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Map */

.map-placeholder {
  border-radius: 0.8rem;
  border: 1px dashed var(--border);
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
  background: #f9fafb;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.6rem;
}

/* Misc */

.muted {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Footer */

footer {
  border-top: 1px solid var(--border);
  padding: 0.7rem 0 1rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  background: #ffffff;
}


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

.admin-layout {
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  gap: 1.5rem;
  margin-top: 1rem;
}

@media (max-width: 900px) {
  .admin-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

.admin-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.admin-main {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.series-list {
  list-style: none;
  padding: 0;
  margin: 0.25rem 0 0;
  max-height: 480px;
  overflow-y: auto;
}

.series-list-item {
  padding: 0.4rem 0.6rem;
  border-radius: 0.6rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  font-size: 0.85rem;
}

.series-list-item:hover {
  background: #e0f2fe;
}

.series-list-item.active {
  background: #1d4ed8;
  color: #ffffff;
}

.series-list-item .series-name {
  font-weight: 600;
}

.series-list-item .series-meta {
  font-size: 0.75rem;
  opacity: 0.8;
}

/* Events-Tabelle im Admin */

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.admin-table th,
.admin-table td {
  padding: 0.35rem 0.4rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

.admin-table th {
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.admin-table tr.inactive {
  opacity: 0.5;
}

.badge-small {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-size: 0.7rem;
  background: #e5e7eb;
}

/* Distanz-Repeater */

.event-dist-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: flex-end;
  margin-bottom: 0.4rem;
}

.event-dist-row input {
  padding: 0.3rem 0.4rem;
  border-radius: 0.6rem;
  border: 1px solid var(--border);
  font-size: 0.8rem;
  flex: 1 1 120px;
}

.event-dist-row input.dist-km {
  max-width: 90px;
  flex: 0 0 80px;
}

.event-dist-row button {
  flex: 0 0 auto;
}

.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
}

@media (max-width: 700px) {
  .field-row {
    grid-template-columns: minmax(0, 1fr);
  }
}

.switch-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.4rem;
}

/* Formulare allgemein – abgerundete Felder, einheitlich */

input:not([type="checkbox"]):not([type="radio"]),
textarea,
select {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border-radius: 0.6rem;
  border: 1px solid var(--border);
  background: #ffffff;
  font-size: 0.9rem;
  color: var(--text);
  outline: none;
  box-sizing: border-box;
}

input:not([type="checkbox"]):not([type="radio"]):focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.35);
}

/* Section-Karten leicht stärker abrunden */

.section-card {
  border-radius: 1rem;
}


