/* =====================================================================
   avc/festive — CSS giao diện lễ hội (Noel & Tết). Không phụ thuộc framework CSS của dự án.
   Mọi lớp đều có tiền tố fx-, hd-, fs- để không đụng tên lớp của dự án.
   ===================================================================== */

.fx-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* không cản việc bấm vào trang */
    z-index: 1035;        /* trên nội dung, dưới menu trượt/hộp thoại của Bootstrap */
}

/* Ông già Noel cưỡi tuần lộc (ảnh noel/santaClaus.gif) — kích thước theo mẫu gốc */
.fx-santa {
    position: fixed;
    top: 0;
    left: 0;
    width: 150px;
    z-index: 1036;
    pointer-events: none;
    will-change: transform;
}

.fx-santa[hidden] { display: none; }

.fx-santa img {
    display: block;
    width: 100%;
    height: auto;
    transform: scaleX(-1); /* ảnh gốc quay sang trái → lật để bay sang phải */
}

@media (max-width: 768px) {
    .fx-santa { width: 100px; }
}

@media (max-width: 480px) {
    .fx-santa { width: 80px; }
}

/* =====================================================================
   FOOTER THEO MÙA (lớp fs-footer do JS gắn vào thẻ <footer> của dự án)
   Giữ nguyên kích thước footer thường. Hình trang trí là ảnh SVG vẽ sẵn
   (KHÔNG dùng filter trong SVG để trang không bị giật).
   ===================================================================== */
/* (vị trí footer do JS tự đặt khi cần — không ép position để khỏi phá footer sticky/fixed của dự án) */

/* Nền Noel: chỉ phủ chấm tuyết mờ lên nền của dự án (không đổi màu nền gốc) */
:where(.fs-noel) {
    background-image:
        radial-gradient(circle, rgba(255, 255, 255, .14) 0 1.5px, transparent 2.5px),
        radial-gradient(circle, rgba(255, 255, 255, .08) 0 1px, transparent 2px);
    background-size: 40px 40px, 40px 40px;
    background-position: 0 0, 20px 20px;
}

/* Nền Tết: chấm vàng mờ cho không khí Tết */
:where(.fs-tet) {
    background-image:
        radial-gradient(circle, rgba(246, 195, 67, .2) 0 1.5px, transparent 2.5px),
        radial-gradient(circle, rgba(246, 195, 67, .1) 0 1px, transparent 2px);
    background-size: 40px 40px, 40px 40px;
    background-position: 0 0, 20px 20px;
}

/* Dải viền treo vắt qua mép trên (nằm trong khoảng trống mt-5 phía trên, không làm footer cao thêm) */
.fs-trim {
    position: absolute;
    left: 0;
    right: 0;
    top: -28px;
    height: 48px;
    background-repeat: repeat-x;
    background-position: center top;
    background-size: auto 48px;
    pointer-events: none;
    z-index: 1;
}

.fs-noel .fs-trim { background-image: url("../img/noel/footer-trim.svg"); }
.fs-tet .fs-trim { background-image: url("../img/tet/footer-trim.svg"); height: 55px; background-size: auto 55px; }

/* Cụm sticker ở 2 góc dưới — chỉ hiện khi đủ chỗ trống, không che chữ */
.fs-deco {
    position: absolute;
    bottom: 4px;
    width: 150px;
    height: auto;
    pointer-events: none;
}

.fs-deco--left { left: 6px; }
.fs-deco--right { right: 6px; }

@media (max-width: 1199.98px) {
    .fs-deco { display: none; }
}

/* Ảnh GIF Noel nổi ở đáy footer (ball.gif, cane.gif) */
.fs-col-gif {
    position: absolute;
    bottom: 6px;
    height: var(--h, 64px);
    width: auto;
    pointer-events: none;
    display: none;
}

@media (min-width: 1200px) {
    .fs-col-gif { display: block; }
}

.fs-bell {
    position: absolute;
    top: -12px;
    height: 52px;
    width: auto;
    z-index: 2;
    pointer-events: none;
    display: none;
}

.fs-bell--left { left: 14px; }
.fs-bell--right { right: 14px; transform: scaleX(-1); }

@media (min-width: 1400px) {
    .fs-bell { display: block; }
}

/* Header: cây thông & người tuyết đứng 2 bên dải logo, trong khoảng trắng ngoài khung nội dung */
.hd-gif {
    position: absolute;
    bottom: 2px;
    height: 80px;
    width: auto;
    pointer-events: none;
    display: none;
}

.hd-gif--left { right: 100%; margin-right: 8px; }
.hd-gif--right { left: 100%; margin-left: 8px; }

@media (min-width: 1500px) {
    .hd-gif { display: block; }
}

/* =====================================================================
   ICON SVG CHUYỂN ĐỘNG NHẸ (header & footer)
   Chỉ dùng transform / opacity → trình duyệt tăng tốc bằng card đồ họa, rất nhẹ máy.
   Tự tắt khi máy bật "Giảm chuyển động". Tham số mỗi icon: --t (giây), --d (độ trễ), --h (cao)
   ===================================================================== */
.fx-anim {
    animation-duration: var(--t, 4s);
    animation-delay: var(--d, 0s);
    animation-iteration-count: infinite;
    animation-timing-function: ease-in-out;
}

.fx-anim-swing   { animation-name: fx-swing;   animation-direction: alternate; transform-origin: 50% 0; }   /* đung đưa như treo */
.fx-anim-sway    { animation-name: fx-sway;    animation-direction: alternate; transform-origin: 50% 100%; } /* đung đưa nhẹ, bám đáy */
.fx-anim-bob     { animation-name: fx-bob;     animation-direction: alternate; }                              /* nhún lên xuống */
.fx-anim-twinkle { animation-name: fx-twinkle; }                                                              /* nhấp nháy */
.fx-anim-spin    { animation-name: fx-spin;    animation-timing-function: linear; }                           /* xoay chậm */
.fx-anim-drift   { animation-name: fx-drift;   animation-direction: alternate; }                              /* bơi qua lại như cá */
.fx-anim-flip    { animation-name: fx-flip; }                                                                 /* lật như đồng xu */

@keyframes fx-swing   { from { transform: rotate(-7deg); } to { transform: rotate(7deg); } }
@keyframes fx-sway    { from { transform: rotate(-5deg); } to { transform: rotate(5deg); } }
@keyframes fx-bob     { from { transform: translateY(0); } to { transform: translateY(-8px); } }
@keyframes fx-twinkle { 0%, 100% { opacity: .3; transform: scale(.7) rotate(0deg); } 50% { opacity: 1; transform: scale(1.12) rotate(14deg); } }
@keyframes fx-spin    { to { transform: rotate(360deg); } }
@keyframes fx-drift  { from { transform: translateX(0) rotate(-2deg); } to { transform: translateX(22px) rotate(2deg); } }
@keyframes fx-flip    { 0%, 100% { transform: scaleX(1); } 50% { transform: scaleX(.18); } }

@media (prefers-reduced-motion: reduce) {
    .fx-anim { animation: none !important; }
}
.fx-still .fx-anim { animation: none !important; }

/* Header: icon treo dưới thanh menu — bám theo menu khi cuộn nên chỉ hiện ở màn hình rộng (≥ 1500px), nằm trong lề trống */
.hd-hang {
    position: absolute;
    top: 100%;
    margin-top: -1px;
    height: var(--h, 60px);
    width: auto;
    pointer-events: none;
    z-index: 3;
    display: none;
}

@media (min-width: 1500px) {
    .hd-hang { display: block; }
}

/* Header: icon nổi 2 bên dải logo (≥ 1500px) */
.hd-float {
    position: absolute;
    bottom: var(--y, 10px);
    height: var(--h, 40px);
    width: auto;
    pointer-events: none;
    display: none;
}

.hd-float--left { right: 100%; margin-right: 12px; }
.hd-float--right { left: 100%; margin-left: 12px; }

@media (min-width: 1500px) {
    .hd-float { display: block; }
}

/* Footer: icon trang trí đặt cạnh lề (≥ 1500px, nơi có khoảng trống 2 bên) */
.fs-item {
    position: absolute;
    height: var(--h, 40px);
    width: auto;
    pointer-events: none;
    z-index: 2;
    display: none;
}

@media (min-width: 1500px) {
    .fs-item { display: block; }
}


/* =====================================================================
   PHIÊN BẢN 2 — PHONG CẢNH · PHIÊN BẢN 3 — DÂY ĐÈN NHẤP NHÁY
   ===================================================================== */
/* Lớp bọc rộng bằng cả trang quanh dải logo (JS tạo ra) */
.fx-wrap { position: relative; }

/* Phong cảnh hiện rõ hai bên; phía sau dải logo phủ lớp trắng mờ để chữ logo luôn dễ đọc */
.fx-scene > .fx-box { background: rgba(255, 255, 255, .9); }

.fx-scene--noel {
    background:
        url("../img/noel/scene-header.svg") repeat-x center bottom / auto 100%,
        linear-gradient(180deg, #E3F1FE 0%, #FFFFFF 100%);
}

.fx-scene--tet {
    background:
        url("../img/tet/scene-header.svg") repeat-x center bottom / auto 100%,
        linear-gradient(180deg, #FFF3D6 0%, #FFFFFF 100%);
}

/* Đường chân trời nổi lên phía trên footer (nằm trong khoảng trống phía trên, không làm footer cao thêm) */
.fs-skyline {
    position: absolute;
    left: 0;
    right: 0;
    bottom: calc(100% - 1px);
    height: 64px;
    background-repeat: repeat-x;
    background-position: center bottom;
    background-size: auto 64px;
    pointer-events: none;
    z-index: 1;
}

.fs-noel .fs-skyline { background-image: url("../img/noel/footer-skyline.svg"); }
.fs-tet .fs-skyline { background-image: url("../img/tet/footer-skyline.svg"); }

/* Dây đèn: 2 lớp bóng (a, b) nhấp nháy luân phiên — chỉ đổi opacity nên rất nhẹ */
.fx-lights {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 44px;
    pointer-events: none;
    z-index: 2;
}

.fx-lights i {
    position: absolute;
    inset: 0;
    margin: 0;
    padding: 0;
    border: 0;
    width: auto;
    height: auto;
    font-style: normal;
    background-repeat: repeat-x;
    background-position: left top;
    background-size: auto 100%;
}

.fx-lights--noel .a { background-image: url("../img/noel/lights-a.svg"); }
.fx-lights--noel .b { background-image: url("../img/noel/lights-b.svg"); }
.fx-lights--tet .a { background-image: url("../img/tet/lights-a.svg"); }
.fx-lights--tet .b { background-image: url("../img/tet/lights-b.svg"); }

.fx-lights .a { animation: fx-blink-a 1.8s ease-in-out infinite alternate; }
.fx-lights .b { animation: fx-blink-b 1.8s ease-in-out infinite alternate; }

@keyframes fx-blink-a { from { opacity: 1; } to { opacity: .3; } }
@keyframes fx-blink-b { from { opacity: .3; } to { opacity: 1; } }

/* Dây đèn ở footer vắt ngang mép trên */
.fx-lights.fs-lights { top: -18px; height: 46px; z-index: 3; }

@media (prefers-reduced-motion: reduce) {
    .fx-lights .a, .fx-lights .b { animation: none; opacity: 1; }
}
.fx-still .fx-lights .a, .fx-still .fx-lights .b { animation: none; opacity: 1; }

/* Khi in giấy: bỏ hết trang trí */
@media print {
    .fx-canvas, .fx-santa, .fx-lights, .fs-trim, .fs-skyline, .fs-deco, .fs-col-gif, .fs-bell,
    .fs-item, .hd-gif, .hd-hang, .hd-float { display: none !important; }
}

/* Màn hình hẹp: bỏ bớt trang trí lớn cho gọn */
@media (max-width: 767.98px) {
    .fs-skyline { height: 44px; background-size: auto 44px; }
}
