/**
 * ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 * WINTERRÄTSEL KALENDER V2 - PREMIUM STYLES
 * ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 * 
 * Modernes Glassmorphism Design mit:
 * - Smooth Animations
 * - Hover Effects
 * - Status-basierte Farbgebung
 * - Dark Mode Support
 * - Responsive Layout
 * 
 * @version 2.0.0
 * ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 */

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   KALENDER SECTION
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.calendar-section {
    padding: 4rem 0 6rem;
    background: linear-gradient(
        to bottom,
        rgba(255, 255, 255, 1),
        rgba(212, 165, 116, 0.05)
    );
    position: relative;
    overflow: hidden;
}

/* Animated Background Snowflakes */
.calendar-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(212, 165, 116, 0.1) 1px, transparent 1px),
        radial-gradient(circle at 80% 20%, rgba(15, 39, 77, 0.1) 1px, transparent 1px),
        radial-gradient(circle at 40% 80%, rgba(212, 165, 116, 0.08) 1px, transparent 1px);
    background-size: 50px 50px, 80px 80px, 100px 100px;
    animation: snowfall 20s linear infinite;
    pointer-events: none;
    opacity: 0.5;
}

@keyframes snowfall {
    0% { transform: translateY(0); }
    100% { transform: translateY(100px); }
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   KALENDER GRID
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

#calendar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 1rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    position: relative;
    z-index: 1;
}

@media (min-width: 640px) {
    #calendar-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 1.25rem;
    }
}

@media (min-width: 768px) {
    #calendar-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (min-width: 1024px) {
    #calendar-grid {
        grid-template-columns: repeat(7, 1fr);
    }
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   KALENDER TÜRCHEN - DAS HERZSTÜCK
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.calendar-door {
    position: relative;
    aspect-ratio: 1;
    background: linear-gradient(to bottom, #e6f1ff, #d0def7);
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 6px 12px rgba(15, 39, 77, 0.06);
    color: #4b5563;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Quicksand', sans-serif;
    font-weight: 700;
    overflow: visible;
    outline: none;
    transform-style: preserve-3d;
}

.calendar-door:focus-visible {
    outline: 3px solid rgba(212, 165, 116, 0.6);
    outline-offset: 3px;
}

.calendar-door-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    position: relative;
    z-index: 2;
}

.calendar-door-number {
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 800;
    line-height: 1;
    background: linear-gradient(135deg, #4a90e2 0%, #5ba3f5 50%, #7bb8ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
}

.calendar-door-icon {
    font-size: clamp(1.25rem, 3vw, 1.5rem);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.calendar-door-partner {
    font-size: 0.65rem;
    font-weight: 600;
    text-align: center;
    opacity: 0.9;
    line-height: 1.2;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   STATUS-BASIERTE STYLES - DIE MAGIE
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

/* 🔒 LOCKED - Gesperrt */
.calendar-door.status-locked {
    background: linear-gradient(to bottom, #eef3fc, #dde5f7);
    color: #9ca3af;
    cursor: not-allowed;
    box-shadow: 0 2px 8px rgba(15, 39, 77, 0.04);
}

.calendar-door.status-locked .calendar-door-number {
    background: linear-gradient(135deg, #b0c4de 0%, #c8d8e8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.calendar-door.status-locked:hover {
    transform: scale(0.98);
}

/* ⭐ TODAY - Heutiges Türchen */
.calendar-door.status-today {
    background: linear-gradient(
        135deg,
        #d4a574 0%,
        #c99860 100%
    );
    color: white;
    box-shadow: 
        0 8px 32px rgba(212, 165, 116, 0.4),
        0 0 0 4px rgba(212, 165, 116, 0.2),
        inset 0 -2px 8px rgba(0, 0, 0, 0.2),
        inset 0 2px 8px rgba(255, 255, 255, 0.3);
    animation: pulse-today 2s ease-in-out infinite;
    transform: scale(1.05);
}

@keyframes pulse-today {
    0%, 100% {
        box-shadow: 
            0 8px 32px rgba(212, 165, 116, 0.4),
            0 0 0 4px rgba(212, 165, 116, 0.2),
            inset 0 -2px 8px rgba(0, 0, 0, 0.2),
            inset 0 2px 8px rgba(255, 255, 255, 0.3);
    }
    50% {
        box-shadow: 
            0 12px 40px rgba(212, 165, 116, 0.6),
            0 0 0 6px rgba(212, 165, 116, 0.3),
            inset 0 -2px 8px rgba(0, 0, 0, 0.2),
            inset 0 2px 8px rgba(255, 255, 255, 0.3);
    }
}

.calendar-door.status-today:hover {
    transform: scale(1.08) translateY(-4px);
    box-shadow: 
        0 16px 48px rgba(212, 165, 116, 0.5),
        0 0 0 6px rgba(212, 165, 116, 0.3);
}

.calendar-door.status-today:active {
    transform: scale(1.02);
}

/* 🎁 UNLOCKED - Verfügbar */
.calendar-door.status-unlocked {
    background: linear-gradient(
        135deg,
        rgba(212, 165, 116, 0.15) 0%,
        rgba(212, 165, 116, 0.08) 100%
    );
    color: #d4a574;
    -webkit-backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    box-shadow: 
        0 4px 16px rgba(212, 165, 116, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.6),
        inset 0 -1px 0 rgba(212, 165, 116, 0.2);
    border: 2px solid rgba(212, 165, 116, 0.3);
}

.calendar-door.status-unlocked:hover {
    background: linear-gradient(
        135deg,
        rgba(212, 165, 116, 0.25) 0%,
        rgba(212, 165, 116, 0.15) 100%
    );
    transform: translateY(-4px) scale(1.05);
    box-shadow: 
        0 8px 24px rgba(212, 165, 116, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.6),
        inset 0 -1px 0 rgba(212, 165, 116, 0.2);
    border-color: rgba(212, 165, 116, 0.5);
}

.calendar-door.status-unlocked:active {
    transform: translateY(-2px) scale(1.02);
}

/* ✅ SOLVED - Gelöst */
.calendar-door.status-solved {
    background: linear-gradient(
        135deg,
        rgba(34, 197, 94, 0.2) 0%,
        rgba(34, 197, 94, 0.1) 100%
    );
    color: rgb(21, 128, 61);
    backdrop-filter: blur(12px);
    box-shadow: 
        0 4px 16px rgba(34, 197, 94, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.6),
        inset 0 -1px 0 rgba(34, 197, 94, 0.2);
    border: 2px solid rgba(34, 197, 94, 0.3);
    cursor: default;
}

.calendar-door.status-solved:hover {
    background: linear-gradient(
        135deg,
        rgba(34, 197, 94, 0.25) 0%,
        rgba(34, 197, 94, 0.15) 100%
    );
    transform: scale(1.02);
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   TOOLTIP
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.calendar-door-tooltip {
    position: absolute;
    bottom: calc(100% + 0.75rem);
    left: 50%;
    transform: translateX(-50%) scale(0.9);
    background: rgba(15, 39, 77, 0.95);
    color: white;
    padding: 0.625rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.calendar-door-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(15, 39, 77, 0.95);
}

.calendar-door:hover .calendar-door-tooltip {
    opacity: 1;
    transform: translateX(-50%) scale(1);
}

.calendar-door.status-locked:hover .calendar-door-tooltip {
    opacity: 1;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   MODAL - RÄTSEL-ANZEIGE
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.calendar-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 39, 77, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    padding: 1rem;
}

.calendar-modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content-enhanced {
    background: white;
    border-radius: 1.25rem;
    box-shadow: 
        0 24px 64px rgba(15, 39, 77, 0.3),
        0 0 0 1px rgba(15, 39, 77, 0.05);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.calendar-modal-overlay.active .modal-content-enhanced {
    transform: scale(1);
}

.modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid rgba(15, 39, 77, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(to bottom, white, rgba(212, 165, 116, 0.02));
}

.modal-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f274d;
    margin: 0;
    font-family: 'Quicksand', sans-serif;
}

.modal-close {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.5rem;
    border: none;
    background: rgba(15, 39, 77, 0.05);
    color: #0f274d;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    line-height: 1;
}

.modal-close:hover {
    background: rgba(15, 39, 77, 0.1);
    transform: scale(1.1);
}

.modal-body {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   RÄTSEL-ANZEIGE IM MODAL
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.puzzle-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #0f274d;
    margin: 0 0 0.5rem 0;
    font-family: 'Quicksand', sans-serif;
}

.partner-info {
    color: #d4a574;
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 1.5rem 0;
}

.puzzle-display {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.puzzle-display h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f274d;
    margin: 0;
}

.puzzle-description,
.puzzle-question p {
    color: rgba(15, 39, 77, 0.8);
    line-height: 1.6;
    margin: 0.5rem 0;
}

.puzzle-question,
.partner-riddle {
    background: rgba(212, 165, 116, 0.08);
    border-left: 4px solid #d4a574;
    padding: 1rem 1.25rem;
    border-radius: 0.5rem;
}

.puzzle-question strong,
.partner-riddle strong {
    color: #0f274d;
    font-weight: 700;
    display: block;
    margin-bottom: 0.5rem;
}

.puzzle-answer-section {
    background: rgba(15, 39, 77, 0.02);
    padding: 1.5rem;
    border-radius: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.puzzle-answer-section label {
    font-weight: 700;
    color: #0f274d;
    font-size: 0.9rem;
}

.puzzle-answer-input {
    width: 100%;
    padding: 0.875rem 1.125rem;
    border: 2px solid rgba(15, 39, 77, 0.15);
    border-radius: 0.5rem;
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
    transition: all 0.2s ease;
    outline: none;
}

.puzzle-answer-input:focus {
    border-color: #d4a574;
    box-shadow: 0 0 0 4px rgba(212, 165, 116, 0.1);
}

.btn-submit-answer {
    padding: 0.875rem 2rem;
    background: linear-gradient(135deg, #d4a574 0%, #c99860 100%);
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Quicksand', sans-serif;
    box-shadow: 0 4px 12px rgba(212, 165, 116, 0.3);
}

.btn-submit-answer:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(212, 165, 116, 0.4);
}

.btn-submit-answer:active {
    transform: translateY(0);
}

.puzzle-result {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 0.5rem;
    text-align: center;
}

.success-message {
    background: rgba(34, 197, 94, 0.1);
    border: 2px solid rgba(34, 197, 94, 0.3);
    color: rgb(21, 128, 61);
    padding: 1.5rem;
    border-radius: 0.75rem;
}

.success-message h4 {
    font-size: 1.5rem;
    margin: 0 0 0.5rem 0;
}

.success-message p {
    margin: 0.25rem 0;
}

.error {
    background: rgba(239, 68, 68, 0.1);
    border: 2px solid rgba(239, 68, 68, 0.3);
    color: rgb(185, 28, 28);
    padding: 1rem;
    border-radius: 0.5rem;
}

.loading {
    text-align: center;
    color: rgba(15, 39, 77, 0.6);
    font-style: italic;
}

.partner-info-box {
    background: rgba(212, 165, 116, 0.08);
    padding: 1.5rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(212, 165, 116, 0.2);
}

.partner-info-box h4 {
    color: #d4a574;
    font-size: 1.25rem;
    margin: 0 0 0.5rem 0;
}

.partner-info-box p {
    color: rgba(15, 39, 77, 0.8);
    margin: 0.25rem 0;
    line-height: 1.6;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   DARK MODE SUPPORT
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

[data-theme="dark"] .calendar-section {
    background: linear-gradient(
        to bottom,
        #0a1628,
        rgba(15, 39, 77, 0.5)
    );
}

[data-theme="dark"] .calendar-door.status-locked {
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.05) 0%,
        rgba(255, 255, 255, 0.02) 100%
    );
    color: rgba(255, 255, 255, 0.3);
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .calendar-door.status-unlocked {
    background: linear-gradient(
        135deg,
        rgba(212, 165, 116, 0.2) 0%,
        rgba(212, 165, 116, 0.1) 100%
    );
    color: #d4a574;
    border-color: rgba(212, 165, 116, 0.4);
}

[data-theme="dark"] .calendar-door.status-solved {
    background: linear-gradient(
        135deg,
        rgba(34, 197, 94, 0.25) 0%,
        rgba(34, 197, 94, 0.15) 100%
    );
    color: rgb(134, 239, 172);
    border-color: rgba(34, 197, 94, 0.4);
}

[data-theme="dark"] .modal-content-enhanced {
    background: rgba(15, 39, 77, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .modal-header {
    background: linear-gradient(
        to bottom,
        rgba(15, 39, 77, 0.95),
        rgba(15, 39, 77, 0.98)
    );
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .modal-header h3 {
    color: rgba(255, 255, 255, 0.95);
}

[data-theme="dark"] .modal-close {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.9);
}

[data-theme="dark"] .modal-close:hover {
    background: rgba(255, 255, 255, 0.15);
}

[data-theme="dark"] .puzzle-header h2 {
    color: rgba(255, 255, 255, 0.95);
}

[data-theme="dark"] .puzzle-description,
[data-theme="dark"] .puzzle-question p {
    color: rgba(255, 255, 255, 0.7);
}

[data-theme="dark"] .puzzle-question,
[data-theme="dark"] .partner-riddle {
    background: rgba(212, 165, 116, 0.12);
}

[data-theme="dark"] .puzzle-answer-section {
    background: rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .puzzle-answer-input {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.9);
}

[data-theme="dark"] .puzzle-answer-input:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: #d4a574;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   RESPONSIVE OPTIMIERUNGEN
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

@media (max-width: 640px) {
    .calendar-door {
        border-radius: 0.75rem;
        padding: 0.75rem;
    }

    .calendar-door-tooltip {
        font-size: 0.625rem;
        padding: 0.5rem 0.75rem;
    }

    .modal-header {
        padding: 1rem 1.25rem;
    }

    .modal-body {
        padding: 1.25rem;
    }

    .modal-header h3 {
        font-size: 1.25rem;
    }

    .puzzle-header h2 {
        font-size: 1.375rem;
    }
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   ACCESSIBILITY
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

@media (prefers-reduced-motion: reduce) {
    .calendar-door,
    .calendar-door-tooltip,
    .modal-content-enhanced,
    .btn-submit-answer {
        transition: none;
    }

    .calendar-section::before {
        animation: none;
    }

    .calendar-door.status-today {
        animation: none;
    }
}
