/* css/kalender-style.css */

/* --- Layout Grid --- */
.calendar-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 25px;
	margin: 30px 0;
}

/* Rahmen um den Monat */
.month-wrapper {
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 4px;
	padding: 5px;
	box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

/* --- Tabellen Styling --- */
.month-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.85rem;
	font-family: 'Segoe UI', Arial, sans-serif;
	table-layout: fixed;
	/* WICHTIG: Erzwingt gleich breite Spalten */
}

/* Header Grün (#99FF99) */
.month-header {
	background-color: #99FF99 !important;
	color: #000;
	font-weight: bold;
	padding: 6px;
	border: 1px solid #ccc;
	text-align: center;
}

.weekday-row th {
	padding: 4px 0;
	color: #333;
	border-bottom: 1px solid #ddd;
	font-weight: bold;
	text-align: center;
	width: 12.5%;
	/* 100% / 8 Spalten */
	overflow: hidden;
}

.month-table td {
	text-align: center;
	padding: 5px 0;
	border: 1px solid #eee;
	height: 28px;
	vertical-align: middle;
	width: 12.5%;
	overflow: visible;
	cursor: default;
}

/* KW Spalte */
.kw-cell {
	background-color: #f9f9f9;
	font-size: 0.75rem;
	color: #999;
	border-right: 1px solid #ddd;
}

.day-empty {
	background: transparent;
}


/* --- FARBEN & STATUS --- */

/* 1. Basis-Farben für Hintergründe */

/* Gesetzlicher Feiertag (Orange) */
.day-holiday {
	background-color: #FF6633 !important;
	color: black;
	font-weight: normal;
}

/* Teilweiser Feiertag (Schraffiert) */
.day-holiday-part {
	background: repeating-linear-gradient(45deg,
			#ffffff,
			#ffffff 4px,
			#FFD5BF 4px,
			#FFD5BF 8px) !important;
	color: black;
	font-weight: normal;
}

/* Schulferien (Grün) */
.day-vacation {
	background-color: #00FF00 !important;
	color: black;
	font-weight: normal;
}

/* Festtag (Blau) */
.day-fest {
	background-color: #00CCFF !important;
	color: black;
	font-weight: normal;
}

/* Heute (Rahmen) */
.day-today {
	border: 2px solid #000 !important;
	font-weight: bold;
}

/* 2. Sonntag-Logik (MUSS NACH den Hintergründen stehen!) */

/* Grundregel Sonntag: Immer Rot und Fett */
.sun {
	color: #FF0000 !important;
	font-weight: bold !important;
}

/* Kombinationen explizit erzwingen, falls Browser zicken */
.day-holiday.sun,
.day-vacation.sun,
.day-fest.sun,
.day-holiday-part.sun {
	color: #FF0000 !important;
	font-weight: bold !important;
}


/* --- Navigation & Legende (Top-Bereich im Content) --- */
.selection-bar {
	display: flex;
	flex-wrap: wrap;
	gap: 5px;
	margin-bottom: 20px;
	padding: 10px;
	background: #f4f4f4;
	border: 1px solid #ddd;
}

.btn {
	text-decoration: none;
	color: #333;
	background: #fff;
	padding: 4px 8px;
	border: 1px solid #aaa;
	border-radius: 2px;
	font-size: 0.85rem;
}

.btn:hover,
.btn.active {
	background: #2c3e50;
	color: #fff;
}

.legend-container {
	margin-top: 20px;
	padding: 10px;
	background: #ffffcc;
	border: 1px solid #ccc;
}

.legend-item {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 5px;
}

.color-box {
	width: 18px;
	height: 18px;
	border: 1px solid #000;
	display: inline-block;
}


/* --- Modern Tooltip Styles (ähnlich wie altes JS Script) --- */

/* Die Zelle muss relative sein, damit wir das Tooltip absolut dazu positionieren können */
td.has-tooltip {
	position: relative;
	cursor: help;
	/* Zeigt ein Fragezeichen oder Hand an */
}

/* Das eigentliche Tooltip-Fenster (Standard: versteckt) */
.custom-tooltip {
	display: none;
	/* Erstmal unsichtbar */
	position: absolute;
	z-index: 1000;
	/* Über allem anderen liegen */
	bottom: 100%;
	/* Über der Zelle erscheinen */
	left: 50%;
	transform: translateX(-50%);
	/* Zentrieren */

	width: 200px;
	/* Breite festlegen, ggf. anpassen */
	background-color: #EFEFEF;
	/* Heller Hintergrund wie im Bild */
	border: 1px solid #000080;
	/* Der blaue Rahmen aus dem Bild */
	box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.3);
	text-align: left;
	padding: 2px;

	font-family: Verdana, Arial, sans-serif;
	font-size: 11px;
	line-height: 1.3;
	color: #000;
}

/* Tooltip anzeigen beim Hover */
td.has-tooltip:hover .custom-tooltip {
	display: block;
}

/* Header im Tooltip (Wochentag, Datum) */
.tt-header {
	font-weight: bold;
	padding: 3px;
	background-color: #E0E0FF;
	/* Leicht bläulicher Header Hintergrund */
	border-bottom: 1px solid #AAA;
	margin-bottom: 2px;
}

/* Einzelne Zeilen im Tooltip */
.tt-row {
	padding: 3px 5px;
	margin-bottom: 1px;
}

/* Kleiner Text (z.B. "Feiertag in BW") */
.tt-small {
	font-size: 10px;
	font-weight: normal;
}

/* Farben entsprechend deinem alten Code (#FF6633 und #00FF00) */
.tt-bg-holiday {
	background-color: #FF6633;
	color: #000;
}

.tt-bg-vacation {
	background-color: #00FF00;
	/* Oder #66FF66 für etwas heller */
	color: #000;
}

.tt-bg-fest {
	background-color: #00CCFF;
	color: #000;
}


/* Schaltjahre */
.info-card {
  background: #ffffff;
  padding: 30px;
  border-left: 5px solid var(--accent);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  margin-bottom: 40px;
  line-height: 1.6;
}
.rule-box {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  padding: 20px;
  border-radius: 12px;
  margin: 20px 0;
}
.rule-list {
  list-style: none;
  padding: 0;
}
.rule-list li {
  padding-left: 30px;
  position: relative;
  margin-bottom: 10px;
}
.rule-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: bold;
}
.century-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 30px;
}
.century-card {
  background: white;
  padding: 20px;
  border-radius: 10px;
  border: 1px solid var(--border);
  transition: transform 0.2s;
}
.century-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}
.year-link {
  display: inline-block;
  margin: 3px;
  padding: 2px 6px;
  border-radius: 4px;
  text-decoration: none;
  font-size: 0.9rem;
  transition: background 0.2s;
  color: var(--text-main);
}
.year-link:hover {
  background: var(--accent-light);
  color: white !important;
}
.highlight-current {
  background: var(--accent);
  color: white !important;
  font-weight: bold;
  padding: 2px 8px;
}
.next-leap-card {
  background: var(--accent);
  color: white;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.next-leap-card h2 {
  color: white;
  margin: 0;
  border: none;
}
.next-leap-year {
  font-size: 2.5rem;
  font-weight: bold;
}

