/* Новогоднее оформление (Utils/Helper/HolidayHelper.cs). Подключается только в праздничный период, класс body.hc-holiday.
   Цвета сайта (голубые) + праздничные акценты: золото, красный, хвойный зелёный. */
:root {
    --hc-xmas-gold: #f6c453;
    --hc-xmas-red: #e0393e;
    --hc-xmas-green: #1f8a5b;
    --hc-xmas-night: #0d3b7a;
}

/* ===== Снег (canvas рисует wwwroot/js/holiday.js) ===== */
#hc-snow {
    position: fixed;
    inset: 0;
    z-index: 1025;          /* под шапкой (1030), над содержимым */
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Кнопка «Выключить / включить снег» — слева внизу (справа чат) */
.hc-snow-toggle {
    position: fixed;
    left: 20px;
    bottom: 24px;
    z-index: 1070;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--hc-sky) 0%, var(--hc-primary) 100%);
    color: #fff;
    font-size: 1.35rem;
    box-shadow: 0 6px 18px rgba(27, 110, 194, 0.35);
    cursor: pointer;
    transition: transform .2s, opacity .2s;
}

    .hc-snow-toggle:hover {
        transform: rotate(30deg) scale(1.06);
    }

    .hc-snow-toggle.is-off {
        opacity: .55;
    }

        .hc-snow-toggle.is-off::after {
            content: "";
            position: absolute;
            width: 60%;
            height: 2px;
            border-radius: 2px;
            background: #fff;
            transform: rotate(-45deg);
        }

/* ===== Гирлянда под меню ===== */
.hc-header {
    overflow: visible;
}

.hc-garland {
    position: absolute;             /* висит под меню поверх страницы, не сдвигая её */
    top: 100%;
    left: 0;
    right: 0;
    height: 32px;
    overflow: hidden;
    pointer-events: none;
}

    /* провод: повторяющиеся «провисания» по 56px */
    .hc-garland::before {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 14px;
        background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='14'%3E%3Cpath d='M0 1 Q28 18 56 1' fill='none' stroke='%232f4a3a' stroke-width='2'/%3E%3C/svg%3E") repeat-x 0 0 / 56px 14px;
    }

.hc-garland-bulbs {
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    width: max-content;
    list-style: none;
    margin: 0;
    padding: 0 0 0 21px;            /* лампочка — в нижней точке каждого провисания */
}

    .hc-garland-bulbs li {
        position: relative;
        top: 5px;
        width: 14px;
        height: 22px;
        margin-right: 42px;
    }

        /* цоколь */
        .hc-garland-bulbs li::before {
            content: "";
            position: absolute;
            top: 2px;
            left: 3px;
            width: 8px;
            height: 6px;
            border-radius: 2px;
            background: #2f4a3a;
        }

        /* лампочка */
        .hc-garland-bulbs li::after {
            content: "";
            position: absolute;
            top: 7px;
            left: 1px;
            width: 12px;
            height: 15px;
            border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;
            background: var(--bulb);
            box-shadow: 0 0 10px 2px var(--bulb);
            animation: hc-bulb 1.6s ease-in-out infinite;
        }

        .hc-garland-bulbs li:nth-child(4n+1) { --bulb: var(--hc-xmas-red); }
        .hc-garland-bulbs li:nth-child(4n+2) { --bulb: var(--hc-xmas-gold); }
        .hc-garland-bulbs li:nth-child(4n+3) { --bulb: #38d39f; }
        .hc-garland-bulbs li:nth-child(4n+4) { --bulb: #4fb3ff; }

        .hc-garland-bulbs li:nth-child(2n)::after { animation-delay: .8s; }
        .hc-garland-bulbs li:nth-child(3n)::after { animation-delay: .4s; }

@keyframes hc-bulb {
    0%, 100% { opacity: 1; filter: brightness(1.15); }
    50% { opacity: .45; filter: brightness(.8); box-shadow: 0 0 2px 0 var(--bulb); }
}

/* ===== Шапка Деда Мороза на логотипе ===== */
.hc-logo {
    position: relative;
}

.hc-santa-hat {
    position: absolute;
    top: -10px;
    left: -12px;
    width: 46px;
    height: 40px;
    transform: rotate(-18deg);
    pointer-events: none;
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.18));
}

/* ===== Праздничное поздравление на главной ===== */
.hc-xmas-card {
    position: relative;
    overflow: hidden;
    margin-bottom: 1.75rem;
    padding: clamp(1.75rem, 1rem + 3vw, 3rem);
    padding-right: clamp(1.75rem, 1rem + 3vw, 3rem);
    border-radius: var(--hc-radius, 20px);
    color: #fff;
    background:
        radial-gradient(ellipse at 80% 120%, rgba(117, 175, 245, 0.55) 0%, transparent 55%),
        radial-gradient(ellipse at 10% -20%, rgba(25, 190, 255, 0.35) 0%, transparent 50%),
        linear-gradient(135deg, var(--hc-xmas-night) 0%, #144f9c 50%, var(--hc-primary) 100%);
    box-shadow: 0 16px 44px rgba(13, 59, 122, 0.35);
}

/* мерцающие звёзды */
.hc-xmas-stars {
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(1.5px 1.5px at 8% 20%, #fff 50%, transparent 51%),
        radial-gradient(1px 1px at 18% 70%, #fff 50%, transparent 51%),
        radial-gradient(2px 2px at 30% 35%, #fff 50%, transparent 51%),
        radial-gradient(1px 1px at 42% 15%, #fff 50%, transparent 51%),
        radial-gradient(1.5px 1.5px at 55% 60%, #fff 50%, transparent 51%),
        radial-gradient(1px 1px at 63% 25%, #fff 50%, transparent 51%),
        radial-gradient(2px 2px at 72% 12%, #fff 50%, transparent 51%),
        radial-gradient(1px 1px at 88% 40%, #fff 50%, transparent 51%),
        radial-gradient(1.5px 1.5px at 94% 78%, #fff 50%, transparent 51%);
    opacity: .8;
    animation: hc-stars 3.5s ease-in-out infinite alternate;
    pointer-events: none;
}

@keyframes hc-stars {
    from { opacity: .35; }
    to { opacity: .95; }
}

.hc-xmas-content {
    position: relative;
    z-index: 2;
    max-width: 640px;
}

.hc-xmas-badge {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    margin-bottom: .9rem;
    padding: .3rem .85rem;
    border: 1px solid rgba(246, 196, 83, 0.6);
    border-radius: 999px;
    background: rgba(246, 196, 83, 0.15);
    color: var(--hc-xmas-gold);
    font-size: .95rem;
    font-weight: 700;
    letter-spacing: .02em;
}

.hc-xmas-title {
    margin: 0 0 .75rem;
    font-size: clamp(1.7rem, 1.1rem + 2.4vw, 2.6rem);
    font-weight: 800;
    line-height: 1.15;
    text-shadow: 0 3px 14px rgba(0, 0, 0, 0.25);
}

    .hc-xmas-title span {
        color: var(--hc-xmas-gold);
    }

.hc-xmas-text {
    margin: 0 0 1.4rem;
    font-size: clamp(1.05rem, 1rem + .3vw, 1.2rem);
    line-height: 1.6;
    opacity: .95;
}

.hc-xmas-btn {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .75rem 1.6rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #ffd978 0%, var(--hc-xmas-gold) 100%);
    color: #5a3b00;
    font-size: 1.1rem;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 8px 22px rgba(246, 196, 83, 0.4);
    transition: transform .2s, box-shadow .2s;
}

    .hc-xmas-btn:hover {
        color: #5a3b00;
        transform: translateY(-2px);
        box-shadow: 0 12px 26px rgba(246, 196, 83, 0.5);
    }

/* ёлка справа */
.hc-xmas-tree {
    position: absolute;
    right: clamp(1rem, 4vw, 3.5rem);
    bottom: -6px;
    z-index: 1;
    width: clamp(150px, 18vw, 220px);
    height: auto;
}

    .hc-xmas-tree .hc-tree-light {
        animation: hc-tree-light 1.8s ease-in-out infinite;
    }

        .hc-xmas-tree .hc-tree-light:nth-of-type(2n) { animation-delay: .6s; }
        .hc-xmas-tree .hc-tree-light:nth-of-type(3n) { animation-delay: 1.2s; }

    .hc-xmas-tree .hc-tree-star {
        transform-origin: 100px 23px;
        animation: hc-tree-star 2.4s ease-in-out infinite;
    }

@keyframes hc-tree-light {
    0%, 100% { opacity: 1; }
    50% { opacity: .3; }
}

@keyframes hc-tree-star {
    0%, 100% { transform: scale(1) rotate(0deg); filter: drop-shadow(0 0 4px #ffd978); }
    50% { transform: scale(1.12) rotate(8deg); filter: drop-shadow(0 0 12px #ffd978); }
}

/* ёлочные шары на ниточках сверху */
.hc-xmas-baubles {
    position: absolute;
    top: 0;
    right: clamp(12rem, 24vw, 20rem);
    z-index: 1;
    display: flex;
    gap: 1.6rem;
    pointer-events: none;
}

.hc-bauble {
    position: relative;
    width: 2px;
    height: var(--len, 60px);
    background: rgba(255, 255, 255, 0.55);
    transform-origin: top center;
    animation: hc-swing 3.2s ease-in-out infinite alternate;
}

    .hc-bauble::before {
        content: "";
        position: absolute;
        bottom: -4px;
        left: -4px;
        width: 10px;
        height: 7px;
        border-radius: 2px;
        background: #d9c27a;
    }

    .hc-bauble::after {
        content: "";
        position: absolute;
        top: 100%;
        left: calc(var(--size, 30px) / -2 + 1px);
        width: var(--size, 30px);
        height: var(--size, 30px);
        margin-top: 2px;
        border-radius: 50%;
        background: radial-gradient(circle at 32% 30%, #fff 0 6%, var(--c1) 20%, var(--c2) 100%);
        box-shadow: 0 6px 14px rgba(0, 0, 0, 0.3);
    }

    .hc-bauble:nth-child(1) { --len: 46px; --size: 30px; --c1: #ff6b6b; --c2: #b3141b; animation-delay: 0s; }
    .hc-bauble:nth-child(2) { --len: 78px; --size: 36px; --c1: #ffe39a; --c2: #c98a00; animation-delay: .7s; }
    .hc-bauble:nth-child(3) { --len: 34px; --size: 26px; --c1: #c9e7ff; --c2: #3a7bd5; animation-delay: 1.4s; }

@keyframes hc-swing {
    from { transform: rotate(-6deg); }
    to { transform: rotate(6deg); }
}

/* сугроб внизу открытки */
.hc-xmas-card::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    z-index: 1;
    height: 34px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 40' preserveAspectRatio='none'%3E%3Cpath d='M0 26 C100 6 180 30 300 18 S520 4 640 20 S880 34 1000 16 S1150 10 1200 22 V40 H0 Z' fill='%23ffffff'/%3E%3C/svg%3E") no-repeat bottom / 100% 100%;
    opacity: .95;
}

/* ===== Сугроб над подвалом ===== */
.hc-holiday .hc-footer {
    position: relative;
}

    /* снежная «шапка» по верхнему краю подвала */
    .hc-holiday .hc-footer::before {
        content: "";
        position: absolute;
        left: 0;
        right: 0;
        top: -1px;
        height: 26px;
        background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 26' preserveAspectRatio='none'%3E%3Cpath d='M0 0 H1200 V10 C1140 22 1080 8 1000 16 S840 24 760 12 S600 4 520 16 S360 24 280 12 S120 6 60 18 S10 14 0 12 Z' fill='%23ffffff'/%3E%3C/svg%3E") no-repeat top / 100% 100%;
        pointer-events: none;
    }

/* ===== Шапка Деда Мороза на кнопке чата ===== */
.hc-holiday .hc-chat-toggle::after {
    content: "";
    position: absolute;
    top: -16px;
    left: -6px;
    width: 40px;
    height: 34px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 56'%3E%3Cpath d='M8 44 C10 24 24 6 44 8 C52 9 58 16 56 24 C50 18 44 18 40 22 C46 28 48 36 48 44 Z' fill='%23e0393e'/%3E%3Ccircle cx='56' cy='26' r='6' fill='%23fff'/%3E%3Crect x='4' y='40' width='48' height='12' rx='6' fill='%23fff'/%3E%3C/svg%3E") no-repeat center / contain;
    transform: rotate(-22deg);
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.2));
    pointer-events: none;
}

/* ===== Телефон ===== */
@media (max-width: 992px) {
    /* на телефоне шапка не «липкая» (site.css: static) — гирлянде нужна опора */
    .hc-holiday .hc-header {
        position: relative;
    }
}

@media (max-width: 991.98px) {
    .hc-xmas-tree {
        width: 120px;
        opacity: .35;       /* фоном, чтобы не мешать тексту */
    }

    .hc-xmas-baubles {
        right: 1rem;
        gap: 1rem;
    }
}

@media (max-width: 575.98px) {
    .hc-santa-hat {
        top: -8px;
        left: -8px;
        width: 34px;
        height: 30px;
    }

    .hc-xmas-baubles {
        display: none;
    }

    .hc-snow-toggle {
        left: 14px;
        bottom: 14px;
        width: 42px;
        height: 42px;
        font-size: 1.15rem;
    }
}

/* Без анимаций для тех, кто их отключил в системе */
@media (prefers-reduced-motion: reduce) {
    .hc-garland-bulbs li::after,
    .hc-xmas-stars,
    .hc-xmas-tree .hc-tree-light,
    .hc-xmas-tree .hc-tree-star,
    .hc-bauble {
        animation: none;
    }
}
