/* ========================================
   НОВОГОДНЯЯ ТЕМА - ГИРЛЯНДА И СНЕЖИНКИ
   ======================================== */

/* Контейнер для гирлянды */
.christmas-lights {
    position: fixed;
    top: 70px; /* Высота верхней панели - поднято выше */
    left: 0;
    width: 100%;
    height: 60px;
    pointer-events: none;
    z-index: 9998;
    overflow: visible;
}

/* Canvas для провода гирлянды */
.lights-wire {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Лампочки гирлянды */
.light {
    position: absolute;
    width: 12px;
    height: 16px;
    border-radius: 50% 50% 40% 40%;
    transform-origin: top center;
    filter: drop-shadow(0 0 8px currentColor);
    animation: swing 3s ease-in-out infinite;
}

/* Цоколь лампочки */
.light::before {
    content: '';
    position: absolute;
    top: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 4px;
    background: linear-gradient(180deg, #4a4a4a 0%, #2a2a2a 100%);
    border-radius: 2px;
}

/* Блик на лампочке */
.light::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    filter: blur(1px);
}

/* Цвета лампочек */
.light:nth-child(6n+1) {
    color: #ff4444;
    background: linear-gradient(135deg, #ff6b6b 0%, #ff4444 100%);
}

.light:nth-child(6n+2) {
    color: #44ff44;
    background: linear-gradient(135deg, #6bff6b 0%, #44ff44 100%);
}

.light:nth-child(6n+3) {
    color: #4444ff;
    background: linear-gradient(135deg, #6b6bff 0%, #4444ff 100%);
}

.light:nth-child(6n+4) {
    color: #ffff44;
    background: linear-gradient(135deg, #ffff6b 0%, #ffff44 100%);
}

.light:nth-child(6n+5) {
    color: #ff44ff;
    background: linear-gradient(135deg, #ff6bff 0%, #ff44ff 100%);
}

.light:nth-child(6n+6) {
    color: #44ffff;
    background: linear-gradient(135deg, #6bffff 0%, #44ffff 100%);
}

/* Анимация качания */
@keyframes swing {
    0%, 100% { transform: rotate(-2deg); }
    50% { transform: rotate(2deg); }
}

/* Разные задержки для естественности */
.light:nth-child(odd) { animation-delay: -0.5s; }
.light:nth-child(3n) { animation-delay: -1s; }
.light:nth-child(5n) { animation-delay: -1.5s; }

/* Мигание лампочек */
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.light:nth-child(7n+1) { 
    animation: swing 3s ease-in-out infinite, blink 1.5s ease-in-out infinite;
}

.light:nth-child(7n+3) { 
    animation: swing 3s ease-in-out infinite, blink 2s ease-in-out infinite;
    animation-delay: -0.5s;
}

.light:nth-child(7n+5) { 
    animation: swing 3s ease-in-out infinite, blink 1.8s ease-in-out infinite;
    animation-delay: -1s;
}

/* ========================================
   СНЕЖИНКИ НА ФОНЕ
   ======================================== */

.snowflakes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9997;
    overflow: hidden;
}

.snowflake {
    position: absolute;
    top: -50px; /* Начинаем за пределами экрана */
    color: rgba(255, 255, 255, 0.8);
    font-size: 1em;
    font-family: Arial, sans-serif;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
    animation: fall linear infinite;
    user-select: none;
}

/* Для тёмной темы снежинки светлее */
body[data-theme="dark"] .snowflake {
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
}

/* Для светлой темы снежинки чуть темнее */
body[data-theme="light"] .snowflake {
    color: rgba(200, 220, 255, 0.85);
    text-shadow: 0 0 5px rgba(150, 180, 255, 0.5);
}

/* Анимация падения */
@keyframes fall {
    0% {
        transform: translateY(0) rotate(0deg);
    }
    100% {
        transform: translateY(calc(100vh + 100px)) rotate(360deg);
    }
}

/* Разные размеры и скорости снежинок */
.snowflake:nth-child(3n) {
    font-size: 0.8em;
    animation-duration: 12s;
}

.snowflake:nth-child(3n+1) {
    font-size: 1.2em;
    animation-duration: 15s;
}

.snowflake:nth-child(3n+2) {
    font-size: 1em;
    animation-duration: 18s;
}

.snowflake:nth-child(5n) {
    font-size: 0.6em;
    animation-duration: 10s;
}

.snowflake:nth-child(7n) {
    font-size: 1.4em;
    animation-duration: 20s;
}

/* Небольшое горизонтальное движение */
.snowflake:nth-child(2n) {
    animation-name: fall-left;
}

@keyframes fall-left {
    0% {
        transform: translateY(0) translateX(0) rotate(0deg);
    }
    100% {
        transform: translateY(calc(100vh + 100px)) translateX(-30px) rotate(360deg);
    }
}

.snowflake:nth-child(2n+1) {
    animation-name: fall-right;
}

@keyframes fall-right {
    0% {
        transform: translateY(0) translateX(0) rotate(0deg);
    }
    100% {
        transform: translateY(calc(100vh + 100px)) translateX(30px) rotate(360deg);
    }
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {
    .christmas-lights {
        top: 70px; /* Чуть ниже для мобильных */
        height: 50px;
    }
    
    .light {
        width: 10px;
        height: 14px;
    }
    
    .snowflake {
        font-size: 0.8em;
    }
}

/* Плавное появление при загрузке */
.christmas-lights,
.snowflakes {
    opacity: 0;
    animation: fadeIn 1s ease-in forwards;
}

@keyframes fadeIn {
    to { opacity: 1; }
}
