/* ================================================ */
/* 30/4 THEME - NGÀY GIẢI PHÓNG MIỀN NAM           */
/* HTX Mai Sao Lạng Sơn                             */
/* Trang trọng • Tự hào • Tích cực                  */
/* ================================================ */

:root {
  /* 30/4 Color System */
  --gp-red: #D32F2F;           /* Đỏ cờ - chủ đạo */
  --gp-red-dark: #B71C1C;      /* Đỏ đậm */
  --gp-yellow: #FFD600;        /* Vàng sao */
  --gp-yellow-dark: #C89B3C;   /* Brand gold */
  --gp-white: #FFFFFF;
  --gp-bg-warm: #FFFDF7;       /* Nền ấm */
  --gp-banner-height: 44px;
}

/* ================================================ */
/* THEME TOGGLE VISIBILITY                          */
/* ================================================ */

.gp-theme-only {
  display: none;
}

body.theme-304 .gp-theme-only {
  display: block;
}

.non-gp-only {
  display: block;
}

body.theme-304 .non-gp-only {
  display: none;
}

/* ================================================ */
/* TOP BANNER                                       */
/* ================================================ */

.gp-banner {
  background: linear-gradient(90deg, var(--gp-red) 0%, var(--gp-red-dark) 50%, var(--gp-red) 100%);
  color: var(--gp-white);
  text-align: center;
  padding: 10px var(--space-s);
  font-size: 14px;
  font-weight: 600;
  position: relative;
  overflow: hidden;
  z-index: 1001;
  letter-spacing: 1px;
}

.gp-banner__content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-s);
  position: relative;
  z-index: 2;
}

.gp-banner__star {
  color: var(--gp-yellow);
  font-size: 18px;
  animation: gp-star-pulse 2s ease-in-out infinite;
}

@keyframes gp-star-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.2); }
}

/* Dinh Độc Lập + Cổng sắt (cố định bên phải) */
.gp-banner__scene {
  position: absolute;
  right: 10px;
  bottom: 0;
  width: 160px;
  height: 44px;
  z-index: 1;
  opacity: 0.7;
}

/*
 * TIMING đồng bộ (tổng 20s):
 * 0-44%   : xe tăng chạy từ trái tới cổng, cổng đóng kín
 * 44%     : xe tăng CHẠM cổng → cổng bắt đầu đổ
 * 44-52%  : cổng đổ ngang sang 2 bên, xe húc qua
 * 52-85%  : xe tiến vào sân, dừng trước dinh
 * 85-100% : fade, reset
 */

/* Cánh cổng trái - bản lề ở đáy trụ trái, đổ ngang sang trái */
.gp-banner__gate-left {
  transform-origin: 54px 50px;
  animation: gp-gate-left-fall 20s ease-in-out infinite;
}

@keyframes gp-gate-left-fall {
  0%, 44%  { transform: rotate(0deg); }
  48%      { transform: rotate(-40deg); }
  52%      { transform: rotate(-80deg); }
  56%, 85% { transform: rotate(-85deg); }
  93%      { transform: rotate(-20deg); }
  100%     { transform: rotate(0deg); }
}

/* Cánh cổng phải - bản lề ở đáy trụ phải, đổ ngang sang phải */
.gp-banner__gate-right {
  transform-origin: 126px 50px;
  animation: gp-gate-right-fall 20s ease-in-out infinite;
}

@keyframes gp-gate-right-fall {
  0%, 44%  { transform: rotate(0deg); }
  48%      { transform: rotate(40deg); }
  52%      { transform: rotate(80deg); }
  56%, 85% { transform: rotate(85deg); }
  93%      { transform: rotate(20deg); }
  100%     { transform: rotate(0deg); }
}

/* Xe tăng 390 */
.gp-banner__tank {
  position: absolute;
  bottom: 0;
  left: -150px;
  width: 120px;
  height: 44px;
  z-index: 2;
  animation: gp-tank-move 20s ease-in-out infinite;
}

.gp-banner__tank-body {
  animation: gp-tank-rumble 0.2s linear infinite;
}

@keyframes gp-tank-rumble {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-0.3px); }
}

@keyframes gp-tank-move {
  0%   { left: -150px; }
  /* Chạy tới, chạm cổng đúng 44% */
  44%  { left: calc(100% - 280px); }
  /* Húc - dừng 1 nhịp */
  48%  { left: calc(100% - 270px); }
  /* Tiến qua cổng vào sân */
  60%  { left: calc(100% - 210px); }
  /* Dừng trước dinh */
  68%  { left: calc(100% - 190px); }
  85%  { left: calc(100% - 190px); opacity: 1; }
  /* Fade, reset */
  93%  { left: calc(100% - 190px); opacity: 0; }
  94%  { left: -150px; opacity: 0; }
  100% { left: -150px; opacity: 1; }
}

/* ================================================ */
/* BODY & HEADER OVERRIDES                          */
/* ================================================ */

body.theme-304 {
  background-color: var(--gp-bg-warm);
}

body.theme-304 .header {
  border-bottom: 2px solid var(--gp-red);
}

/* ================================================ */
/* LOGO DECORATION - Star accents                   */
/* ================================================ */

body.theme-304 .header__logo {
  position: relative;
  overflow: visible;
}

body.theme-304 .header__wrapper {
  overflow: visible;
}

body.theme-304 .header__logo::before {
  content: "";
  position: absolute;
  left: -30px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23FFD600"><path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"/></svg>');
  background-repeat: no-repeat;
  background-size: contain;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  animation: gp-star-in 0.4s ease-out 0.3s forwards;
}

body.theme-304 .header__logo::after {
  content: "";
  position: absolute;
  right: -30px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23D32F2F"><path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"/></svg>');
  background-repeat: no-repeat;
  background-size: contain;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  animation: gp-star-in 0.4s ease-out 0.5s forwards;
}

@keyframes gp-star-in {
  from { opacity: 0; transform: translateY(-50%) scale(0.5) rotate(-30deg); }
  to { opacity: 1; transform: translateY(-50%) scale(1) rotate(0deg); }
}

/* ================================================ */
/* HERO - Star motif (bottom-right)                 */
/* ================================================ */

body.theme-304 .hero-slider::after {
  content: "";
  position: absolute;
  bottom: 20px;
  right: 20px;
  width: 150px;
  height: 150px;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" fill="none" stroke="%23FFD600" stroke-width="1" opacity="0.25"><path d="M50 10l12.36 25.03L90 38.82l-20 19.47 4.72 27.53L50 73.54 25.28 85.82 30 58.29 10 38.82l27.64-3.79L50 10z"/></svg>');
  background-repeat: no-repeat;
  background-size: contain;
  pointer-events: none;
  z-index: 5;
}

/* ================================================ */
/* SECTION TITLE ACCENT - Ribbon divider            */
/* ================================================ */

body.theme-304 .section-title {
  position: relative;
  padding-top: 20px;
}

body.theme-304 .section-title::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--gp-yellow), var(--gp-red), var(--gp-yellow));
  border-radius: 2px;
}

body.theme-304 .section-title::after {
  content: "";
  position: absolute;
  top: -3px;
  left: 50%;
  transform: translateX(-50%);
  width: 8px;
  height: 8px;
  background: var(--gp-yellow);
  border-radius: 50%;
  border: 2px solid var(--gp-red);
  box-shadow: -18px 4px 0 -1px var(--gp-red), 18px 4px 0 -1px var(--gp-red);
}

/* ================================================ */
/* BUTTON ENHANCEMENTS                              */
/* ================================================ */

body.theme-304 .btn--primary {
  box-shadow: 0 4px 15px rgba(211, 47, 47, 0.2);
}

body.theme-304 .btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(211, 47, 47, 0.3);
}

/* CTA section enhancement */
body.theme-304 .cta-box {
  background: linear-gradient(135deg, var(--gp-red) 0%, var(--gp-red-dark) 100%);
  position: relative;
  overflow: hidden;
}

body.theme-304 .cta-box__title {
  color: var(--gp-white);
}

body.theme-304 .cta-box__subtitle {
  color: rgba(255, 255, 255, 0.85);
}

body.theme-304 .cta-box .btn--secondary {
  color: var(--gp-white);
  border-color: rgba(255, 255, 255, 0.5);
}

body.theme-304 .cta-box .btn--secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--gp-white);
}

body.theme-304 .cta-box::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -20%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(255, 214, 0, 0.1) 0%, transparent 70%);
  pointer-events: none;
}

/* ================================================ */
/* FOOTER ACCENT                                    */
/* ================================================ */

body.theme-304 .footer {
  position: relative;
  background: linear-gradient(180deg, #1A1A1A 0%, #0D0D0D 100%);
}

body.theme-304 .footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--gp-red), var(--gp-yellow), var(--gp-red));
}

/* ================================================ */
/* MOBILE MENU FIX                                  */
/* ================================================ */

body.theme-304 .header__nav.active {
  top: calc(var(--header-height, 64px) + var(--gp-banner-height));
}

/* ================================================ */
/* RESPONSIVE                                       */
/* ================================================ */

/* Tablet */
@media (max-width: 992px) {
  body.theme-304 .header__logo::before {
    left: -22px;
    width: 22px;
    height: 22px;
  }

  body.theme-304 .header__logo::after {
    right: -22px;
    width: 22px;
    height: 22px;
  }
}

/* Mobile */
@media (max-width: 768px) {
  .gp-banner {
    font-size: 12px;
    padding: 8px 12px;
  }

  .gp-banner__scene {
    width: 110px;
    height: 30px;
    right: 5px;
  }

  .gp-banner__tank {
    width: 85px;
    height: 30px;
  }

  body.theme-304 .header__logo::before {
    left: -18px;
    width: 18px;
    height: 18px;
  }

  body.theme-304 .header__logo::after {
    display: none;
  }

  body.theme-304 .hero-slider::after {
    width: 100px;
    height: 100px;
    bottom: 10px;
    right: 10px;
  }
}

/* Small Mobile */
@media (max-width: 480px) {
  .gp-banner__content {
    gap: 6px;
  }
}

/* ================================================ */
/* REDUCED MOTION                                   */
/* ================================================ */

@media (prefers-reduced-motion: reduce) {
  .gp-banner__star,
  .gp-banner__tank,
  .gp-banner__tank-body,
  .gp-banner__gate-left,
  .gp-banner__gate-right {
    animation: none;
  }

  .gp-banner__tank {
    display: none;
  }
}
