/* ===== CHRISTMAS CALENDAR SPECTACULAR STYLES ===== */

/* Ensure no conflicting scroll contexts */
body.christmas-page-active {
    overflow-x: hidden !important;
}

/* Page Background */
.christmas-page {
    background: linear-gradient(135deg, #0c4a6e 0%, #1e40af 50%, #7c3aed 100%);
    background-attachment: fixed;
    position: relative;
    width: 100%;
    padding-top: 20px; /* Space for Christmas lights */
    padding-bottom: 2rem; /* Add some bottom padding */
}

.christmas-page::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="2" fill="white" opacity="0.3"/></svg>') repeat;
    animation: twinkle 4s infinite;
    pointer-events: none;
    z-index: 1;
}

.christmas-page::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        /* TeknoParrot logos scattered */
        radial-gradient(circle at 20% 30%, rgba(255, 215, 0, 0.1) 0%, transparent 30%),
        radial-gradient(circle at 80% 20%, rgba(0, 255, 127, 0.08) 0%, transparent 25%),
        radial-gradient(circle at 40% 70%, rgba(255, 69, 0, 0.06) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(30, 144, 255, 0.05) 0%, transparent 15%),
        radial-gradient(circle at 10% 90%, rgba(255, 20, 147, 0.04) 0%, transparent 18%),
        /* Arcade cabinet silhouettes */
        linear-gradient(45deg, transparent 48%, rgba(255, 255, 255, 0.02) 49%, rgba(255, 255, 255, 0.02) 51%, transparent 52%),
        /* Circuit board pattern */
        repeating-linear-gradient(90deg, transparent, transparent 98px, rgba(0, 255, 255, 0.03) 100px),
        repeating-linear-gradient(0deg, transparent, transparent 98px, rgba(255, 215, 0, 0.02) 100px);
    pointer-events: none;
    z-index: 1;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.8; }
}

/* Header Styles */
.christmas-header {
    text-align: center;
    padding: 2rem 1rem;
    position: relative;
    z-index: 10;
}

.christmas-title {
    font-size: 3rem;
    font-weight: bold;
    color: #fff;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.5);
    margin-bottom: 1rem;
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from { text-shadow: 3px 3px 6px rgba(0,0,0,0.5), 0 0 20px rgba(255,255,255,0.3); }
    to { text-shadow: 3px 3px 6px rgba(0,0,0,0.5), 0 0 30px rgba(255,255,255,0.5); }
}

.sparkle {
    animation: sparkle 1.5s infinite;
    display: inline-block;
}

@keyframes sparkle {
    0%, 100% { transform: scale(1) rotate(0deg); opacity: 1; }
    50% { transform: scale(1.2) rotate(180deg); opacity: 0.8; }
}

.countdown-container {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 1rem 2rem;
    display: inline-block;
    border: 2px solid rgba(255,255,255,0.2);
}

.next-unlock, .christmas-complete, .christmas-coming-soon {
    color: #fff;
    font-size: 1.2rem;
    font-weight: 600;
}

/* Calendar Grid */
.christmas-calendar-container {
    position: relative;
    z-index: 5;
    padding: 2rem;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    overflow: hidden; /* Prevent content from bleeding out */
    box-sizing: border-box; /* Include padding in width calculations */
    background: 
        /* TeknoParrot themed overlay */
        radial-gradient(circle at 15% 15%, rgba(255, 215, 0, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 85% 20%, rgba(0, 255, 127, 0.12) 0%, transparent 35%),
        radial-gradient(circle at 50% 80%, rgba(255, 69, 0, 0.10) 0%, transparent 30%),
        radial-gradient(circle at 20% 90%, rgba(30, 144, 255, 0.08) 0%, transparent 25%),
        /* Arcade screen glow effect */
        linear-gradient(45deg, 
            rgba(0, 255, 255, 0.05) 0%, 
            transparent 25%, 
            rgba(255, 215, 0, 0.03) 50%, 
            transparent 75%, 
            rgba(255, 20, 147, 0.04) 100%),
        /* Base background with Christmas colors */
        linear-gradient(135deg, 
            rgba(0, 100, 0, 0.3) 0%, 
            rgba(139, 0, 0, 0.2) 50%, 
            rgba(255, 215, 0, 0.1) 100%);
    backdrop-filter: blur(5px);
    border-radius: 25px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 0 60px rgba(255, 215, 0, 0.1);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    perspective: 1000px;
    max-width: 1000px; /* Limit width to ensure proper centering */
    margin: 0 auto; /* Center the grid */
    justify-items: center; /* Center individual grid items */
}

/* Individual Hatch Styles */
.calendar-hatch {
    aspect-ratio: 1;
    position: relative;
    border-radius: 15px;
    cursor: pointer;
    transform-style: preserve-3d;
    transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
    overflow: hidden;
    width: 100%;
    max-width: 180px; /* Maximum size for larger screens */
    min-width: 120px; /* Minimum size for smaller screens */
}

.calendar-hatch::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.1) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.calendar-hatch:hover::before {
    transform: translateX(100%);
}

.calendar-hatch.unlocked {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    animation: pulse-glow 2s infinite;
    cursor: pointer;
}

.calendar-hatch.unlocked:hover {
    transform: scale(1.05) rotateY(5deg) rotateX(5deg);
    box-shadow: 0 15px 40px rgba(0,0,0,0.4);
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 8px 25px rgba(0,0,0,0.3), 0 0 0 rgba(46, 204, 113, 0.4); }
    50% { box-shadow: 0 8px 25px rgba(0,0,0,0.3), 0 0 20px rgba(46, 204, 113, 0.6); }
}

.calendar-hatch.current-day {
    animation: current-day-pulse 1.5s infinite;
}

@keyframes current-day-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

.calendar-hatch.opening {
    animation: hatch-opening 1s ease-in-out;
}

@keyframes hatch-opening {
    0% { transform: rotateY(0deg); }
    50% { transform: rotateY(-90deg) scale(1.1); }
    100% { transform: rotateY(0deg); }
}

.calendar-hatch.opened {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    transform: scale(0.95);
}

/* Hatch Front */
.hatch-front {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    backface-visibility: hidden;
    border-radius: 15px;
    background: rgba(0, 0, 0, 0.3); /* Semi-transparent overlay to make text readable */
    z-index: 2;
}

.hatch-number {
    font-size: 3rem;
    font-weight: bold;
    color: #fff;
    text-shadow: 
        2px 2px 4px rgba(0,0,0,0.8),
        0 0 8px rgba(0,0,0,0.6),
        0 0 12px rgba(0,0,0,0.4);
    margin-bottom: 0;
    z-index: 3;
    position: relative;
}

.hatch-decoration {
    font-size: 1.5rem;
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    text-shadow: 
        1px 1px 2px rgba(0,0,0,0.8),
        0 0 4px rgba(0,0,0,0.6);
    animation: float 3s ease-in-out infinite;
    z-index: 1;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.unlock-indicator, .lock-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

.unlock-indicator {
    background: rgba(46, 204, 113, 0.95);
    color: white;
    animation: unlock-bounce 2s infinite;
    border: 2px solid rgba(255, 255, 255, 0.8);
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(46, 204, 113, 0.5);
}

@keyframes unlock-bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.lock-indicator {
    background: rgba(231, 76, 60, 0.95);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.8);
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(231, 76, 60, 0.5);
}

/* Lock icon styling */
.lock-icon {
    font-size: 1rem;
    line-height: 1;
    font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
    text-shadow: 
        1px 1px 2px rgba(0, 0, 0, 0.8),
        0 0 4px rgba(0, 0, 0, 0.5);
    filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.8));
}

/* Hover effects for better visibility */
.calendar-hatch:hover .unlock-indicator {
    transform: scale(1.1);
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.4),
        0 0 0 2px rgba(46, 204, 113, 0.8),
        0 0 20px rgba(46, 204, 113, 0.3);
}

.calendar-hatch:hover .lock-indicator {
    transform: scale(1.1);
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.4),
        0 0 0 2px rgba(231, 76, 60, 0.8),
        0 0 20px rgba(231, 76, 60, 0.3);
}

/* Pulse effect for locked indicators */
.lock-indicator {
    animation: lock-pulse 3s ease-in-out infinite;
}

@keyframes lock-pulse {
    0%, 100% { 
        box-shadow: 
            0 2px 8px rgba(0, 0, 0, 0.3),
            0 0 0 1px rgba(231, 76, 60, 0.5);
    }
    50% { 
        box-shadow: 
            0 2px 8px rgba(0, 0, 0, 0.3),
            0 0 0 1px rgba(231, 76, 60, 0.8),
            0 0 15px rgba(231, 76, 60, 0.4);
    }
}

/* Hatch Glow Effect */
.hatch-glow {
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    background: linear-gradient(45deg, #3498db, #e74c3c, #f39c12, #27ae60);
    border-radius: 20px;
    z-index: -1;
    animation: rainbow-glow 3s linear infinite;
    opacity: 0.7;
}

@keyframes rainbow-glow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Floating Ornaments */
.floating-ornaments {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.ornament {
    position: absolute;
    font-size: 2rem;
    animation: float-around 20s infinite linear;
    opacity: 0.7;
}

.ornament-1 { animation-delay: 0s; left: 10%; }
.ornament-2 { animation-delay: -4s; left: 30%; }
.ornament-3 { animation-delay: -8s; left: 50%; }
.ornament-4 { animation-delay: -12s; left: 70%; }
.ornament-5 { animation-delay: -16s; left: 90%; }

@keyframes float-around {
    0% { transform: translateY(100vh) rotate(0deg); }
    100% { transform: translateY(-10vh) rotate(360deg); }
}

/* Modal Styles */
.christmas-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
    animation: modal-appear 0.3s ease-out;
}

@keyframes modal-appear {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: #fff;
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    animation: modal-slide-up 0.4s ease-out;
    position: relative;
}

@keyframes modal-slide-up {
    from { transform: translateY(50px) scale(0.9); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

.modal-header {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    padding: 20px;
    border-radius: 20px 20px 0 0;
    position: relative;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    text-align: center;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2rem;
    cursor: pointer;
    color: white;
    opacity: 0.8;
    transition: opacity 0.3s;
}

.close-modal:hover {
    opacity: 1;
}

.modal-body {
    padding: 0;
}

/* Snowflakes */
#snowflakes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

.snowflake {
    position: absolute;
    color: white;
    font-size: 1rem;
    animation: snowfall linear infinite;
    opacity: 0.8;
}

@keyframes snowfall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

/* TeknoParrot Themed Floating Elements */
.christmas-calendar-container::before {
    content: '🕹️';
    position: absolute;
    top: 10%;
    left: 5%;
    font-size: 2rem;
    opacity: 0.3;
    animation: float-tekno 6s ease-in-out infinite;
    z-index: -1;
}

.christmas-calendar-container::after {
    content: '🎮';
    position: absolute;
    bottom: 10%;
    right: 5%;
    font-size: 2rem;
    opacity: 0.3;
    animation: float-tekno 6s ease-in-out infinite reverse;
    z-index: -1;
}

@keyframes float-tekno {
    0%, 100% { 
        transform: translateY(0px) rotate(0deg); 
        opacity: 0.3; 
    }
    50% { 
        transform: translateY(-20px) rotate(5deg); 
        opacity: 0.6; 
    }
}

/* Christmas Lights */
#christmas-lights {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 20px;
    z-index: 3;
    background: linear-gradient(90deg, 
        #e74c3c 0%, #f39c12 20%, #27ae60 40%, 
        #3498db 60%, #9b59b6 80%, #e74c3c 100%);
    animation: light-flow 3s linear infinite;
}

@keyframes light-flow {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

/* Music Toggle */
.christmas-music-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1001;
}

#musicToggle {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
}

#musicToggle:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(0,0,0,0.4);
}

/* Magic Effects */
.magic-sparkle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: radial-gradient(circle, #fff, transparent);
    border-radius: 50%;
    animation: sparkle-magic 2s ease-out forwards;
    pointer-events: none;
}

@keyframes sparkle-magic {
    0% {
        transform: scale(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: scale(3) rotate(360deg);
        opacity: 0;
    }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .calendar-grid {
        max-width: 900px;
        gap: 18px;
    }
}

@media (max-width: 992px) {
    .calendar-grid {
        max-width: 750px;
        gap: 15px;
    }
}

@media (max-width: 768px) {
    .christmas-title {
        font-size: 2rem;
    }
    
    .calendar-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 12px;
        max-width: 600px;
    }
    
    .calendar-hatch {
        min-width: 100px;
        max-width: 120px;
    }
    
    .hatch-number {
        font-size: 2rem;
    }
    
    .hatch-decoration {
        font-size: 1.5rem;
    }
    
    .unlock-indicator, .lock-indicator {
        width: 25px;
        height: 25px;
        font-size: 0.7rem;
        top: 8px;
        right: 8px;
    }
    
    .christmas-calendar-container {
        padding: 1rem;
        border-radius: 15px;
    }
    
    .christmas-calendar-container::before,
    .christmas-calendar-container::after {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .calendar-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
        max-width: 350px;
    }
    
    .calendar-hatch {
        min-width: 70px;
        max-width: 85px;
    }
    
    .hatch-number {
        font-size: 1.5rem;
    }
    
    .hatch-decoration {
        font-size: 1.2rem;
    }
    
    .unlock-indicator, .lock-indicator {
        width: 20px;
        height: 20px;
        font-size: 0.6rem;
        top: 5px;
        right: 5px;
    }
    
    .christmas-calendar-container {
        padding: 0.5rem;
    }
}

@media (max-width: 360px) {
    .calendar-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
        max-width: 280px;
    }
    
    .calendar-hatch {
        min-width: 80px;
        max-width: 90px;
    }
    
    .hatch-number {
        font-size: 1.3rem;
    }
    
    .hatch-decoration {
        font-size: 1rem;
    }
    
    .unlock-indicator, .lock-indicator {
        width: 18px;
        height: 18px;
        font-size: 0.5rem;
        top: 3px;
        right: 3px;
    }
    
    .christmas-title {
        font-size: 1.5rem;
    }
    
    .christmas-calendar-container {
        padding: 0.25rem;
    }
}

/* Print Styles */
@media print {
    .christmas-page {
        background: white !important;
    }
    
    #snowflakes, #christmas-lights, .christmas-music-toggle {
        display: none !important;
    }
}