:root {
    --christmas-red: #c41e3a;
    --christmas-green: #0f7f3f;
    --christmas-gold: #ffd700;
    --christmas-silver: #c0c0c0;
    --snow-white: #ffffff;
    --dark-bg: #0a1628;
    --dark-blue: #1a2942;
    --accent-red: #ff4757;
    --accent-green: #2ed573;
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #0a1628 0%, #1a2942 50%, #0f2847 100%);
    color: var(--snow-white);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Snow Animation */
.snow-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.snowflake {
    position: absolute;
    top: -10px;
    color: white;
    font-size: 1em;
    opacity: 0.8;
    animation: fall linear infinite;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

@keyframes fall {
    to {
        transform: translateY(100vh) rotate(360deg);
    }
}

/* Header */
.main-header {
    text-align: center;
    padding: 3rem 2rem 2rem;
    position: relative;
    z-index: 10;
    background: linear-gradient(180deg, rgba(10, 22, 40, 0.9) 0%, rgba(10, 22, 40, 0) 100%);
}

.title {
    font-family: 'Mountains of Christmas', cursive;
    font-size: clamp(2.5rem, 8vw, 5rem);
    font-weight: 700;
    background: linear-gradient(135deg, var(--christmas-gold) 0%, var(--snow-white) 50%, var(--christmas-gold) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
    animation: shimmer 3s infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.title-icon {
    font-size: 1em;
    animation: bounce 2s infinite;
    filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.6));
}

@keyframes shimmer {

    0%,
    100% {
        filter: brightness(1) drop-shadow(0 0 30px rgba(255, 215, 0, 0.5));
    }

    50% {
        filter: brightness(1.2) drop-shadow(0 0 50px rgba(255, 215, 0, 0.8));
    }
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.subtitle {
    font-size: clamp(1rem, 3vw, 1.5rem);
    color: var(--christmas-silver);
    font-weight: 300;
    letter-spacing: 2px;
}

/* Controls */
.controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    padding: 2rem;
    flex-wrap: wrap;
    position: relative;
    z-index: 10;
}

.control-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    border: 2px solid var(--glass-border);
    border-radius: 50px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    color: var(--snow-white);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.control-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.control-btn:hover::before {
    width: 300px;
    height: 300px;
}

.control-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.3);
    border-color: var(--christmas-gold);
}

.control-btn.primary {
    background: linear-gradient(135deg, var(--christmas-red) 0%, #d63447 100%);
    border-color: var(--accent-red);
}

.control-btn.primary:hover {
    box-shadow: 0 10px 30px rgba(255, 71, 87, 0.5);
}

.control-btn.secondary {
    background: linear-gradient(135deg, var(--christmas-green) 0%, #26a65b 100%);
    border-color: var(--accent-green);
}

.control-btn.secondary:hover {
    box-shadow: 0 10px 30px rgba(46, 213, 115, 0.5);
}

.btn-icon {
    font-size: 1.2em;
}

/* Calendar Container */
.calendar-container {
    position: relative;
    z-index: 5;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    transition: all 0.5s ease;
}

.calendar-container.zoomed-in {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.calendar-container.zoomed-out {
    transform: scale(0.85);
    transform-origin: center top;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    perspective: 1000px;
    transition: all 0.5s ease;
    width: 100%;
}

.calendar-container.zoomed-in .calendar-grid {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Calendar Day Box */
.day-box {
    aspect-ratio: 1;
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    border: 2px solid var(--glass-border);
    border-radius: 20px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
    transform-style: preserve-3d;
}

/* Vue zoomée - masquer les cases non ciblées */
.calendar-container.zoomed-in .day-box {
    display: none;
    opacity: 0;
    transform: scale(0);
}

/* Vue zoomée - afficher uniquement la case ciblée */
.calendar-container.zoomed-in .day-box.focused {
    display: flex;
    opacity: 1;
    transform: scale(1.5);
    width: 400px;
    height: 400px;
    max-width: 90vw;
    max-height: 90vw;
}

.day-box::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(transparent, rgba(255, 215, 0, 0.3), transparent 30%);
    animation: rotate 4s linear infinite;
    opacity: 0;
    transition: opacity 0.3s;
}

@keyframes rotate {
    100% {
        transform: rotate(360deg);
    }
}

.day-box:hover::before {
    opacity: 1;
}

.day-box:hover {
    transform: translateY(-10px) rotateX(5deg);
    border-color: var(--christmas-gold);
    box-shadow: 0 20px 60px rgba(255, 215, 0, 0.4), inset 0 0 30px rgba(255, 215, 0, 0.1);
}

.day-number {
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--christmas-gold) 0%, var(--snow-white) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 1;
}

.day-label {
    font-size: 0.9rem;
    color: var(--christmas-silver);
    text-transform: uppercase;
    letter-spacing: 2px;
    position: relative;
    z-index: 1;
}

/* Locked State */
.day-box.locked {
    cursor: not-allowed;
    opacity: 0.5;
    background: rgba(255, 255, 255, 0.05);
}

.day-box.locked:hover {
    transform: none;
    border-color: var(--glass-border);
    box-shadow: none;
}

.day-box.locked::after {
    content: '🔒';
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    opacity: 0.7;
}

/* Opened State */
.day-box.opened {
    background: linear-gradient(135deg, rgba(15, 127, 63, 0.3) 0%, rgba(46, 213, 115, 0.2) 100%);
    border-color: var(--accent-green);
}

.day-box.opened::after {
    content: '✓';
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    color: var(--accent-green);
    animation: checkmark 0.5s ease;
}

@keyframes checkmark {
    0% {
        transform: scale(0) rotate(-180deg);
    }

    100% {
        transform: scale(1) rotate(0);
    }
}

.day-box.current {
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(255, 71, 87, 0.5);
        border-color: var(--accent-red);
    }

    50% {
        box-shadow: 0 0 40px rgba(255, 71, 87, 0.8);
        border-color: var(--christmas-gold);
    }
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 22, 40, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-content {
    background: linear-gradient(135deg, rgba(26, 41, 66, 0.95) 0%, rgba(15, 40, 71, 0.95) 100%);
    border: 2px solid var(--glass-border);
    border-radius: 30px;
    padding: 3rem;
    max-width: 600px;
    width: 90%;
    position: relative;
    backdrop-filter: blur(20px);
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.5), inset 0 0 50px rgba(255, 215, 0, 0.1);
    animation: modalSlideIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-100px) scale(0.8);
        opacity: 0;
    }

    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid var(--glass-border);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
    color: var(--snow-white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.manual-input {
    width: 100%;
    padding: 1rem 1.5rem;
    font-family: 'Poppins', sans-serif;
    font-size: 1.1rem;
    background: var(--glass-bg);
    border: 2px solid var(--glass-border);
    border-radius: 15px;
    color: var(--snow-white);
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.manual-input:focus {
    outline: none;
    border-color: var(--christmas-gold);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.manual-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

/* Responsive */
@media (max-width: 768px) {
    .calendar-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 1rem;
    }

    .day-number {
        font-size: 2rem;
    }

    .modal-content {
        padding: 2rem;
    }

    .emoji-reveal {
        font-size: 5rem;
    }

    .title {
        font-size: 2rem;
    }

    .controls {
        padding: 1rem;
    }

    .control-btn {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
    }

    .calendar-container.zoomed-in .day-box.focused {
        width: 300px;
        height: 300px;
    }
}

@media (max-width: 480px) {
    .calendar-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .calendar-container.zoomed-in .day-box.focused {
        width: 250px;
        height: 250px;
    }
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(10, 22, 40, 0.95);
    color: var(--snow-white);
    padding: 16px 24px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
    border-left: 5px solid var(--christmas-gold);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 2000;
    font-weight: 500;
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-left-width: 5px;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast-icon {
    font-size: 1.5em;
}

/* Countdown Overlay */
.countdown-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 22, 40, 0.85);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.5s ease;
}

.countdown-overlay.active {
    display: flex;
}

.countdown-content {
    text-align: center;
    background: linear-gradient(135deg, rgba(26, 41, 66, 0.9) 0%, rgba(15, 40, 71, 0.9) 100%);
    padding: 3rem;
    border-radius: 30px;
    border: 2px solid var(--christmas-gold);
    box-shadow: 0 0 50px rgba(255, 215, 0, 0.2);
    max-width: 90%;
}

.countdown-content h2 {
    font-family: 'Mountains of Christmas', cursive;
    font-size: 3rem;
    color: var(--christmas-gold);
    margin-bottom: 2rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.countdown-timer {
    display: flex;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
}

.countdown-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    padding: 1.5rem;
    border-radius: 15px;
    min-width: 100px;
    border: 1px solid var(--glass-border);
}

.countdown-item span:first-child {
    font-size: 3rem;
    font-weight: 700;
    color: var(--snow-white);
    font-family: 'Poppins', sans-serif;
    line-height: 1;
}

.countdown-item .label {
    font-size: 0.9rem;
    color: var(--christmas-silver);
    text-transform: uppercase;
    margin-top: 0.5rem;
    letter-spacing: 1px;
}

@media (max-width: 768px) {
    .countdown-timer {
        gap: 1rem;
    }

    .countdown-item {
        min-width: 70px;
        padding: 1rem;
    }

    .countdown-item span:first-child {
        font-size: 2rem;
    }

    .countdown-content h2 {
        font-size: 2rem;
    }
}

.aventstyle {
    /* font-weight: bolder; */
    /* color: #2d5016;*/
    background: linear-gradient(135deg, #ffd700 0%, #ffffff 50%, #ffd700 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Enhanced Modal Styles */
.modal-content {
    max-width: 700px !important;
    padding: 2.5rem !important;
}

.modal-body {
    text-align: center;
    padding: 2rem 1rem;
}

.emoji-reveal {
    font-size: 8rem !important;
    margin: 2rem auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 200px !important;
}

.emoji-reveal img {
    max-width: 100% !important;
    max-height: 450px !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    border-radius: 20px !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4) !important;
    border: 3px solid rgba(255, 215, 0, 0.3) !important;
}

.modal-title {
    font-size: 3rem !important;
    margin-bottom: 1rem !important;
    text-shadow: 0 2px 10px rgba(255, 215, 0, 0.3) !important;
}

.modal-message {
    font-size: 1.8rem !important;
    color: #ffd700 !important;
    margin-top: 2rem !important;
    font-weight: 400 !important;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
    letter-spacing: 1px !important;
    line-height: 1.6 !important;
}

.modal-close {
    position: absolute !important;
    top: 1.5rem !important;
    right: 1.5rem !important;
    background: rgba(255, 255, 255, 0.15) !important;
    border: 2px solid rgba(255, 255, 255, 0.3) !important;
    border-radius: 50% !important;
    width: 45px !important;
    height: 45px !important;
    font-size: 1.8rem !important;
    color: #fff !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.3s ease !important;
    backdrop-filter: blur(5px) !important;
    font-weight: 300 !important;
    line-height: 1 !important;
    z-index: 1001 !important;
}

.modal-close:hover {
    background: #e74c3c !important;
    border-color: #e74c3c !important;
    transform: rotate(90deg) scale(1.1) !important;
    box-shadow: 0 5px 20px rgba(231, 76, 60, 0.5) !important;
}

/* Day Preview */
.day-preview {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    opacity: 0.5;
    pointer-events: none;
    z-index: 0;
}

.day-preview img {
    max-width: 120px;
    max-height: 120px;
    object-fit: cover;
    border-radius: 10px;
    opacity: 0.7;
}

.day-box.opened .day-preview {
    opacity: 0.6;
}

.day-box.opened:hover .day-preview {
    opacity: 0.9;
}

.day-box .day-number,
.day-box .day-label {
    position: relative;
    z-index: 1;
}

/* Credits Footer */
.credits {
    position: fixed;
    bottom: 10px;
    right: 15px;
    z-index: 5;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 300;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

.credits:hover {
    color: rgba(255, 215, 0, 0.8);
}

.credits p {
    margin: 0;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.creator-name {
    font-weight: 600;
    color: var(--christmas-gold);
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

/* Countdown Close Button */
.countdown-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.countdown-close:hover {
    background: rgba(255, 71, 87, 0.8);
    border-color: var(--accent-red);
    transform: rotate(90deg) scale(1.1);
}

.countdown-note {
    margin-top: 2rem;
    font-size: 0.9rem;
    color: var(--christmas-silver);
    opacity: 0.7;
}

@media (max-width: 768px) {
    .credits {
        font-size: 0.65rem;
        bottom: 5px;
        right: 10px;
    }
}