@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Mountains+of+Christmas:wght@400;700&display=swap');

* {
    font-family: 'Poppins', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Light Mode - Christmas Theme */
body {
    background:
        linear-gradient(135deg, #0f2027 0%, #203a43 50%, #2c5364 100%),
        url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="%23ffffff" fill-opacity="0.05" d="M0,96L48,112C96,128,192,160,288,160C384,160,480,128,576,112C672,96,768,96,864,112C960,128,1056,160,1152,165.3C1248,171,1344,149,1392,138.7L1440,128L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>');
    background-size: cover;
    background-attachment: fixed;
    min-height: 100vh;
    transition: background 0.3s ease;
    position: relative;
    overflow-x: hidden;
}

/* Dark Mode - Christmas Night Theme */
.dark body {
    background:
        linear-gradient(135deg, #000000 0%, #0a1628 50%, #1a2332 100%),
        url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="%23ffffff" fill-opacity="0.02" d="M0,96L48,112C96,128,192,160,288,160C384,160,480,128,576,112C672,96,768,96,864,112C960,128,1056,160,1152,165.3C1248,171,1344,149,1392,138.7L1440,128L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>');
    background-size: cover;
    background-attachment: fixed;
}

/* Christmas decorative elements */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(circle at 20% 50%, rgba(255, 0, 0, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(0, 255, 0, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(255, 215, 0, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.glass-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    border-radius: inherit;
    pointer-events: none;
}

.dark .glass-card {
    background: rgba(10, 22, 40, 0.6);
    border: 2px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Text colors for dark mode */
.dark .text-gray-800 {
    color: #f3f4f6 !important;
}

.dark .text-gray-700 {
    color: #e5e7eb !important;
}

.dark .text-gray-600 {
    color: #d1d5db !important;
}

.dark .text-gray-500 {
    color: #9ca3af !important;
}

.dark .border-gray-200 {
    border-color: rgba(255, 255, 255, 0.1) !important;
}

.dark .border-gray-300 {
    border-color: rgba(255, 255, 255, 0.2) !important;
}

.dark .bg-gray-200 {
    background-color: rgba(75, 85, 99, 0.5) !important;
}

.dark .bg-green-50 {
    background-color: rgba(16, 185, 129, 0.1) !important;
}

/* Enhanced Snowflakes */
.snowflake {
    position: fixed;
    top: -10px;
    z-index: 9999;
    user-select: none;
    cursor: default;
    color: white;
    font-size: 1.2em;
    opacity: 0.9;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
    animation: snowfall 10s linear infinite;
    pointer-events: none;
}

@keyframes snowfall {
    0% {
        transform: translateY(0vh) rotate(0deg);
        opacity: 0;
    }

    10% {
        opacity: 0.9;
    }

    90% {
        opacity: 0.9;
    }

    100% {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

/* Christmas lights effect */
.christmas-lights {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 30px;
    z-index: 9998;
    display: flex;
    justify-content: space-around;
    align-items: center;
    pointer-events: none;
}

.light {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: blink 2s infinite;
}

.light:nth-child(odd) {
    background: #ff0000;
}

.light:nth-child(even) {
    background: #00ff00;
}

.light:nth-child(3n) {
    background: #ffff00;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
        box-shadow: 0 0 15px currentColor;
    }

    50% {
        opacity: 0.3;
        box-shadow: 0 0 5px currentColor;
    }
}

/* Theme Toggle */
.theme-toggle {
    position: fixed;
    top: 15px;
    right: 15px;
    z-index: 10000;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

.dark .theme-toggle {
    background: rgba(10, 22, 40, 0.8);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.theme-toggle:active {
    transform: scale(0.95);
}

/* Music Player */
.music-player {
    position: fixed;
    bottom: 15px;
    right: 15px;
    z-index: 10000;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50px;
    padding: 10px 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.dark .music-player {
    background: rgba(10, 22, 40, 0.8);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.music-player:active {
    transform: scale(0.98);
}

.music-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #c41e3a 0%, #165b33 100%);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(196, 30, 58, 0.4);
    -webkit-tap-highlight-color: transparent;
}

.music-btn:active {
    transform: scale(0.9);
}

.volume-slider {
    width: 70px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 5px;
    outline: none;
}

.dark .volume-slider {
    background: rgba(255, 255, 255, 0.2);
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: linear-gradient(135deg, #c41e3a 0%, #165b33 100%);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(196, 30, 58, 0.4);
}

.volume-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: linear-gradient(135deg, #c41e3a 0%, #165b33 100%);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(196, 30, 58, 0.4);
}

/* Back Button */
.back-button {
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 10000;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50px;
    padding: 10px 20px;
    color: white;
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

.dark .back-button {
    background: rgba(10, 22, 40, 0.8);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.back-button:active {
    transform: scale(0.95);
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    body {
        background-attachment: scroll;
    }

    .glass-card {
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
    }

    .music-player {
        bottom: 12px;
        right: 12px;
        padding: 8px 14px;
        gap: 8px;
    }

    .music-btn {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .volume-slider {
        width: 55px;
    }

    .theme-toggle {
        top: 12px;
        right: 12px;
        width: 45px;
        height: 45px;
    }

    .back-button {
        top: 12px;
        left: 12px;
        padding: 8px 16px;
        font-size: 14px;
        gap: 4px;
    }

    .christmas-lights {
        height: 25px;
    }

    .light {
        width: 6px;
        height: 6px;
    }

    .snowflake {
        font-size: 1em;
    }

    /* Reduce padding on mobile */
    body {
        padding: 0.75rem !important;
    }

    /* Better spacing for cards */
    .glass-card {
        margin-bottom: 1rem;
    }

    /* Improve text readability */
    h1 {
        font-size: 2rem !important;
        line-height: 1.2 !important;
    }

    h2 {
        font-size: 1.5rem !important;
    }

    h3 {
        font-size: 1.25rem !important;
    }

    /* Better button sizing */
    button,
    .button {
        min-height: 44px;
        font-size: 16px !important;
    }

    /* Improve form inputs */
    input,
    select,
    textarea {
        font-size: 16px !important;
        min-height: 44px;
    }

    /* Better table display */
    table {
        font-size: 14px;
    }

    /* Improve stats cards */
    .stat-card {
        padding: 1rem !important;
    }
}

/* iPhone specific optimizations */
@media (max-width: 430px) {
    .music-player {
        bottom: 10px;
        right: 10px;
        padding: 6px 12px;
    }

    .music-btn {
        width: 30px;
        height: 30px;
    }

    .volume-slider {
        width: 50px;
    }

    .theme-toggle {
        width: 42px;
        height: 42px;
        top: 10px;
        right: 10px;
    }

    .back-button {
        top: 10px;
        left: 10px;
        padding: 6px 14px;
        font-size: 13px;
    }

    h1 {
        font-size: 1.75rem !important;
    }
}

/* Landscape mode on mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .christmas-lights {
        display: none;
    }

    .snowflake {
        display: none;
    }

    body {
        padding: 0.5rem !important;
    }
}