/* =========================================================
   Infestation Việt Nam — giao diện Noel
   Chỉ nạp khi hx_web_sys.noel_enabled = 1 (ACP → Cấu hình → HX_WEB_SYS).
   Mọi quy tắc đều nằm dưới html.noel để tắt là trả lại giao diện thường.
   ========================================================= */

.noel {
  --noel-red: #d33a2c;
  --noel-red-soft: #ff6b4a;
  --noel-green: #3f9d52;
  --noel-green-soft: #6ee07a;
  --noel-gold: #ffd76a;
  --noel-ice: #cfe6ff;
}

/* ---------- Băng rôn chúc mừng ---------- */
.noel-ribbon {
  position: relative;
  overflow: hidden;
  background: linear-gradient(90deg, #571313 0%, #1b3720 50%, #571313 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .1),
    inset 0 -1px 0 rgba(0, 0, 0, .45),
    0 6px 18px rgba(0, 0, 0, .28);
}
.noel-ribbon::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(112deg, transparent 40%, rgba(255, 240, 214, .16) 50%, transparent 60%);
  transform: translateX(-120%);
  animation: noel-shine 5s ease-in-out infinite;
  pointer-events: none;
}
.noel-ribbon__inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 38px;
  padding-block: 6px;
  text-align: center;
}
.noel-ribbon p {
  font-family: var(--cond);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .1em;
  line-height: 1.2;
  color: #f7f0df;
  text-shadow: 0 1px 0 rgba(0, 0, 0, .45);
}
.noel-ribbon__flake {
  font-size: 15px;
  line-height: 1;
  color: var(--noel-ice);
  text-shadow: 0 0 10px rgba(207, 230, 255, .8);
  animation: noel-spin 7s linear infinite;
}
.noel-ribbon__flake--end { animation-direction: reverse; }
@keyframes noel-shine {
  0%, 58% { transform: translateX(-120%); }
  100% { transform: translateX(120%); }
}
@keyframes noel-spin {
  to { transform: rotate(360deg); }
}

/* ---------- Dây đèn trên header / footer / trang đăng nhập ---------- */
.noel .site-header,
.noel .site-footer,
.noel .auth-header {
  position: relative;
}
.noel .site-header::before,
.noel .site-footer::before,
.noel .auth-header::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 14px;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(circle at 8px 10px, var(--noel-red-soft) 0 3px, rgba(255, 107, 74, .3) 3.4px, transparent 4.8px) 0 0 / 48px 14px repeat-x,
    radial-gradient(circle at 32px 10px, var(--noel-gold) 0 3px, rgba(255, 215, 106, .28) 3.4px, transparent 4.8px) 0 0 / 48px 14px repeat-x,
    radial-gradient(circle at 20px 10px, var(--noel-green-soft) 0 2.6px, rgba(110, 224, 122, .26) 3px, transparent 4.2px) 0 0 / 96px 14px repeat-x,
    linear-gradient(rgba(255, 255, 255, .16), rgba(255, 255, 255, .16)) 0 1px / 100% 1px no-repeat;
  filter: drop-shadow(0 0 5px rgba(255, 180, 90, .45));
  animation: noel-twinkle 2.4s ease-in-out infinite alternate;
}
.noel .site-footer::before {
  height: 12px;
  background-size: 44px 12px, 44px 12px, 88px 12px, 100% 1px;
  animation-duration: 3.1s;
}
@keyframes noel-twinkle {
  from { opacity: .72; filter: drop-shadow(0 0 3px rgba(255, 180, 90, .35)); }
  to   { opacity: 1;   filter: drop-shadow(0 0 7px rgba(255, 205, 120, .6)); }
}

/* ---------- Sắc thái nhỏ: logo, statusbar ---------- */
.noel .logo__dash { background: var(--noel-red); }
.noel .logo__sub { color: var(--noel-gold); }
.noel .logo__name { text-shadow: 0 0 22px rgba(211, 58, 44, .28); }
.noel .statusbar {
  background: linear-gradient(90deg, #0f1811 0%, #17271a 50%, #0f1811 100%);
}
.noel .statusbar__meta { color: #b9c9a8; }
.noel .btn--primary {
  box-shadow: inset 0 0 0 1px rgba(255, 215, 106, .45), 0 0 18px rgba(211, 58, 44, .16);
}

/* ---------- Lớp băng giá trên thẻ nội dung ---------- */
.noel .deal-card,
.noel .panel,
.noel .item-card,
.noel .event-card,
.noel .detail,
.noel .auth-card {
  background-image: linear-gradient(180deg, rgba(198, 228, 255, .11), rgba(198, 228, 255, 0) 56px);
}

/* ---------- Ánh đỏ/xanh ở đầu trang ---------- */
.noel .page-hero {
  box-shadow:
    inset 320px 0 240px -220px rgba(211, 58, 44, .4),
    inset -320px 0 240px -220px rgba(63, 157, 82, .36);
}

/* ---------- Tuyết rơi (canvas do noel.js vẽ) ---------- */
.noel-snow {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 85;
  pointer-events: none;
}

/* ---------- Điện thoại ---------- */
@media (max-width: 768px) {
  .noel-ribbon__inner { gap: 9px; }
  .noel-ribbon p { font-size: 14px; letter-spacing: .06em; }
  .noel-ribbon__flake { font-size: 13px; }
  .noel .site-header::before,
  .noel .auth-header::before { background-size: 40px 12px, 40px 12px, 80px 12px, 100% 1px; }
}

/* ---------- Giảm chuyển động ---------- */
@media (prefers-reduced-motion: reduce) {
  .noel-ribbon::after,
  .noel-ribbon__flake,
  .noel .site-header::before,
  .noel .site-footer::before,
  .noel .auth-header::before {
    animation: none;
  }
  .noel .site-header::before,
  .noel .site-footer::before,
  .noel .auth-header::before { opacity: .85; }
}
