/* ============================================================== 
   vegui.css 
   ============================================================== */

/* Reset / Basics */
* { box-sizing: border-box; }
html,body { height:100%; margin:0; padding:0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial; }
a { color: inherit; text-decoration: none; }

body {
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.45;
}

/* --------------------------------------------------------------
   Container
-------------------------------------------------------------- */
.veg-container {
  max-width: 1300px;  /* <-- maximale Breite */
  margin: 0 auto;
  padding: 5px;      /* <-- vertikaler Abstand oben/unten */
  width: 100%;
}

/* --------------------------------------------------------------
   Card (Header, Content, Footer)
-------------------------------------------------------------- */
.veg-card {
  background: var(--card-bg);
  color: var(--text);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 10px;
  margin-bottom: 10px;
  border: 1px solid var(--border);
}

/* --------------------------------------------------------------
   Header / Footer
-------------------------------------------------------------- */
.veg-header, .veg-footer {
  width: 100%;
  display: flex;
  justify-content: center;
}

/* Card nur Breite ohne zusätzliches Padding, Padding über veg-container */
.veg-header-card, .veg-footer-card {
  width: 100%;
  max-width: 1300px;
  padding: 0px;
}

/* --------------------------------------------------------------
   Logo volle Breite + H1 darüber
-------------------------------------------------------------- */
.veg-logo-box {
  position: relative;
  width: 100%;
  margin-bottom: 12px;
  border-radius: 12px;
  overflow: hidden;
}

.veg-logo-box img {
  width: 100%;
  height: 60px;
  object-fit: cover;
  display: block;
  border-radius: 12px;
}

.veg-logo-box h1 {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: rgba(255,255,255,0.8);
  font-size: 2rem;
  margin: 0;
  pointer-events: none;
  text-shadow: 0 1px 4px rgba(0,0,0,0.6);
}

/* Titel + Navigation + Theme Dropdown darunter */
.veg-title-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

/* Footer Text */
.veg-footer-card {
  text-align: center;
}

/* Navigation */
nav.veg-nav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
nav.veg-nav a {
  padding: 6px 10px;
  border-radius: 6px;
  background: var(--card-bg);
  transition: background 0.2s;
}
nav.veg-nav a:hover {
  background: var(--nav-hover);
}

/* Form Controls */
.veg-select, select, input, textarea {
  padding: 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--input-text);
}

/* Accordion / Tabs / Tables */
.veg-accordion { max-height:0; overflow:hidden; transition:max-height .25s ease; }
.veg-accordion.open { padding-top:10px; }

.veg-tab-buttons { display:flex; gap:8px; margin-bottom:12px; flex-wrap:wrap; }
.veg-tab-btn { padding:8px 14px; border-radius:6px; border:1px solid var(--border); background:var(--card-bg); cursor:pointer; }
.veg-tab-btn:hover { background:var(--nav-hover); }
.veg-tab { display:block; }

.veg-table { width:100%; border-collapse:collapse; margin-top:8px; }
.veg-table th, .veg-table td { padding:8px; border-bottom:1px solid var(--border); text-align:left; }

/* --------------------------------------------------------------
   Themes — html[data-theme="..."]
-------------------------------------------------------------- */
html[data-theme="light"] {
  --bg: #f2f2f2; --text: #222222; --headline: #000000;
  --card-bg: #ffffff; --border: #d5d5d5; --shadow: 0 2px 10px rgba(0,0,0,0.08);
  --link: #006ecc; --nav-hover: rgba(0,0,0,0.04);
  --input-bg: #ffffff; --input-text: #222222;
}

html[data-theme="dark"] {
  --bg: #111214; --text: #e6e6e6; --headline: #ffffff;
  --card-bg: #1e1f22; --border: #333339; --shadow: 0 6px 20px rgba(0,0,0,0.5);
  --link: #4ea8de; --nav-hover: rgba(255,255,255,0.03);
  --input-bg: #222; --input-text: #eaeaea;
}

html[data-theme="forest"] {
  --bg: #eaf6ef; --text: #153d1e; --headline: #102814;
  --card-bg: #ffffff; --border: #a4c9b3; --shadow: 0 3px 12px rgba(0,0,0,0.06);
  --link: #176b3b; --nav-hover: #e7f6ec;
  --input-bg: #fff; --input-text: #153d1e;
}

html[data-theme="ocean"] {
  --bg: #f2fbff; --text: #103645; --headline: #072733;
  --card-bg: #ffffff; --border: #9ec4da; --shadow: 0 3px 12px rgba(0,0,0,0.06);
  --link: #0b6fb8; --nav-hover: #eaf6ff;
  --input-bg: #fff; --input-text: #103645;
}

html[data-theme="solar"] {
  --bg: #fff8e6; --text: #6b5836; --headline: #3e2f16;
  --card-bg: #ffffff; --border: #f0dfb9; --shadow: 0 3px 10px rgba(0,0,0,0.05);
  --link: #b58900; --nav-hover: #fff3d6;
  --input-bg: #fff; --input-text: #6b5836;
}

html[data-theme="sunset"], html[data-theme="sepia"] {
  --bg: #fff4ec; --text: #4b2c18; --headline: #2f170c;
  --card-bg: #ffffff; --border: #f0cbb6; --shadow: 0 3px 10px rgba(0,0,0,0.05);
  --link: #d3552a; --nav-hover: #fff0e6;
  --input-bg: #fff; --input-text: #4b2c18;
}

html[data-theme="midnight"] {
  --bg: #0b1118; --text: #dfe8f2; --headline: #f7fafc;
  --card-bg: #15202a; --border: #263544; --shadow: 0 6px 20px rgba(0,0,0,0.5);
  --link: #78a3ff; --nav-hover: #172533;
  --input-bg: #11202a; --input-text: #dfe8f2;
}

html[data-theme="retro"] {
  --bg: #fbfdec; --text: #33442e; --headline: #23321f;
  --card-bg: #ffffff; --border: #cfe1b5; --shadow: 0 3px 10px rgba(0,0,0,0.04);
  --link: #557a3b; --nav-hover: #f2f9e3;
  --input-bg: #fff; --input-text: #33442e;
}

html[data-theme="contrast"] {
  --bg: #ffffff; --text: #000000; --headline: #000000;
  --card-bg: #ffffff; --border: #000000; --shadow: none;
  --link: #ff0000; --nav-hover: #fff0f0;
  --input-bg: #fff; --input-text: #000;
}

/* --------------------------------------------------------------
   Columns / Items
-------------------------------------------------------------- */
.veg-column p {
  margin: 0;
  line-height: 1.2;
  font-size: 0.90rem;
  position: relative;
}

/* Standard Spalten-H2 */
.veg-column h2 {
  font-size: 1.2rem;
  margin-bottom: 8px;
}

/* Einheitliche Größe für Legend/Zeitraum */
.veg-column-h2 {
  font-size: 1.2rem;
  margin-bottom: 8px;
}

/* Checkbox unsichtbar */
.veg-column input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* Label als Block */
.veg-column label {
  display: block;
  padding: 2px 6px;
  border-radius: 4px;
  transition: background-color 0.2s, box-shadow 0.2s, transform 0.2s, color 0.2s, outline 0.2s;
  cursor: pointer;
}

/* Global Text Colors */
.good { color: #4CAF50 !important; }
.bad { color: #F44336 !important; }
.neutral { color: inherit !important; }



/* GOOD / BAD / NEUTRAL Farben */
.veg-column p.good label { color: #4CAF50; }
.veg-column p.bad label { color: #F44336; }
.veg-column p.neutral label { color: inherit; }

.veg-column p.good input[type="checkbox"]:checked + label { color: #4CAF50 !important; font-weight:bold; }
.veg-column p.bad input[type="checkbox"]:checked + label { color: #F44336 !important; font-weight:bold; }
.veg-column p.neutral input[type="checkbox"]:checked + label { color: inherit !important; font-weight:bold; }

.veg-legend-h2 {
    font-size: 1.2rem; /* gleich wie .veg-column h2 */
    font-weight: bold; /* optional: normal oder 600 je nach Geschmack */
    margin-bottom: 8px; /* identisch zu .veg-column h2 */
}

/* --------------------------------------------------------------
   Engere Abstände für Legenden-Text rechts
   Wird für "positiv", "neutral" und "negativ" verwendet
-------------------------------------------------------------- */
.legend-tight {
    margin-left: -185px; /* Abstand nach Bedarf anpassen */
}

/* Reduziert den Abstand zwischen Legende und Zeitraum */
.legend-compact {
    margin-bottom: -10px; /* anpassen nach Geschmack */
}


/* --------------------------------------------------------------
   grid fuer Kalender
-------------------------------------------------------------- */
/* Veg-Grid Table */
.veg-grid-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed; /* Alle Monats-Spalten gleich breit */
    text-align: center;
    font-size: 0.9rem;
}

/* Spaltenbreiten */
.veg-grid-table .veg-col-first {
    width: 180px; /* mindestens so breit wie "Kapuzinerkresse" */
    text-align: left;
}

.veg-grid-table th,
.veg-grid-table td {
    border: 1px solid #ccc; /* dünne Linien */
    padding: 1px 6px;
}

/* Monatsüberschrift */
.veg-grid-table thead th {
    font-weight: bold;
    border-bottom: 1px solid #999;
}


/* checkbox-icons legende*/
.veg-check {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 3px;
    margin-right: 6px;
}

.veg-check.green { background: #4CAF50; }  /* Anzucht */
.veg-check.blue  { background: #2196F3; }  /* Pflanzung */
.veg-check.red   { background: #F44336; }  /* Direktsaat */

/* Zeitraum-Zellen Kalender */
.veg-selected-green { background: #4CAF50; color: #fff; }  /* Anzucht */
.veg-selected-blue  { background: #2196F3; color: #fff; }  /* Pflanzung */
.veg-selected-red   { background: #F44336; color: #fff; }  /* Direktsaat */



/* Zeitraum-PDF Button */
.veg-legend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.veg-create-pdf-btn {
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    color: var(--text);
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.veg-create-pdf-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.veg-create-pdf-btn:hover:enabled {
    background: var(--nav-hover);
    transform: scale(1.03);
}




/* --------------------------------------------------------------
   Hover Effekte für helle Themes
-------------------------------------------------------------- */
html[data-theme="light"],
html[data-theme="forest"],
html[data-theme="ocean"],
html[data-theme="solar"],
html[data-theme="sunset"],
html[data-theme="sepia"],
html[data-theme="retro"],
html[data-theme="contrast"] {
  .veg-column p:hover label {
    background-color: rgba(0,0,0,0.18);
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    outline: 1px solid rgba(0,0,0,0.25);
    outline-offset: 1px;
    transform: scale(1.05);
  }
  .veg-column input[type="checkbox"]:checked + label {
    background-color: rgba(0,0,0,0.18);
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  }
}

/* --------------------------------------------------------------
   Hover Effekte für dunkle Themes
-------------------------------------------------------------- */
html[data-theme="dark"],
html[data-theme="midnight"] {
  .veg-column p:hover label {
    background-color: rgba(255,255,255,0.18);
    box-shadow: 0 2px 6px rgba(255,255,255,0.15);
    outline: 1px solid rgba(255,255,255,0.25);
    outline-offset: 1px;
    transform: scale(1.05);
  }
  .veg-column input[type="checkbox"]:checked + label {
    background-color: rgba(255,255,255,0.18);
    box-shadow: 0 2px 6px rgba(255,255,255,0.15);
  }
}

/* --------------------------------------------------------------
   Linke Spalten nebeneinander (anstatt Inline-Styles)
-------------------------------------------------------------- */
/* Flexbox für die linken 4 Spalten */
.veg-card.flex-columns {
    display: flex;
    flex-direction: row; /* nebeneinander */
    gap: 10px;
    flex-wrap: nowrap; /* oder wrap, wenn du willst, dass es bei kleiner Breite umbrechen darf */
}

.veg-card.flex-columns .veg-column {
    flex: 1 1 0; /* gleichmäßige Breite */
    min-width: 0; /* verhindert Überlauf */
}



/* Responsive: Spalten umbrechen bei kleinen Bildschirmen */


@media (max-width: 900px) {
    .veg-card.flex-columns {
        flex-wrap: wrap;  /* Spalten umbrechen */
        width: 100%;      /* volle Breite */
    }
    .veg-column {
        flex: 1 1 45%;    /* max. 45% Breite pro Spalte */
        min-width: 200px; /* verhindert zu kleine Spalten */
    }
}

/* --------------------------------------------------------------
   Responsive
-------------------------------------------------------------- */
@media (max-width: 768px) {
  .veg-container { padding:14px; }
  .veg-title-nav { flex-direction: column; align-items:flex-start; gap:10px; }
}

@media (max-width: 480px) {
  .veg-container { padding:12px; }
  .veg-logo-box img { height:30px; }
  .veg-logo-box h1 { font-size:1.5rem; }
}
