/* ========== GrowBuddy Kalender – Mobile-First Styles ========== */
:root{
  --gb-bg: #f5f9f5;
  --gb-card: #eef5ed;
  --gb-card-2:#e9efe7;
  --gb-ink: #2b2b2b;
  --gb-ink-muted:#5a5a5a;
  --gb-accent:#5c7351;      /* Olivegrün */
  --gb-accent-ink:#ffffff;
  --gb-accent-dark:#333532; /* Dunkles Grau der App */
  --gb-shadow: 0 2px 6px rgba(0,0,0,.08);

  --kal-gap: 6px;          /* Grid-Abstand */
  --kal-rows: 6;           /* max. Kalenderzeilen */
  --kal-pad: 12px;         /* Innenabstand des Containers */

  --bottom-nav-h: 72px;    /* Höhe deiner Bottom-Nav (bei Bedarf anpassen) */
}

/* Grundlayout */
body{
  font-family: 'Fredoka', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--gb-bg);
  color: var(--gb-ink);
  margin: 0;
  padding: 12px 12px 20px; /* Platz für Bottom-Nav */
  max-width: 100%;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* (Legacy) Header – bleibt kompatibel */
.kalender-header h2{
  margin:0; font-size:1.4em; color:#ece4e4;
}
.kalender-header button{
  background:#333532; color:#fff; border:none; padding:8px 14px;
  border-radius:6px; font-size:1em; cursor:pointer;
}
.kalender-header button:hover{ background:#4a4c49; }

/* Grid-Container */
#kalenderGrid{
  display:grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: var(--kal-gap, 4px);
  overflow: visible; /* kein eigener Scroll */
}
/* Optional: Scrollbar auf iOS/Chrome ausblenden */
#kalenderGrid::-webkit-scrollbar{ display:none; }

/* Zellenbasis */
.kalender-grid div{
  background: transparent;
  border-radius: 6px;
  color:#2a2a2a;
  min-height:40px;
  cursor:pointer;
  display:flex; flex-direction:column; align-items:center;
}

/* Einzelne Tag-Zelle */
.kalender-grid .kalender-tag{
  background: var(--gb-card);
  border-radius:10px;
  min-height: 68px;
  padding: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  cursor:pointer;
  display:flex; flex-direction:column; align-items:center; justify-content:flex-start;
  position:relative;
  color:#2a2a2a;
}

/* Icons-Gitter im Tag */
.icon-grid{
  display:flex; flex-wrap:wrap; justify-content:center; align-items:center;
  gap:2px; max-height:40px; overflow:hidden;
}
.icon-grid img{
  width:22px !important; height:22px !important;
  border-radius:4px; box-shadow:0 0 2px rgba(0,0,0,0.2);
}
.mehr-icons{
  font-size:.7em; color:#666; margin-top:2px;
}

/* Datum */
.kalender-tag-zahl{
  font-size:.85em; font-weight:bold;
  color:#2b2b2b;          /* bessere Lesbarkeit auf hellem Grün */
  margin-bottom:4px; z-index:2; background:transparent;
}

/* Wochenlisten-Box (Wochenansicht) */
.wochentag{
  background: var(--gb-card-2);
  padding:16px; margin-bottom:12px;
  border-radius:10px; width:100%; box-sizing:border-box;
  font-family:'Fredoka', sans-serif;
  box-shadow:0 2px 6px rgba(0,0,0,0.05);
}
.wochentag h3{
  margin:0 0 6px 0; font-size:1em;
  display:flex; justify-content:space-between; align-items:center;
}
.wochentag button{
  background:#ccc; border:none; border-radius:4px; font-size:.85em; cursor:pointer;
  padding:2px 6px; margin-top:12px; margin-bottom:12px;
}

/* Woche/Heute Buttons (optional) */
.wochen-btn{
  appearance:none; background: var(--gb-accent-dark); color: var(--gb-accent-ink);
  border:none; padding:10px 14px; border-radius:10px; font-weight:700; font-size:.95rem;
  cursor:pointer; box-shadow: var(--gb-shadow);
  transition: transform .06s ease, opacity .2s ease, background .2s ease;
}
.wochen-btn:hover{ background-color:#4a4c49; transform:translateY(-2px); }
.heute-btn{ background-color:#333532; }

/* Alte Monats-Navigation komplett ausblenden (wir nutzen die Toolbar) */
.kalender-navigation{ display:none !important; }

/* Monatsanzeige (zentriert im Toolbar) */
#kalenderMonatsAnzeige {
  font-size: clamp(1.05rem, 3.4vw, 1.7rem);
  font-weight: 800;
  color: #2b2b2b;   /* ✅ dunkel statt weiß */
  text-align: center;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: 'Rubik', sans-serif;
}



/* Wochenansicht-Container weiter nach unten setzen */
#wochenAnsicht {
  margin-top: 16px;   /* Abstand unter dem weißen Header */
  padding-top: 8px;   /* optional extra Innenabstand */
}

/* Falls nur die erste Karte Abstand braucht */
#wochenAnsicht .wochentag:first-child {
  margin-top: 12px;
}

/* Overlay */
#overlay{ background: rgba(0,0,0,0.4); z-index: 999; }

/* Vollbild-Modal – sperrt Seite */
#eintragModal{
  position: fixed; left:0; top:0; width:100vw; height:100vh;
  z-index: 1000; background:#fff; padding:16px; overflow-y:auto; border-radius:0;
}
body.modal-open{
  overflow:hidden !important; position:fixed; width:100%; height:100%; inset:0;
}
#eintragModal input, #eintragModal select{
  width:100%; margin-bottom:10px; padding:8px;
}
.modal-row{
  margin-bottom:12px; display:flex; flex-direction:column; align-items:stretch;
}
.modal-row label{
  font-weight:bold; margin-bottom:4px; font-size:.95em; color:#3e5b36;
}
#eintragModal input, #eintragModal select, #eintragModal button{
  width:100%; padding:10px; font-size:1em; border-radius:6px; border:1px solid #ccc; box-sizing:border-box;
}
#eintragModal button {
  padding: 10px;
  border-radius: 8px;
  border: none;
  font-size: 1em;
  cursor: pointer;
  background: #333532;
  color: #fff;
  transition: background .2s ease;
}
#eintragModal button:hover{ background:#4a4c49; }
#eintragModal .danger{ background:#d9534f; }
#eintragModal .danger:hover{ background:#c9302c; }



/* — Eintragsliste im Modal — */
#eintragUebersichtInhalt { margin-top: 6px; max-height: 250px;
  overflow-y: auto; }


/* Scrollcontainer, bleibt kompakt */
.entry-list {
  max-height: 180px;
  overflow-y: auto;
  padding-right: 4px;
}

/* Einzelne „Mini-Cards“ */
.entry-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #e6e6e6;
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--gb-shadow);
}
.entry-row + .entry-row { margin-top: 8px; }

.entry-text {
  cursor: pointer;
  flex: 1;
  font-size: .95em;
  line-height: 1.35;        /* ➕ bessere Lesbarkeit */
  color: #2a2a2a;
}

/* Schmaler, rechts ausgerichteter Löschen-Button */
#eintragModal .entry-delete {
  width: auto !important;   /* ➜ überschreibt die globale 100%-Regel */
  padding: 6px 8px;
  border: none;
  background: #f4f4f4;
  border-radius: 8px;
  cursor: pointer;
  flex: 0 0 auto;
}
#eintragModal .entry-delete:hover { background: #eaeaea; }

/* Optional: dezente Scrollbar */
.entry-list::-webkit-scrollbar { width: 8px; }
.entry-list::-webkit-scrollbar-thumb { background: #d6d6d6; border-radius: 8px; }






/* Ernte-Infos */
.ernte-prognose{
  font-size:.7em; color:#8a5e2e; background-color:#c79863;
  border-radius:6px; padding:2px 6px; margin-top:4px; text-align:center; white-space:nowrap;
}
/* Tag im Erntefenster hervorheben */
.ernte-fenster{
  background-color:#c79863 !important;
  border: 2px solid #c79863;
  box-shadow: inset 0 0 4px #c79863;
}
/* Label im Erntefenster (unten im Tag) */
.ernte-fenster-label{
  position:absolute; bottom:4px; left:4px; right:4px;
  font-size:.7em; text-align:center; color:#2b2b2b;
  background: rgba(255,255,255,.7);
  border-radius:6px; padding:2px 4px;
}

/* Mobile optimiert */
@media (max-width: 600px){
  .kalender-tag{ padding:4px; font-size:.78em; min-height:60px; }
  .kalender-tag-zahl{ font-size:.9em; }
  .ernte-fenster-label{ font-size:.65em; }
}
@media (max-width: 480px){
  #kalenderGrid{ grid-template-columns:repeat(7, 1fr); gap:2px; }
  .kalender-tag{ padding:2px; min-height:64px; }
}

/* Optional noch straffer */
@media (max-width: 380px){
  #kalenderGrid .eintrag, .kalender-grid .eintrag{ max-height:2.2em; }
}





/* Buttons einheitlich */
.toolbar-btn{
  appearance:none;
  background:#f0f0e9;
  color:#333;
  border:1px solid #557a55;
  padding:7px 11px;
  border-radius:8px;
  font-weight:700;
  font-size:.95rem;
  cursor:pointer;
  box-shadow: var(--gb-shadow);
  transition: transform .06s ease, background .2s ease, opacity .2s ease;
}
.toolbar-btn:hover{ background:#e2e2d9; transform:translateY(-1px); }

/* Extra knackig auf sehr schmalen Geräten */
@media (max-width: 360px){
  .toolbar-btn{ padding:6px 9px; font-size:.85rem; }
  .kalender-toolbar h2#kalenderMonatsAnzeige{ font-size: clamp(.95rem, 3.6vw, 1.35rem); }
}


.kalender-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
  padding: 12px 14px;
  border-bottom: 1px solid #ddd;
  gap: 8px;
}

.kalender-title {
  flex: 1;
  text-align: center;
  font-weight: bold;
  font-size: 1.2em;
  color: #2b2b2b;
}


.toolbar-btn {
  background: #f5f5f5;
  border: none;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.95em;
  font-weight: 600;
  color: #333;
  cursor: pointer;
  transition: background 0.2s;
}
.toolbar-btn:hover { background: #e0e0e0; }

.kalender-wochentage {
  display: grid;
  grid-template-columns: repeat(7,1fr);
  background: #fafafa;
  border-bottom: 1px solid #eee;
  text-align: center;
  font-weight: 600;
  color: #666;
  font-size: 0.85em;
  padding: 6px 0;
}

.kalender-grid {
  display: grid;
  grid-template-columns: repeat(7,1fr);
  gap: 6px;
  padding: 10px;
}

.kalender-tag {
  background: #fff;
  border-radius: 10px;
  min-height: 70px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  padding: 4px;
  font-size: 0.9em;
  position: relative;
}

.kalender-tag .tag-date {
  font-weight: bold;
  font-size: 0.85em;
  margin-bottom: 4px;
}

.kalender-tag .entries {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}



/*Scroll*/
#kalenderAnsicht, #kalenderGrid {
  touch-action: pan-y; /* verhindert Browser-swipe, erlaubt nur vertikales Scrollen */
}


.wochen-navigation {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin: 12px 0;
}
.wochen-navigation button {
  appearance:none;
  background:#f0f0e9;
  color:#333;
  border:1px solid #557a55;
  padding:7px 11px;
  border-radius:8px;
  font-weight:700;
  font-size:.95rem;
  cursor:pointer;
  box-shadow: var(--gb-shadow);
  transition: transform .06s ease, background .2s ease, opacity .2s ease;
}

/* Wenn Wochenmodus aktiv ist, Monatszeile und Grid ausblenden */
body.week-mode .kalender-wochentage,
body.week-mode #kalenderGrid { display: none !important; }

/* Week-Toolbar folgt exakt dem Monatsstil (Buttons sind schon neutral) */
/* .kalender-toolbar, .toolbar-btn, .kalender-title existieren bereits */
