/**
 * Новогодняя тема для LVart
 * Включает: гирлянду с лампочками и стили для снежинок
 */

/* ============================================
   ГИРЛЯНДА (Christmas Lights)
   ============================================ */

.christmas-lights {
    position: fixed;
    top: 56px; /* Высота navbar в Bootstrap */
    left: 0;
    right: 0;
    margin: 0;
    padding: 0;
    pointer-events: none;
    white-space: nowrap;
    overflow: hidden;
    z-index: 1030; /* Чуть ниже navbar */
    text-align: center;
}

/* Для страницы авторизации - гирлянда сверху */
.christmas-lights--top {
    top: 0;
}

/* Провод гирлянды */
.christmas-lights::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg,
    transparent 0%,
    #2a5a2a 5%,
    #2a5a2a 95%,
    transparent 100%
    );
}

.christmas-lights li {
    position: relative;
    list-style: none;
    display: inline-block;
    width: 12px;
    height: 20px;
    border-radius: 50%;
    margin: 15px 18px 0;
    animation-fill-mode: both;
    animation-iteration-count: infinite;
}

/* Крепление лампочки */
.christmas-lights li::before {
    content: "";
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 10px;
    background: linear-gradient(to bottom, #3a3a3a 0%, #1a1a1a 100%);
    border-radius: 3px 3px 0 0;
}

/* Провод между лампочками */
.christmas-lights li::after {
    content: "";
    position: absolute;
    top: -2px;
    left: -22px;
    width: 42px;
    height: 20px;
    border-bottom: 2px solid #2a5a2a;
    border-radius: 50%;
}

.christmas-lights li:first-child::after {
    display: none;
}

/* Цвета лампочек */
.christmas-lights li:nth-child(4n+1) {
    background: rgba(247, 0, 148, 1);
    box-shadow: 0px 5px 20px 3px rgba(247, 0, 148, 0.8);
    animation: flash-pink 2s ease-in-out infinite;
}

.christmas-lights li:nth-child(4n+2) {
    background: rgba(0, 255, 255, 1);
    box-shadow: 0px 5px 20px 3px rgba(0, 255, 255, 0.8);
    animation: flash-cyan 1.4s ease-in-out infinite;
}

.christmas-lights li:nth-child(4n+3) {
    background: rgba(0, 247, 165, 1);
    box-shadow: 0px 5px 20px 3px rgba(0, 247, 165, 0.8);
    animation: flash-green 2.2s ease-in-out infinite;
}

.christmas-lights li:nth-child(4n) {
    background: rgba(255, 215, 0, 1);
    box-shadow: 0px 5px 20px 3px rgba(255, 215, 0, 0.8);
    animation: flash-gold 1.8s ease-in-out infinite;
}

/* Добавляем фиолетовый цвет (фирменный LVart) */
.christmas-lights li:nth-child(5n) {
    background: rgba(102, 51, 153, 1);
    box-shadow: 0px 5px 20px 3px rgba(102, 51, 153, 0.8);
    animation: flash-purple 2s ease-in-out infinite;
}

/* Анимации мигания */
@keyframes flash-pink {
    0%, 100% {
        background: rgba(247, 0, 148, 1);
        box-shadow: 0px 5px 20px 3px rgba(247, 0, 148, 0.8);
    }
    50% {
        background: rgba(247, 0, 148, 0.4);
        box-shadow: 0px 5px 20px 3px rgba(247, 0, 148, 0.2);
    }
}

@keyframes flash-cyan {
    0%, 100% {
        background: rgba(0, 255, 255, 1);
        box-shadow: 0px 5px 20px 3px rgba(0, 255, 255, 0.8);
    }
    50% {
        background: rgba(0, 255, 255, 0.4);
        box-shadow: 0px 5px 20px 3px rgba(0, 255, 255, 0.2);
    }
}

@keyframes flash-green {
    0%, 100% {
        background: rgba(0, 247, 165, 1);
        box-shadow: 0px 5px 20px 3px rgba(0, 247, 165, 0.8);
    }
    50% {
        background: rgba(0, 247, 165, 0.4);
        box-shadow: 0px 5px 20px 3px rgba(0, 247, 165, 0.2);
    }
}

@keyframes flash-gold {
    0%, 100% {
        background: rgba(255, 215, 0, 1);
        box-shadow: 0px 5px 20px 3px rgba(255, 215, 0, 0.8);
    }
    50% {
        background: rgba(255, 215, 0, 0.4);
        box-shadow: 0px 5px 20px 3px rgba(255, 215, 0, 0.2);
    }
}

@keyframes flash-purple {
    0%, 100% {
        background: rgba(102, 51, 153, 1);
        box-shadow: 0px 5px 20px 3px rgba(102, 51, 153, 0.8);
    }
    50% {
        background: rgba(102, 51, 153, 0.4);
        box-shadow: 0px 5px 20px 3px rgba(102, 51, 153, 0.2);
    }
}

/* ============================================
   СНЕЖИНКИ (Snowfall)
   ============================================ */

#snow-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

.snowflake {
    position: absolute;
    width: 10px;
    height: 10px;
    background: white;
    border-radius: 50%;
    filter: drop-shadow(0 0 10px white);
    pointer-events: none;
}

/* Для страницы авторизации - более насыщенный снег */
.snow-heavy .snowflake {
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.9));
}

/* Для основного layout - легкий снег */
.snow-light .snowflake {
    opacity: 0.7;
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.5));
}

/* Анимация падения снежинок */
@keyframes snowfall {
    0% {
        transform: translateY(-10vh) translateX(0);
    }
    100% {
        transform: translateY(100vh) translateX(var(--drift, 20px));
    }
}

/* ============================================
   НОВОГОДНЕЕ ПОЗДРАВЛЕНИЕ
   ============================================ */

.new-year-greeting {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 14px;
    z-index: 10000;
    animation: greeting-pulse 3s ease-in-out infinite;
    pointer-events: auto;
    cursor: pointer;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.new-year-greeting:hover {
    transform: scale(1.05);
}

.new-year-greeting .emoji {
    font-size: 18px;
    margin-right: 5px;
}

.new-year-greeting.hidden {
    opacity: 0;
    pointer-events: none;
}

@keyframes greeting-pulse {
    0%, 100% { box-shadow: 0 0 10px rgba(255, 215, 0, 0.5); }
    50% { box-shadow: 0 0 20px rgba(255, 215, 0, 0.8); }
}

/* ============================================
   АДАПТИВНОСТЬ
   ============================================ */

/* Планшеты */
@media (max-width: 992px) {
    .christmas-lights li {
        width: 10px;
        height: 16px;
        margin: 12px 14px 0;
    }

    .christmas-lights li::after {
        left: -18px;
        width: 34px;
    }
}

/* Мобильные */
@media (max-width: 768px) {
    .christmas-lights {
        top: 56px;
    }

    .christmas-lights li {
        width: 8px;
        height: 14px;
        margin: 10px 10px 0;
    }

    .christmas-lights li::before {
        width: 6px;
        height: 8px;
        top: -6px;
    }

    .christmas-lights li::after {
        left: -13px;
        width: 26px;
        height: 15px;
    }

    .new-year-greeting {
        bottom: 10px;
        right: 10px;
        padding: 8px 15px;
        font-size: 12px;
    }
}

/* Очень маленькие экраны */
@media (max-width: 480px) {
    .christmas-lights li {
        width: 6px;
        height: 10px;
        margin: 8px 6px 0;
    }

    .christmas-lights li::before {
        width: 4px;
        height: 6px;
        top: -5px;
    }

    .christmas-lights li::after {
        left: -8px;
        width: 18px;
        height: 12px;
        border-bottom-width: 1px;
    }
}

/* ============================================
   ПОДСТРОЙКА ПОД КОНКРЕТНЫЕ СТРАНИЦЫ
   ============================================ */

/* Форма отправки отчета - отключаем снег, оставляем только гирлянду */
.page-send-report #snow-container {
    display: none;
}

/* Страница авторизации - снег поверх всего */
.page-login #snow-container {
    z-index: 5; /* Ниже формы, но выше фона */
}

/* Footer с новогодним оформлением */
#footer.new-year-footer,
footer.new-year-footer,
.footer.new-year-footer {
    background: linear-gradient(to right, #1a472a, #2d5a3d, #1a472a) !important;
    border-top: 3px solid #c41e3a;
    box-shadow: 0 -2px 10px rgba(0, 100, 0, 0.3);
}

#footer.new-year-footer .text-muted,
footer.new-year-footer .text-muted,
.footer.new-year-footer .text-muted,
.new-year-footer .text-muted {
    color: #90EE90 !important;
}

.new-year-footer .col-md-6,
.new-year-footer div {
    color: #90EE90;
}

/* Navbar с новогодним оформлением */
.navbar .navbar-brand {
    transition: all 0.3s ease;
}

/* Анимация ёлочки в логотипе */
@keyframes tree-sway {
    0%, 100% { transform: rotate(-2deg); }
    50% { transform: rotate(2deg); }
}

.navbar-brand {
    animation: none; /* Отключаем по умолчанию, чтобы не раздражало */
}

/* Праздничное свечение для navbar на тёмном фоне */
.navbar-dark.bg-dark {
    box-shadow: 0 2px 10px rgba(196, 30, 58, 0.3);
}