:root {
  --header-offset: 82px;
  --bg: #f6efe3;
  --surface: #fdf8ef;
  --surface-soft: #f3e6d1;
  --primary: #1f3a2e;
  --primary-2: #2b4a3a;
  --accent: #d3b07b;
  --accent-soft: #ecdbc0;
  --text: #1d1f1b;
  --text-soft: #645d4f;
  --line: rgba(31, 58, 46, 0.18);
  --shadow: 0 10px 26px rgba(25, 31, 27, 0.1);
}

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

/* =========================
   BASE
========================= */
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Poppins', sans-serif;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3 {
  font-family: 'Playfair Display', serif;
  font-weight: 600;
}

main {
  padding: 28px 24px;
  flex: 1;
}

.site-credits {
  margin: 24px 20px 16px;
  padding-top: 10px;
  border-top: 1px solid rgba(31, 58, 46, 0.16);
  text-align: center;
}

.site-credits p {
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--text-soft);
  opacity: 0.9;
}

/* =========================
   HEADER (MODERNIZED)
========================= */

header {
  background: linear-gradient(120deg, #233a2e 0%, #1d2f26 58%, #16221c 100%);

  color: var(--bg);

  padding: 20px 28px;

  display: flex;
  justify-content: space-between;
  align-items: center;

  position: sticky;
  top: 0;
  z-index: 300;

  border-bottom: 1px solid rgba(236, 219, 192, 0.44);

  backdrop-filter: blur(10px);

  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(236, 219, 192, 0.9), transparent);
}

.logo-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.logo h1 {
  font-size: 26px;
  letter-spacing: 0.4px;
  line-height: 1.1;
  margin: 0;
  color: #fbf5ea;
}

.logo h4 {
  margin-top: 2px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: none;
  color: rgba(245, 241, 232, 0.78);
  margin: 0;
}

/* =========================
   MENU BUTTON
========================= */
.menu-btn {
  position: fixed;
  top: 16px;
  right: 22px;
  background: rgba(251,248,243,0.14);
  border: 1px solid rgba(251,248,243,0.36);
  color: var(--bg);

  padding: 11px 16px;
  border-radius: 9px;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.01em;

  cursor: pointer;
  z-index: 400;

  transition: 0.2s ease;
}

.menu-btn:hover {
  background: #ecd7b3;
  color: var(--primary);
  transform: translateY(-1px);
}

/* =========================
   SIDE MENU + BACKDROP
========================= */
.menu {
  position: fixed;
  top: var(--header-offset);
  right: -260px;

  width: 260px;
  height: calc(100vh - var(--header-offset));

  background: linear-gradient(170deg, #20392d, #182c23);
  padding: 14px 15px 18px;

  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  overscroll-behavior: contain;

  transition: right 0.3s ease;
  z-index: 350;
}

.menu.open {
  right: 0;
}

.menu button {
  background: transparent;
  border: none;
  color: var(--bg);

  padding: 12px;
  text-align: left;
  cursor: pointer;

  border-radius: 8px;
  font-size: 14px;

  transition: 0.2s ease;
}

.menu button:hover {
  background: var(--accent-soft);
  color: var(--primary);
  transform: translateX(4px);
}

#menu-backdrop {
  position: fixed;
  top: var(--header-offset);
  right: 0;
  bottom: 0;
  left: 0;

  background: rgba(14, 20, 17, 0.34);

  opacity: 0;
  visibility: hidden;
  pointer-events: none;

  transition: 0.3s ease;

  z-index: 280;
}

#menu-backdrop.active {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
}

/* =========================
   TOOL SYSTEM
========================= */
.tool {
  display: none;
}

.tool.aktiv {
  display: block;
}

/* =========================
   HERO
========================= */
.hero {
  padding: 64px 24px 38px;
  text-align: center;
}

.hero h2 {
  font-size: clamp(2rem, 4.2vw, 2.55rem);
  margin-bottom: 12px;
  line-height: 1.18;
}

.hero p {
  color: var(--text-soft);
  max-width: 820px;
  margin: 0 auto;
  line-height: 1.65;
}

/* =========================
   START PAGE (PRO)
========================= */
.start-shell {
  padding: 32px 34px 40px;
  display: grid;
  gap: 22px;
}

.start-hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 85% 15%, rgba(211, 176, 123, 0.36), transparent 42%),
    linear-gradient(145deg, #fcf6e9, #f1e0c3);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.start-hero h2 {
  font-size: clamp(1.85rem, 2.6vw, 2.5rem);
  line-height: 1.15;
  color: var(--primary);
  margin-bottom: 10px;
}

.start-hero p {
  max-width: 760px;
  font-size: 1.02rem;
  color: var(--text-soft);
  line-height: 1.68;
}

.start-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(31,58,46,0.11);
  border: 1px solid var(--line);
  color: var(--primary);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.start-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 12px;
}

.start-secondary {
  background: rgba(31,58,46,0.1);
  color: var(--primary);
  border: 1px solid var(--line);
}

.start-secondary:hover {
  background: rgba(31,58,46,0.17);
  color: var(--primary);
}

.start-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.start-card {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #fffaf2, #f7e9cf);
  box-shadow: 0 8px 18px rgba(0,0,0,0.045);
}

.start-card h3 {
  font-size: 1.12rem;
  margin-bottom: 8px;
  color: var(--primary-2);
}

.start-card p {
  color: var(--text-soft);
  font-size: 0.97rem;
  line-height: 1.6;
}

/* =========================
   GRID / CARDS
========================= */
.container {
  padding: 36px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.card {
  background: var(--surface);
  padding: 24px;
  border-radius: 16px;
  border: 1px solid rgba(31, 58, 46, 0.08);

  box-shadow: 0 8px 24px rgba(0,0,0,0.055);
  transition: 0.25s ease;
}

.cards-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card h3 {
  margin-bottom: 10px;
}

.card p {
  margin-bottom: 10px;
  line-height: 1.62;
}

.card label {
  display: block;
  margin: 12px 0 6px;
  font-weight: 500;
}

.raw-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  margin-bottom: 8px;
}

.raw-label-row label {
  margin: 0;
}

.btn.btn-reset-inline {
  margin-top: 0;
  padding: 4px 9px;
  font-size: 0.82rem;
  border-radius: 8px;
  background: rgba(46, 125, 50, 0.08);
  color: #2f6b35;
  border: 1px solid rgba(46, 125, 50, 0.22);
}

.btn.btn-reset-inline:hover {
  background: rgba(46, 125, 50, 0.14);
  color: #25572a;
  transform: none;
}

.card hr {
  margin: 18px 0;
}


/* (hover bewusst neutral gelassen wie bei dir) */
.card:hover {
  transform: none;
}

/* =========================
   BUTTONS
========================= */
.btn {
  display: inline-block;
  margin-top: 12px;
  padding: 11px 16px;

  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: var(--bg);
  border: 1px solid rgba(31, 58, 46, 0.34);

  border-radius: 10px;
  text-decoration: none;
  cursor: pointer;

  transition: 0.2s ease;
}

.btn:hover {
  background: var(--accent);
  color: var(--primary);
  transform: translateY(-1px);
}

/* Back button */
.detail-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
}

/* Name exakt zentriert */
.detail-header h2 {
  text-align: center;
  font-size: 28px;
  font-weight: 700;
  margin: 0;
}

.back-btn {
  justify-self: start;
}


/* Spezial: Zucht Button */
button[onclick="simulateBreeding()"] {
  margin-top: 14px;

  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #f5f1e8;

  border: none;
  border-radius: 11px;

  padding: 11px 18px;

  font-weight: 600;
  letter-spacing: 0.3px;

  cursor: pointer;

  transition: all 0.2s ease;
  box-shadow: 0 6px 18px rgba(31,58,46,0.23);
}

button[onclick="simulateBreeding()"]:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(31,58,46,0.32);
}

/* =========================
   INPUTS
========================= */
textarea {
  width: 100%;
  min-height: 300px;

  padding: 16px;

  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fffdf9;
  color: var(--text);

  font-size: 15px;
  line-height: 1.58;
  resize: vertical;
}

.raw-mini {
  min-height: 150px;
  margin-bottom: 12px;
}

textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(31,58,46,0.15);
}

/* =========================
   SELECT (vereinheitlicht)
========================= */
select {
  width: 100%;
  padding: 13px;

  border-radius: 10px;
  border: 1px solid var(--line);

  background: #fffdf9;

  font-family: 'Poppins', sans-serif;
  font-size: 14.5px;

  cursor: pointer;

  appearance: auto;
  -webkit-appearance: menulist;
  -moz-appearance: menulist;

  transition: 0.2s ease;
}

select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(31,58,46,0.15);
}





/* =========================
   DATABASE UI
========================= */
#db_liste {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.database-tools {
  display: flex;
  align-items: center;
  gap: 10px;

  margin: 0 36px 12px;
  padding: 10px 14px;

  width: fit-content;

  background: rgba(211, 176, 123, 0.22);
  border: 1px solid rgba(31, 58, 46, 0.1);
  border-radius: 10px;
}

.database-tools label {
  font-size: 12.5px;
  opacity: 0.85;
}

.database-tools select {
  width: 220px;
  padding: 6px 10px;

  border-radius: 6px;
  border: 1px solid var(--line);

  background: #fffdf9;

  font-family: 'Poppins', sans-serif;
  font-size: 14px;

  color: var(--text);

  cursor: pointer;
}

#sortMode {
  margin-top: 8px;
  margin-bottom: 15px;

  width: 220px;

  padding: 6px 10px;

  border-radius: 6px;
  border: 1px solid var(--line);

  background: #fffdf9;

  font-family: 'Poppins', sans-serif;
  font-size: 14px;

  color: var(--text);

  cursor: pointer;
}



/* HORSE ROW - database kacheln*/
.horse-row {
  display: flex;
  justify-content: space-between;
  align-items: center;

  padding: 14px 18px;
  border-radius: 10px;

  background: linear-gradient(180deg, #fafafa, #f9faf9);
  border: 1px solid rgba(31, 58, 46, 0.14);
  transition: 0.2s ease;
}

.horse-row:hover {
  transform: translateY(-2px);
}

.horse-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.horse-title {
  font-weight: bold;
}

.horse-line {
  font-size: 13.5px;
  color: #465047;
}

.horse-owner {
  margin-left: auto;
  margin-right: 20px;

  font-size: 13.5px;
  color: #4c574e;
  white-space: nowrap;
}



/* DELETE BUTTON */
.delete-btn {
  opacity: 0;
  transform: scale(0.9);

  background: transparent;
  border: 1px solid rgba(138,45,45,0.35);
  color: #8a2d2d;

  padding: 6px 10px;
  border-radius: 8px;

  cursor: pointer;
  transition: 0.2s ease;
}

.horse-row:hover .delete-btn {
  opacity: 1;
  transform: scale(1);
}

.delete-btn:hover {
  background: #8a2d2d;
  color: white;
}



/* IMPORT / BREEDING PANEL */
#import_status .card {
  background: #f8ecd4;
  border-left: 4px solid var(--primary);
}

.breeding-panel {
  margin-top: 24px;
  padding: 22px;

  background: var(--surface);
  border-radius: 14px;
  border: 1px solid rgba(31, 58, 46, 0.09);

  box-shadow: 0 8px 24px rgba(0,0,0,0.055);
  border-left: 4px solid var(--primary);
}

.breeding-panel h2 {
  margin-bottom: 10px;
}

.breeding-panel p {
  margin-bottom: 12px;
  color: var(--text-soft);
}



/* Z-INDEX SAFETY */
#menu-backdrop { z-index: 280; }
.menu { z-index: 350; }
.menu-btn { z-index: 400; }



/* switchbutton database*/
/* Switch rechts */
.view-switch {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* einzelne Buttons */
.view-switch button {
  padding: 10px 14px;
  font-size: 14px;
  border-radius: 10px;
  cursor: pointer;
  border: 1px solid var(--line);
  background: #fffdf9;
  color: var(--text);
  transition: 0.2s ease;
}

/* aktiver Button */
.view-switch button.active {
  background: var(--primary);
  color: var(--bg);
  border-color: var(--primary);
}

/* =========================
   RESPONSIVE
========================= */
@media (max-width: 900px) {
  header {
    padding: 14px 14px;
  }

  .logo h1 {
    font-size: 20px;
  }

  .logo h4 {
    font-size: 11px;
  }

  .menu-btn {
    top: 12px;
    right: 14px;
    padding: 9px 12px;
    font-size: 14px;
  }

  .start-grid {
    grid-template-columns: 1fr;
  }

  .start-shell {
    padding: 24px 14px 28px;
  }

  .start-hero h2 {
    font-size: 1.75rem;
  }

  .container {
    padding: 22px 10px;
    gap: 16px;
  }

  .card {
    padding: 18px;
    border-radius: 14px;
  }

  .site-credits {
    margin: 2px 14px 14px;
  }

  .site-credits p {
    font-size: 11px;
  }
}


