/* ----------------------------------------------------
   BASIC FONT + COLORS
---------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600&display=swap');

:root {
  --bg: #f7f7f7;
  --text: #111;
  --border: #dcdcdc;
  --event-bg: #eaf6ff;
  --event-border: #cfe5ff;
  --header-bg: #004aad;
  --header-text: #fff;
}

:root.dark {
  --bg: #1a1a1a;
  --text: #e0e0e0;
  --border: #444;
  --event-bg: #2a3b4f;
  --event-border: #39506b;
  --header-bg: #003070;
  --header-text: #fff;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", Arial, sans-serif;
  max-width: 1400px;
  margin: 0 auto;
  padding: 10px;
}

/* ----------------------------------------------------
   HEADER
---------------------------------------------------- */
header { text-align: center; margin-bottom: 8px; }

header img {
  width: 100%;
  max-height: 80px;
  object-fit: contain;
}

h1 {
  text-align: center;
  margin-bottom: 5px;
}

#darkModeToggle {
  display: block;
  margin: 0 auto 10px auto;
}

/* ----------------------------------------------------
   TABLE (extra kompakt)
---------------------------------------------------- */
.table-wrap {
  overflow-x: auto;
  background: white;
  border: 1px solid var(--border);
  padding: 1px;
  border-radius: 6px;
}

table {
  width: 100%;
  min-width: 1200px;
  border-collapse: collapse;
}

th, td {
  border: 1px solid var(--border);
  padding: 1px 2px;      /* deutlich kleiner */
  font-size: 11px;       /* vorher 13px */
  line-height: 1.05;     /* sehr kompakt */
}

thead th {
  background: var(--header-bg);
  color: var(--header-text);
  font-size: 12px;
}

td.daynum {
  width: 18px;
  font-weight: bold;
  text-align: right;
  padding-right: 4px;
  background: #fafafa;
  font-size: 10px;
}

/* extrem kleine Leerzellen */
td.empty {
  height: 1px !important;
  min-height: 1px !important;
  padding: 0 !important;
  font-size: 0;
}

td.invalid {
  height: 1px !important;
  padding: 0;
  font-size: 0;
}

/* EVENT BOXES noch kleiner */
.event {
  background: var(--event-bg);
  border: 1px solid var(--event-border);
  border-radius: 2px;
  padding: 1px 2px;
  margin-bottom: 1px;
  cursor: pointer;
}

.ev-title { font-weight: 600; font-size: 10px; }
.ev-time { font-size: 9px; opacity: 0.9; }

/* ----------------------------------------------------
   LIGHTBOX
---------------------------------------------------- */
.lightbox {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 999;
}

.lightbox.hidden { display: none; }

.lightbox-content {
  background: white;
  border-radius: 8px;
  padding: 15px;
  width: 280px;
  text-align: center;
  position: relative;
}

#lightboxClose {
  position: absolute;
  right: 10px; top: 6px;
  font-size: 24px;
  cursor: pointer;
}

footer {
  text-align: center;
  margin-top: 20px;
  font-size: 13px;
  opacity: 0.8;
}

/* ----------------------------------------------------
   BUTTONS
---------------------------------------------------- */
.controls { text-align: center; margin-top: 10px; }

button {
  padding: 6px 10px;
  margin: 4px;
  font-size: 13px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: white;
  cursor: pointer;
}

/* ----------------------------------------------------
   PRINT MODE — Logo, Überschrift, Tabelle + Footer
---------------------------------------------------- */
@media print {

  /* Farben beim Drucken erzwingen */
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    color-adjust: exact !important;
  }

  /* Standardmäßig alles ausblenden */
  body * {
    visibility: hidden !important;
  }

  /* Diese Elemente sollen gedruckt werden */
  header, header *,
  h1,
  .table-wrap, .table-wrap *,
  footer, footer * {
    visibility: visible !important;
  }

  body {
    margin: 0;
    padding: 0;
    background: white !important;
  }

  @page {
    size: A4 landscape;
    margin: 4mm;
  }

  header {
    margin-bottom: 5px !important;
  }

  h1 {
    text-align: center !important;
    margin: 5px 0 5px 0 !important;
  }

  /* Scrollbar vermeiden */
  .table-wrap {
    overflow: visible !important;
  }

  /* Höhe optimiert – passt auf 1 Seite */
  table {
    transform: scale(0.95);
    transform-origin: top left;
    min-width: 100%;
  }

  th, td {
    padding: 0.5px !important;
    font-size: 9px !important;
    line-height: 1 !important;
  }

  .event {
    padding: 0.5px !important;
    margin-bottom: 0.5px !important;
  }

  /* Footer unten zentriert im Ausdruck */
  footer {
    position: fixed;
    bottom: 4mm;
    left: 0;
    width: 100%;
    text-align: center;
    font-size: 10px !important;
    visibility: visible !important;
  }
}


