/* Новогодняя Гирлянда PRO - Основные стили */

#new-year-garland-pro {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100px;
    z-index: 9998;
    pointer-events: none;
    overflow: visible;
    transition: opacity 0.4s ease;
}

.nyg-garland-container {
    position: relative;
    width: 100%;
    height: 100%;
    transform: translateY(-10px);
}

/* Основной провод */
.nyg-main-wire {
    position: absolute;
    top: 20px;
    left: 0;
    width: 100%;
    z-index: 1;
}

.nyg-wire-path {
    stroke-linecap: round;
    fill: none;
}

/* Единица лампочки с верёвочкой */
.nyg-bulb-unit {
    position: absolute;
    top: 20px;
    transform-origin: top center;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: auto;
}

/* Верёвочка - нить */
.nyg-string {
    width: 1px;
    position: relative;
    z-index: 2;
}

.nyg-string-line {
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, 
        rgba(120, 120, 120, 0.8) 0%,
        rgba(160, 160, 160, 0.6) 50%,
        rgba(120, 120, 120, 0.8) 100%);
}

/* Контейнер лампочки */
.nyg-bulb-container {
    position: relative;
    z-index: 3;
    transform: translateY(1px);
}

/* Реалистичная лампочка */
.nyg-bulb {
    position: relative;
    border-radius: 50%;
    overflow: hidden;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        inset 0 0 20px rgba(255, 255, 255, 0.1),
        0 2px 8px rgba(0, 0, 0, 0.3);
    cursor: pointer;
}

/* Формы лампочек */
.nyg-bulb.shape-classic {
    border-radius: 40% 40% 45% 45%;
    clip-path: polygon(0% 0%, 100% 0%, 100% 90%, 50% 100%, 0% 90%);
}

.nyg-bulb.shape-round {
    border-radius: 50%;
}

.nyg-bulb.shape-oval {
    border-radius: 40% 60% 60% 40% / 60% 40% 60% 40%;
}

.nyg-bulb.shape-flame {
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 50% 85%, 0% 100%);
}

/* Внутреннее стекло лампочки */
.nyg-bulb-glass {
    position: absolute;
    top: 10%;
    left: 10%;
    width: 80%;
    height: 80%;
    border-radius: 50%;
    background: radial-gradient(
        ellipse at 30% 30%,
        rgba(255, 255, 255, 0.4) 0%,
        rgba(255, 255, 255, 0.2) 40%,
        rgba(255, 255, 255, 0.1) 70%,
        transparent 100%
    );
    filter: blur(1px);
    opacity: 0.3;
    transition: opacity 0.3s ease;
}

/* Цоколь лампочки */
.nyg-bulb-base {
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 4px;
    background: linear-gradient(90deg, 
        #888888 0%,
        #aaaaaa 30%,
        #cccccc 50%,
        #aaaaaa 70%,
        #888888 100%);
    border-radius: 2px;
    box-shadow: 
        0 1px 3px rgba(0, 0, 0, 0.5),
        inset 0 1px 1px rgba(255, 255, 255, 0.2);
    z-index: 2;
}

/* РЕАЛИСТИЧНОЕ СВЕЧЕНИЕ - ВОКРУГ ЛАМПОЧКИ */
.nyg-bulb-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    z-index: -1;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    filter: blur(8px);
    mix-blend-mode: screen;
}

/* Активное состояние - лампочка ВКЛЮЧЕНА */
.nyg-bulb.active {
    animation: bulb-ignite 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    box-shadow: 
        inset 0 0 30px rgba(255, 255, 255, 0.3),
        0 0 20px rgba(255, 255, 255, 0.2);
}

.nyg-bulb.active .nyg-bulb-glass {
    opacity: 0.8;
    animation: glass-shimmer 2s infinite alternate;
}

.nyg-bulb.active .nyg-bulb-glow {
    opacity: 0.9;
    animation: glow-pulse 1.5s infinite alternate ease-in-out;
}

/* Анимация зажигания лампочки */
@keyframes bulb-ignite {
    0% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.1);
        opacity: 1;
    }
    70% {
        transform: scale(0.95);
    }
    100% {
        transform: scale(1);
    }
}

/* Анимация мерцания стекла */
@keyframes glass-shimmer {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.7;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.05);
        opacity: 0.9;
    }
}

/* Анимация пульсации свечения ВОКРУГ лампочки */
@keyframes glow-pulse {
    0% {
        opacity: 0.7;
        transform: translate(-50%, -50%) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.05);
    }
}

/* Анимация качания всей связки */
@keyframes unit-swing {
    0% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(-4deg);
    }
    50% {
        transform: rotate(0deg);
    }
    75% {
        transform: rotate(4deg);
    }
    100% {
        transform: rotate(0deg);
    }
}

/* Уровни качания */
.nyg-bulb-unit.swing-1 {
    animation: unit-swing 6s infinite ease-in-out;
}

.nyg-bulb-unit.swing-2 {
    animation: unit-swing 5s infinite ease-in-out;
}

.nyg-bulb-unit.swing-3 {
    animation: unit-swing 4s infinite ease-in-out;
    animation-delay: 0.5s;
}

.nyg-bulb-unit.swing-4 {
    animation: unit-swing 3.5s infinite ease-in-out;
    animation-delay: 1s;
}

.nyg-bulb-unit.swing-5 {
    animation: unit-swing 3s infinite ease-in-out;
    animation-delay: 1.5s;
}

/* Эффект снежинок */
.nyg-snowflake {
    position: absolute;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    z-index: 0;
    animation: snow-drift 15s linear infinite;
    opacity: 0;
    pointer-events: none;
    filter: blur(0.5px);
}

@keyframes snow-drift {
    0% {
        transform: translateY(-20px) translateX(0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(120px) translateX(20px) rotate(360deg);
        opacity: 0;
    }
}

/* Адаптивность */
@media (max-width: 768px) {
    #new-year-garland-pro {
        height: 70px;
    }
    
    .nyg-garland-container {
        transform: translateY(-5px);
    }
    
    .nyg-main-wire {
        top: 15px;
    }
    
    .nyg-bulb-unit {
        top: 15px;
    }
}

@media (max-width: 480px) {
    #new-year-garland-pro {
        height: 60px;
    }
    
    .nyg-garland-container {
        transform: translateY(0);
    }
    
    .nyg-main-wire {
        top: 10px;
    }
    
    .nyg-bulb-unit {
        top: 10px;
    }
}

/* Для шорткодов */
.nyg-shortcode-garland {
    position: relative;
    width: 100%;
    height: 100px;
    margin: 20px 0;
    overflow: hidden;
}

.nyg-shortcode-garland[data-position="bottom"] #new-year-garland-pro {
    top: auto;
    bottom: 0;
}