:root {
    --kalender-blau: #387ec3;
    --button-rot: #ff4444;
    --button-rot-hover: #cc0000;
    --button-disabled: #888;
    --text-weiss: #fff;
    --text-schatten: 2px 2px 4px rgba(0, 0, 0, 0.8);
    --modal-hintergrund: rgba(0, 0, 0, 0.7);
    --modal-bild-hintergrund: rgba(0, 0, 0, 0.9);
}

body {
    font-family: "Amatic SC", cursive;
    font-weight: 400;
    font-style: normal;
    background-image: url('https://adventskalender.hofascommunications.com/images/2dd8a144-f73b-464f-90a1-761c48af8263.jpg');
    background-size: cover;
    background-attachment: fixed;
    margin: 0;
    padding: 20px;
    color: var(--text-weiss);
    min-height: 100vh;
}

/* Header-Bild-Stile */
.header-image {
    width: 300px;
    margin: 0 auto 20px;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.header-img {
    width: 100%;
    height: auto;
    display: block;
    max-height: 250px;
    object-fit: cover;
    border-radius: 8px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
    padding: 20px;
}

h1 {
    font-size: 4rem;
    margin: 0 auto 30px;
    color: var(--text-weiss);
    text-shadow: var(--text-schatten);
    letter-spacing: 1px;
}

/* Kalender-Grid */
.calendar {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 20px;
    margin: 0 auto 40px;
    padding: 0;
}

/* Kästchen-Container */
.box-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Kästchen-Stile */
.box {
    width: 100%;
    max-width: 100px;
    height: 100px;
    perspective: 1000px;
    margin-bottom: 10px;
    cursor: pointer;
}

.box-inner {
    width: 100%;
    height: 100%;
    position: relative;
    transition: transform 0.6s ease;
    transform-style: preserve-3d;
    border-radius: 10px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

/* Vorderseite: Blau mit weißer Nummer */
.box-front {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    background-color: var(--kalender-blau);
    color: var(--text-weiss);
    font-size: 2.5rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-family: "Amatic SC", cursive;
}

/* Rückseite: Weiß mit Thumbnail */
.box-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    background-color: var(--text-weiss);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: rotateY(180deg);
}

/* Mini-Thumbnail auf der Rückseite */
.prize-thumbnail {
    width: 80px;
    height: 80px;
    background-size: cover;
    background-position: center;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: transform 0.2s ease;
}

.prize-thumbnail:hover {
    transform: scale(1.05);
}

/* Nummer als Fallback */
.box-back::after {
    content: attr(data-number);
    position: absolute;
    bottom: 8px;
    right: 8px;
    color: var(--kalender-blau);
    font-size: 1.2rem;
    font-family: "Amatic SC", cursive;
    background-color: rgba(255, 255, 255, 0.8);
    padding: 4px 6px;
    border-radius: 4px;
}

/* Umgedrehte Kästchen zeigen die Rückseite */
.box.flipped .box-inner {
    transform: rotateY(180deg);
}

/* Button-Stile */
.apply-btn {
    background-color: var(--button-rot);
    color: var(--text-weiss);
    border: none;
    padding: 10px;
    border-radius: 20px;
    cursor: pointer;
    width: 100%;
    max-width: 120px;
    font-weight: bold;
    font-size: 1.2rem;
    transition: background-color 0.3s ease;
    font-family: "Amatic SC", cursive;
    margin-top: 5px;
}

.apply-btn:hover:not(:disabled) {
    background-color: var(--button-rot-hover);
}

.apply-btn:disabled {
    background-color: var(--button-disabled);
    cursor: not-allowed;
    opacity: 0.8;
}

/* Bewerbungs-Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--modal-hintergrund);
    z-index: 1000;
    overflow: auto;
}

.modal-content {
    background-color: #fefefe;
    margin: 10% auto;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: modalopen 0.5s;
}

@keyframes modalopen {
    from { opacity: 0; transform: translateY(-50px); }
    to { opacity: 1; transform: translateY(0); }
}

.close {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 1.8rem;
    font-weight: bold;
    color: #333;
    cursor: pointer;
}

.close:hover {
    color: #000;
}

/* Bild-Modal */
.image-modal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: var(--modal-bild-hintergrund);
    overflow: auto;
}

.image-modal-content {
    display: block;
    max-width: 90%;
    max-height: 80%;
    margin: 5vh auto;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.image-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

.image-close:hover {
    color: #bbb;
}

.image-caption {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    text-align: center;
    color: var(--text-weiss);
    font-family: "Amatic SC", cursive;
    font-size: 1.5rem;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 10px;
    margin: 0 20px;
    border-radius: 8px;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.image-modal[style*="display: block"] .image-caption {
    opacity: 1;
}

/* Bild-Navigation (optional) */
.image-nav {
    position: absolute;
    top: 50%;
    width: 100%;
    display: flex;
    justify-content: space-between;
    transform: translateY(-50%);
}

.image-prev, .image-next {
    color: var(--text-weiss);
    font-size: 30px;
    padding: 10px 20px;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.3s;
}

.image-prev:hover, .image-next:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

/* Formular-Stile */
form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

form label {
    font-weight: bold;
    color: #333;
    text-align: left;
    font-family: "Amatic SC", cursive;
    font-size: 1.2rem;
}

form input {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    font-family: sans-serif;
    width: 100%;
    box-sizing: border-box;
}

form input:focus {
    outline: none;
    border-color: var(--kalender-blau);
    box-shadow: 0 0 0 2px rgba(30, 144, 255, 0.2);
}

form button {
    margin-top: 15px;
    background-color: var(--kalender-blau);
    color: var(--text-weiss);
    border: none;
    padding: 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: bold;
    transition: background-color 0.3s ease;
    font-family: "Amatic SC", cursive;
}

form button:hover {
    background-color: #0066cc;
}

.captcha-container {
    margin: 15px 0;
    text-align: left;
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    font-family: sans-serif;
}

/* Footer-Stile */
.footer {
    background-color: var(--kalender-blau);
    color: var(--text-weiss);
    padding: 30px 0;
    margin-top: 50px;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    text-align: center;
}

.footer-links {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-link {
    color: var(--text-weiss);
    text-decoration: none;
    font-family: "Amatic SC", cursive;
    font-size: 1.5rem;
    transition: opacity 0.3s ease;
}

.footer-link:hover {
    opacity: 0.8;
    text-decoration: none;
}

.footer-copyright {
    font-size: 1.2rem;
    margin: 0;
}

.footer-copyright a {
    color: var(--text-weiss);
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.footer-copyright a:hover {
    opacity: 0.8;
}

.footer-social {
    display: flex;
    gap: 20px;
}

.footer-social a {
    color: var(--text-weiss);
    font-size: 1.8rem;
    transition: opacity 0.3s ease;
}

.footer-social a:hover {
    opacity: 0.8;
}

/* Responsive Anpassungen */
@media (max-width: 768px) {
    .calendar {
        grid-template-columns: repeat(4, 1fr);
    }
    h1 {
        font-size: 3rem;
    }
    .header-img {
        max-height: 200px;
    }
    .box-front {
        font-size: 2rem;
    }
    .footer-links {
        flex-direction: column;
        gap: 15px;
    }
    .footer-link {
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    .calendar {
        grid-template-columns: repeat(3, 1fr);
    }
    .box-front {
        font-size: 1.8rem;
    }
    h1 {
        font-size: 2.5rem;
    }
    .modal-content, .image-modal-content {
        margin: 10% auto;
        padding: 20px;
    }
    .image-close {
        font-size: 30px;
        right: 15px;
    }
}

/* Hilfsklassen */
.text-centered {
    text-align: center;
}
.mb-20 {
    margin-bottom: 20px;
}
