/* Global Styles */
:root {
    --christmas-red: #c41e3a;
    --christmas-green: #0f7d3e;
    --christmas-gold: #ffd700;
    --christmas-white: #ffffff;
    --christmas-dark: #1a1a1a;
    --snow-white: #f0f8ff;
    --holly-green: #165b33;
    --candy-cane: #ff4757;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    background: linear-gradient(135deg, #0f7d3e 0%, #165b33 50%, #1a472a 100%);
    color: var(--christmas-white);
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
}

/* Snow Canvas */
#snowCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 2;
}

/* Header */
.header {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, var(--christmas-red), var(--candy-cane));
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    margin-bottom: 40px;
    animation: pulse 2s infinite;
    border: 5px solid var(--christmas-gold);
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.main-title {
    font-family: 'Mountains of Christmas', cursive;
    font-size: 3.5rem;
    font-weight: 700;
    text-shadow: 4px 4px 8px rgba(0, 0, 0, 0.8);
    margin-bottom: 10px;
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from { text-shadow: 0 0 10px #fff, 0 0 20px #fff, 0 0 30px var(--christmas-gold), 0 0 40px var(--christmas-gold); }
    to { text-shadow: 0 0 20px #fff, 0 0 30px var(--christmas-gold), 0 0 40px var(--christmas-gold), 0 0 50px var(--christmas-gold); }
}

.emoji-bounce {
    display: inline-block;
    animation: bounce 1s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.95;
    font-weight: 300;
}

/* Countdown Section */
.countdown-section {
    margin-bottom: 50px;
}

/* Mode Selector */
.mode-selector {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    backdrop-filter: blur(10px);
    border-radius: 15px;
    border: 2px solid var(--christmas-gold);
}

.mode-selector label {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--christmas-gold);
    margin-right: 10px;
}

.mode-dropdown {
    padding: 10px 20px;
    font-size: 1rem;
    border: 2px solid var(--christmas-gold);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.3);
    color: var(--christmas-white);
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.mode-dropdown:hover {
    background: rgba(255, 215, 0, 0.2);
    transform: scale(1.05);
}

.mode-dropdown option {
    background: var(--christmas-dark);
    color: var(--christmas-white);
}

.countdown-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

.countdown-box {
    background: linear-gradient(135deg, var(--christmas-red), #a01729);
    border-radius: 20px;
    padding: 40px 50px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 3px solid var(--christmas-gold);
    transition: transform 0.3s ease;
    animation: float 3s ease-in-out infinite;
}

.countdown-box:hover {
    transform: scale(1.1) rotate(2deg);
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.countdown-number {
    font-family: 'Mountains of Christmas', cursive;
    font-size: 6rem;
    font-weight: 700;
    text-align: center;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.8);
}

.countdown-label {
    font-size: 1.5rem;
    text-align: center;
    margin-top: 10px;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.countdown-separator {
    font-size: 6rem;
    font-weight: 700;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

/* Progress Bar */
.progress-bar-container {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 50px;
    padding: 10px;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
}

.progress-bar {
    height: 40px;
    background: linear-gradient(90deg, var(--christmas-green), var(--christmas-gold), var(--christmas-red));
    border-radius: 40px;
    transition: width 1s ease;
    box-shadow: 0 0 20px var(--christmas-gold);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { filter: brightness(1); }
    50% { filter: brightness(1.3); }
    100% { filter: brightness(1); }
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: 700;
    font-size: 1.2rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    z-index: 1;
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

.feature-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 215, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-10px) rotate(1deg);
    box-shadow: 0 15px 50px rgba(255, 215, 0, 0.4);
}

.feature-card h2 {
    font-family: 'Mountains of Christmas', cursive;
    font-size: 2rem;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    border-bottom: 3px solid var(--christmas-gold);
    padding-bottom: 10px;
}

/* Santa Tracker */
.santa-location {
    text-align: center;
}

.location-text {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 10px;
    animation: colorChange 3s infinite;
}

@keyframes colorChange {
    0%, 100% { color: var(--christmas-white); }
    50% { color: var(--christmas-gold); }
}

.preparation-status {
    font-size: 1rem;
    opacity: 0.8;
    margin-bottom: 15px;
}

.santa-progress {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    height: 30px;
    overflow: hidden;
    margin-bottom: 15px;
}

.santa-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--christmas-red), var(--christmas-gold));
    transition: width 0.5s ease;
    animation: pulse 1s infinite;
}

.gifts-prepared {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--christmas-gold);
}

/* Facts Card */
.fact-content {
    background: rgba(0, 0, 0, 0.2);
    padding: 20px;
    border-radius: 10px;
    min-height: 100px;
    margin-bottom: 20px;
    font-size: 1.1rem;
    line-height: 1.6;
}

/* Wishlist */
.wishlist-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.wish-input {
    padding: 15px;
    border: 2px solid var(--christmas-gold);
    border-radius: 10px;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.1);
    color: var(--christmas-white);
    outline: none;
}

.wish-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.wish-list {
    list-style: none;
    max-height: 200px;
    overflow-y: auto;
}

.wish-list li {
    background: rgba(0, 0, 0, 0.2);
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

.wish-list li:hover {
    background: rgba(255, 215, 0, 0.2);
}

.delete-wish {
    background: var(--christmas-red);
    border: none;
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.delete-wish:hover {
    background: #a01729;
}

/* Naughty or Nice Meter */
.meter-container {
    text-align: center;
}

.meter {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 50px;
    height: 40px;
    overflow: hidden;
    margin-bottom: 15px;
    position: relative;
}

.meter-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--christmas-red), var(--christmas-gold), var(--christmas-green));
    transition: width 0.5s ease;
    box-shadow: 0 0 15px var(--christmas-gold);
}

.meter-labels {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-weight: 600;
}

#scoreValue {
    color: var(--christmas-gold);
    font-size: 1.3rem;
    font-weight: 700;
}

/* Music Card */
.music-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.volume-control {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.volume-control input[type="range"] {
    width: 100%;
    cursor: pointer;
}

.sound-effects {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Messages Card */
.message-display {
    background: rgba(0, 0, 0, 0.2);
    padding: 30px;
    border-radius: 10px;
    min-height: 100px;
    margin-bottom: 20px;
    font-size: 1.3rem;
    font-weight: 600;
    text-align: center;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Buttons */
.btn-primary, .btn-music, .btn-effect, .btn-effect-large {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.btn-primary {
    background: linear-gradient(135deg, var(--christmas-red), var(--candy-cane));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(196, 30, 58, 0.5);
}

.btn-music {
    background: linear-gradient(135deg, var(--christmas-green), var(--holly-green));
    color: white;
}

.btn-music:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(15, 125, 62, 0.5);
}

.btn-effect {
    background: linear-gradient(135deg, var(--christmas-gold), #ffed4e);
    color: var(--christmas-dark);
    padding: 10px 15px;
    font-size: 0.9rem;
}

.btn-effect:hover {
    transform: scale(1.05);
}

/* Effect Buttons */
.effect-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 50px;
    flex-wrap: wrap;
}

.btn-effect-large {
    background: linear-gradient(135deg, #ff6b6b, #ee5a6f);
    color: white;
    padding: 20px 40px;
    font-size: 1.3rem;
    animation: wiggle 2s infinite;
}

@keyframes wiggle {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-3deg); }
    75% { transform: rotate(3deg); }
}

.btn-effect-large:hover {
    transform: scale(1.1);
    animation: none;
}

/* Statistics */
.stats-section {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 50px;
    border: 2px solid rgba(255, 215, 0, 0.3);
}

.stats-section h2 {
    font-family: 'Mountains of Christmas', cursive;
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 30px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.stat-card {
    background: rgba(0, 0, 0, 0.2);
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    border: 2px solid var(--christmas-gold);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: scale(1.05) rotate(2deg);
}

.stat-number {
    font-size: 3rem;
    font-weight: 700;
    color: var(--christmas-gold);
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.stat-label {
    font-size: 1rem;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Ornaments */
#ornaments-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.ornament {
    position: absolute;
    font-size: 3rem;
    animation: swing 3s ease-in-out infinite;
}

@keyframes swing {
    0%, 100% { transform: rotate(-10deg); }
    50% { transform: rotate(10deg); }
}

/* Twinkling Lights */
#lights-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100px;
    pointer-events: none;
    z-index: 3;
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.light {
    width: 20px;
    height: 30px;
    border-radius: 50% 50% 45% 45%;
    animation: twinkle 1s infinite;
}

@keyframes twinkle {
    0%, 100% { opacity: 1; filter: brightness(1); }
    50% { opacity: 0.3; filter: brightness(0.5); }
}

/* Popup Notifications */
#popup-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.popup {
    background: linear-gradient(135deg, var(--christmas-red), var(--candy-cane));
    color: white;
    padding: 20px 30px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
    border: 3px solid var(--christmas-gold);
    animation: slideInRight 0.5s ease, shake 0.5s ease 0.5s;
    font-weight: 600;
    font-size: 1.1rem;
    max-width: 300px;
}

@keyframes slideInRight {
    from { transform: translateX(400px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* Particles */
#particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999;
}

.particle {
    position: absolute;
    pointer-events: none;
}

.confetti {
    width: 10px;
    height: 10px;
    animation: fall 3s linear;
}

@keyframes fall {
    to { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

.firework {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    animation: explode 1s ease-out;
}

@keyframes explode {
    0% { transform: translate(0, 0); opacity: 1; }
    100% { transform: translate(var(--x), var(--y)); opacity: 0; }
}

/* Settings Panel */
.settings-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--christmas-red), var(--candy-cane));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
    z-index: 100;
    transition: transform 0.3s ease;
}

.settings-toggle:hover {
    transform: rotate(90deg) scale(1.1);
}

.settings-panel {
    position: fixed;
    bottom: 90px;
    right: 20px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.9), rgba(26, 26, 26, 0.95));
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7);
    border: 3px solid var(--christmas-gold);
    z-index: 100;
    display: none;
    min-width: 250px;
}

.settings-panel.active {
    display: block;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.settings-panel h3 {
    font-family: 'Mountains of Christmas', cursive;
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: var(--christmas-gold);
    text-align: center;
}

.settings-panel label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    font-size: 1rem;
    cursor: pointer;
}

.settings-panel input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

/* Footer */
.footer {
    text-align: center;
    padding: 30px;
    margin-top: 50px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    border-top: 3px solid var(--christmas-gold);
}

.footer p {
    margin: 10px 0;
    font-size: 1.1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-title {
        font-size: 2rem;
    }
    
    .countdown-number {
        font-size: 3.5rem;
    }
    
    .countdown-separator {
        font-size: 3.5rem;
    }
    
    .countdown-box {
        padding: 25px 30px;
    }
    
    .countdown-label {
        font-size: 1rem;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .effect-buttons {
        flex-direction: column;
    }
    
    .btn-effect-large {
        width: 100%;
    }
    
    .mode-selector label {
        font-size: 1rem;
        display: block;
        margin-bottom: 10px;
    }
    
    .mode-dropdown {
        width: 100%;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: var(--christmas-dark);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--christmas-red), var(--christmas-gold));
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--christmas-gold);
}

/* Shake animation for intrusive feature */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    50% { transform: translateX(5px); }
    75% { transform: translateX(-5px); }
}

/* Fullscreen Mode Styles */
.fullscreen-btn {
    position: fixed;
    bottom: 90px;
    left: 20px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--christmas-gold), #ffed4e);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
    z-index: 100;
    transition: transform 0.3s ease;
    border: 3px solid var(--christmas-red);
}

.fullscreen-btn:hover {
    transform: scale(1.1);
}

/* Fullscreen mode active state */
body.fullscreen-mode .container > *:not(.countdown-section) {
    display: none !important;
}

body.fullscreen-mode .countdown-section .mode-selector {
    display: none !important;
}

body.fullscreen-mode .countdown-section .progress-bar-container {
    display: none !important;
}

body.fullscreen-mode .header {
    display: none !important;
}

body.fullscreen-mode #ornaments-container,
body.fullscreen-mode #lights-container,
body.fullscreen-mode #popup-container,
body.fullscreen-mode #particles-container,
body.fullscreen-mode .settings-toggle,
body.fullscreen-mode .settings-panel,
body.fullscreen-mode .footer,
body.fullscreen-mode .fullscreen-btn {
    display: none !important;
}

body.fullscreen-mode {
    overflow: hidden;
}

body.fullscreen-mode .container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

body.fullscreen-mode .countdown-section {
    width: 100%;
    max-width: none;
    margin: 0;
}

body.fullscreen-mode .countdown-container {
    gap: 30px;
    transform: scale(1.2);
}

body.fullscreen-mode .countdown-number {
    font-size: 8rem;
}

body.fullscreen-mode .countdown-separator {
    font-size: 8rem;
}

body.fullscreen-mode .countdown-label {
    font-size: 2rem;
}

body.fullscreen-mode .countdown-box {
    padding: 50px 60px;
}

/* Exit fullscreen button */
.exit-fullscreen-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 30px;
    background: linear-gradient(135deg, var(--christmas-red), var(--candy-cane));
    color: white;
    border: 3px solid var(--christmas-gold);
    border-radius: 15px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
    z-index: 1001;
    display: none;
    transition: transform 0.3s ease;
}

.exit-fullscreen-btn:hover {
    transform: scale(1.05);
}

body.fullscreen-mode .exit-fullscreen-btn {
    display: block;
}

/* Mobile fullscreen adjustments */
@media (max-width: 768px) {
    body.fullscreen-mode .countdown-container {
        transform: scale(1);
        gap: 15px;
    }
    
    body.fullscreen-mode .countdown-number {
        font-size: 4.5rem;
    }
    
    body.fullscreen-mode .countdown-separator {
        font-size: 4.5rem;
    }
    
    body.fullscreen-mode .countdown-label {
        font-size: 1.2rem;
    }
    
    body.fullscreen-mode .countdown-box {
        padding: 30px 35px;
    }
    
    .exit-fullscreen-btn {
        padding: 10px 20px;
        font-size: 1rem;
        top: 10px;
        right: 10px;
    }
    
    .fullscreen-btn {
        bottom: 20px;
        left: 20px;
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    body.fullscreen-mode .countdown-container {
        flex-direction: column;
        gap: 20px;
    }
    
    body.fullscreen-mode .countdown-separator {
        display: none;
    }
    
    body.fullscreen-mode .countdown-number {
        font-size: 3.5rem;
    }
    
    body.fullscreen-mode .countdown-label {
        font-size: 1rem;
    }
    
    body.fullscreen-mode .countdown-box {
        padding: 25px 30px;
    }
}
