/* Grundkonfiguration */
body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #111e25, #1d2a3a); /* Etwas neutralerer, epischer Deep-Blue Look für das ganze Jahr */
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    box-sizing: border-box;
}

.calendar-container {
    width: 100%;
    max-width: 700px;
    margin: 40px auto;
    padding: 0 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

h1 {
    font-size: 2.3rem;
    color: #f1c40f; /* Edles Buch-Gold statt reinem Weihnachts-Rot */
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    margin-bottom: 20px;
}

p {
    font-size: 1rem;
    margin-bottom: 1px;
}

/* NEU: Monats-Navigation */
.month-navigation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 4000px;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.05);
    padding: 10px 20px;
    border-radius: 30px;
    box-shadow: inset 0 1px 3px rgba(255,255,255,0.1);
}

.month-navigation h2 {
    margin: 0;
    font-size: 1.6rem;
    min-width: 150px;
}

.month-navigation button {
    background: #f1c40f;
    border: none;
    color: #111e25;
    font-size: 1.2rem;
    padding: 8px 16px;
    border-radius: 50%;
    cursor: pointer;
    font-weight: bold;
    transition: transform 0.2s, background 0.2s;
}

.month-navigation button:hover {
    background: #f39c12;
    transform: scale(1.1);
}

/* Das Grid-System (Bleibt zentriert und kompakt) */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); /* Kästchen minimal kleiner, damit 31 Stück Platz haben */
    gap: 12px;
    width: 100%;
    max-width: 550px; 
    perspective: 1000px;
}

/* Das quadratische Kästchen */
.door {
    width: 100%;
    aspect-ratio: 1 / 1;
    cursor: pointer;
}

.door-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
    box-shadow: 0 4px 8px rgba(0,0,0,0.4);
    border-radius: 6px;
}

.door.open .door-inner {
    transform: rotateY(180deg);
}

.door-front, .door-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 6px;
    font-weight: bold;
}

/* Vorderseite (Elegantes Bibliotheks-Blau/Grau) */
.door-front {
    background: #2c3e50;
    color: #f1c40f;
    font-size: 1.4rem;
    border: 2px solid #34495e;
}

.door-front:hover {
    background: #34495e;
    transform: scale(1.05);
    transition: all 0.2s ease;
}

/* Rückseite */
.door-back {
    background: #27ae60;
    color: white;
    font-size: 1.2rem;
    transform: rotateY(180deg);
    border: 2px solid #219653;
}

/* === MODAL POP-UP STYLES === */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(5px);
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    display: flex;
    opacity: 1;
}

.modal-content {
    background-color: #fff;
    color: #2c3e50;
    padding: 35px;
    border-radius: 15px;
    width: 85%;
    max-width: 550px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    position: relative;
    text-align: left;
    transform: scale(0.8);
    transition: transform 0.3s ease;
    animation: popIn 0.3s forwards;
}

@keyframes popIn {
    to { transform: scale(1); }
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2rem;
    cursor: pointer;
    color: #95a5a6;
    transition: color 0.2s;
}

.close-btn:hover {
    color: #e74c3c;
}

#modalTitle {
    margin-top: 0;
    color: #2c3e50;
    font-size: 1.8rem;
    border-bottom: 2px solid #f1c40f;
    padding-bottom: 10px;
}

#modalText {
    font-size: 1.15rem;
    line-height: 1.6;
    color: #34495e;
}

hr {
    display: none; /* Nicht mehr nötig dank schönerem Titel-Border */
}