/* ══════════════════════════════════════════════════════════
   IgelApp – style.css
   Warme Pastelltöne, freundliches Design
══════════════════════════════════════════════════════════ */

/* ─── Reset & Basis ─────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --rose:       #FFE4E1;
  --lavender:   #E6E6FA;
  --mint:       #F0FFF0;
  --yellow:     #FFFACD;
  --green-ok:   #A8E6CF;
  --green-dark: #4CAF82;
  --yellow-mid: #FFD580;
  --red-soft:   #FFABAB;
  --shadow:     0 4px 18px rgba(0,0,0,0.10);
  --radius:     20px;
  --font:       'Segoe UI', system-ui, 'Helvetica Neue', sans-serif;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: linear-gradient(135deg, #ffe4f3 0%, #e6e6fa 35%, #d4f5e9 70%, #fffde7 100%);
  background-attachment: fixed;
  min-height: 100vh;
  padding: 24px 16px 48px;
  color: #333;
}

/* ─── Haupt-Container ───────────────────────────────────── */
body > * {
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

/* ─── Header ────────────────────────────────────────────── */
header {
  text-align: center;
  padding: 36px 24px 28px;
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

.header-igel {
  font-size: 4rem;
  line-height: 1;
  margin-bottom: 8px;
  animation: bounce 2.5s ease-in-out infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}

header h1 {
  font-size: 2.4rem;
  font-weight: 800;
  background: linear-gradient(90deg, #e075b0, #9b59b6, #3aa88e);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 1px;
}

.subtitle {
  color: #888;
  font-size: 1rem;
  margin-top: 4px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* ─── Sektionen ─────────────────────────────────────────── */
section {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 24px;
  margin-bottom: 24px;
}

section h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: #555;
  margin-bottom: 16px;
  border-bottom: 2px solid var(--lavender);
  padding-bottom: 8px;
}

/* ─── Heute – Datum ─────────────────────────────────────── */
.today-date-text {
  text-align: center;
  font-size: 1.1rem;
  color: #666;
  margin-bottom: 20px;
  font-weight: 500;
}

/* ─── Dose-Buttons ──────────────────────────────────────── */
.button-row {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.dose-btn {
  min-width: 155px;
  min-height: 100px;
  font-size: 1.3rem;
  font-weight: 700;
  font-family: var(--font);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.3s ease;
  box-shadow: var(--shadow);
  position: relative;
  outline: none;
  letter-spacing: 0.5px;
}

.morning-btn {
  background: linear-gradient(135deg, #FFF4C2, #FFDDA1);
  color: #7a5500;
}

.evening-btn {
  background: linear-gradient(135deg, #DDD6FF, #C5B4F7);
  color: #3b2a7e;
}

.dose-btn:hover {
  transform: scale(1.06);
  box-shadow: 0 8px 28px rgba(0,0,0,0.15);
}

.dose-btn:active {
  transform: scale(0.97);
}

/* Taken-State */
.dose-btn.taken {
  background: linear-gradient(135deg, #A8E6CF, #56C596) !important;
  color: #1a5c3a !important;
  box-shadow: 0 6px 20px rgba(86,197,150,0.40);
}

.dose-btn.taken::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  border: 3px solid rgba(255,255,255,0.6);
  pointer-events: none;
}

/* ─── Süße Nachricht ────────────────────────────────────── */
.sweet-message {
  display: none;
  text-align: center;
  font-size: 1.25rem;
  font-weight: 600;
  padding: 18px 24px;
  background: linear-gradient(135deg, #FFF9C4, #FFE082);
  border-radius: var(--radius);
  box-shadow: 0 4px 16px rgba(255,193,7,0.30);
  color: #5a4000;
  line-height: 1.5;
}

.sweet-message.visible {
  display: block;
  animation: fadeInUp 0.5s ease forwards;
}

.sweet-message.fadeout {
  animation: fadeOut 0.5s ease forwards;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeOut {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-10px); }
}

/* ─── Statistik ─────────────────────────────────────────── */
.stats-row {
  display: flex;
  gap: 16px;
  justify-content: space-between;
  flex-wrap: wrap;
}

.stat-card {
  flex: 1 1 180px;
  background: var(--lavender);
  border-radius: 16px;
  padding: 18px 12px;
  text-align: center;
  box-shadow: 0 2px 10px rgba(0,0,0,0.07);
  transition: transform 0.2s;
}

.stat-card:hover {
  transform: translateY(-3px);
}

.stat-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 14px;
}

/* Donut-Diagramm */
.donut-wrapper {
  position: relative;
  width: 90px;
  height: 90px;
  margin: 0 auto 10px;
}

.donut {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: conic-gradient(#ccc 0% 100%);
  transition: background 0.6s ease;
}

.donut-pct {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  font-weight: 800;
  color: #333;
  /* Loch erzeugen */
  background: white;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.stat-detail {
  font-size: 0.78rem;
  color: #777;
  line-height: 1.6;
}

/* Farb-Klassen für Donut */
.donut.green  { /* dynamisch via JS conic-gradient gesetzt */ }
.donut.yellow { }
.donut.red    { }

/* ─── Filter-Buttons ────────────────────────────────────── */
.filter-row {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 7px 20px;
  border-radius: 50px;
  border: 2px solid #ddd;
  background: white;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.2s;
  color: #555;
}

.filter-btn:hover {
  border-color: #9b59b6;
  color: #9b59b6;
}

.filter-btn.active {
  background: linear-gradient(135deg, #c39bd3, #9b59b6);
  border-color: #9b59b6;
  color: white;
  box-shadow: 0 3px 12px rgba(155,89,182,0.35);
}

/* ─── Verlaufstabelle ───────────────────────────────────── */
.table-wrapper {
  overflow-x: auto;
  border-radius: 12px;
}

#history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

#history-table thead tr {
  background: linear-gradient(135deg, var(--lavender), #d5c8f5);
}

#history-table th {
  padding: 12px 16px;
  text-align: center;
  font-weight: 700;
  color: #444;
  font-size: 0.9rem;
  letter-spacing: 0.5px;
}

#history-table td {
  padding: 10px 16px;
  text-align: center;
  border-bottom: 1px solid #f0f0f0;
}

#history-table tbody tr:nth-child(even) td {
  background: #fafafa;
}

#history-table tbody tr:hover td {
  background: #f3eeff;
  transition: background 0.15s;
}

#history-table tbody tr.today-row td {
  background: linear-gradient(90deg, #e8f5e9, #f3e5f5);
  font-weight: 700;
  color: #2e7d32;
}

#history-table tbody tr.today-row td:first-child::after {
  content: ' ← heute';
  font-size: 0.75rem;
  color: #9b59b6;
  font-weight: 600;
}

.cell-taken   { font-size: 1.3rem; }
.cell-missing { font-size: 1.3rem; opacity: 0.55; }

/* ─── Footer ────────────────────────────────────────────── */
footer {
  text-align: center;
  padding: 16px;
  color: #aaa;
  font-size: 0.85rem;
}

/* ─── Responsive ────────────────────────────────────────── */
@media (max-width: 500px) {
  header h1    { font-size: 1.9rem; }
  .button-row  { flex-direction: column; align-items: center; }
  .dose-btn    { min-width: 220px; }
  .stats-row   { flex-direction: column; }
  .stat-card   { flex: 1 1 auto; }
}
