.grid-container {
    display: grid;
    grid-template-columns: repeat(7, 1fr); /* 7 Tage Woche */
    gap: 5px;
}

.category-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 10px;
    margin-bottom: 15px;
    text-align: center;
}

.category-item {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    font-size: 0.75em;
    color: var(--text-light);
}

.day-number {
    font-size: 0.9em;
    color: var(--text-dark);
    margin-bottom: 5px;
    display: block;
}

.day {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    padding: 8px;
    display: flex;
    flex-direction: column;
    
    /* ERZWINGT GLEICHE GRÖSSE */
    aspect-ratio: 1 / 1;      /* Macht das Feld quadratisch */
    min-width: 0;             /* Verhindert das Aufblähen des Grids */
    overflow-y: auto;         /* Fügt Scrollbalken hinzu, falls zu viele Events */
    box-sizing: border-box;   /* Padding wird in die Größe eingerechnet */
}

/* Optional: Den Scrollbalken dezent stylen (nur Webkit/Chrome/Safari) */
.day::-webkit-scrollbar {
    width: 4px;
}
.day::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}

/* Padding-Days (Tage vom Vormonat) dezent ausgrauen */
.day.padding {
    background: #f9f9f9;
}

.calendar-header-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-weight: bold;
    background: var(--primary-color);
    padding: 10px 0;
}

/* Das Haupt-Grid für die Tage */
#calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr); /* 7 Spalten nebeneinander */
    gap: 1px; /* Kleiner Abstand zwischen den Tagen */
    background-color: #ccc; /* Gitterlinien-Farbe */
    border: 1px solid #ccc;
    min-height: 400px; /* Damit das Grid nicht 0px hoch ist */
}

.day.padding {
    background-color: #f9f9f9;
    border: 1px solid #eee; /* Dezentere Optik */
}

.event-btn {
    background: var(--primary-light);
    color: white;
    border: none;
    border-radius: 3px;
    padding: 2px 5px;
    margin-top: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    overflow: hidden;
    display: block;
    width: 100%;
    height: 50%;
}

#year-input, input[type="number"], select {
    width: 80px;
    padding: 5px;
    font-size: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-dark);
    background: var(--bg-dark)
}

/* Das Overlay (Hintergrund) */
.modal-overlay {
    display: none; /* Standardmäßig unsichtbar */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6); /* Abdunkelung */
    backdrop-filter: blur(3px); /* Moderner Blur-Effekt */
    justify-content: center;
    align-items: center;
}

/* Das eigentliche Fenster */
.modal-content {
    background-color: var(--card-bg);
    padding: 25px;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 30px var(--border-color);
    position: relative;
    animation: fadeIn 0.3s ease-out;
}

#modal-body {
    color: var(--border-color); /* Sicherstellen, dass der Text dunkel ist */
    margin-top: 20px;
    text-align: left;
    line-height: 1.6;
}

#modal-body h2 {
    margin-top: 0;
    color: var(--primary-color);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Schließen-Button (X oben rechts) */
.close-button {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--bg-light);
}

.close-button:hover { color: var(--); }

/* Styling für den Buchungslink */
.btn-booking {
    display: inline-block;
    margin-top: 20px;
    padding: 12px 20px;
    background-color: var(--primary-dark);
    color: var(--text-light);
    text-decoration: none;
    border-radius: 6px;
    font-weight: bold;
    text-align: center;
}

.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border-left-color: var(--info-color);
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Container für den Ladezustand */
#loading-overlay {
    grid-column: 1 / span 7; /* Nimmt die ganze Breite im Grid ein */
    text-align: center;
    padding: 40px;
}

.day.is-today {
    background-color: (--primary-color); /* Leichtes Gelb */
    border: 2px solid (--warning-color));
}

.day.is-today span {
    font-weight: bold;
    color: var(--primary-color);
}

/* Mehrtägige Events erhalten eine andere Farbe oder ein Icon */
.event-btn.multi-day {
    border-left: 4px solid var(--accent-color);
}

.modal-meta {
    background: var(--bg-light);
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 0.95em;
}

.modal-meta p {
    margin: 5px 0;
    color: var(--text-light);
}

.modal-description {
    margin: 20px 0;
    white-space: pre-wrap; /* Erhält Zeilenumbrüche aus der Datenbank */
    color: var(--text-light);
}

@media (max-width: 768px) {
    .event-btn {
        height: 70%;
    }
}

@media (max-width: 768px) {
    .event-btn {
        height: 80%;
    }
}

@media (max-width: 480px) {
    .event-btn {
        height: 90%;
    }
}