/* ═══════════════════════════════════════════════════════════════════
   SECTIONS — section nav cards, news ticker, footer, page transition,
   page-back button, laser divider, coming-soon block
   ═══════════════════════════════════════════════════════════════════ */

/* ── Section nav cards (homepage grid of category icons) ───────── */
.sections-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 20px;
  max-width: 1100px; margin: 0 auto; width: 100%;
}
.section-nav-card {
  position: relative; overflow: hidden;
  border-radius: 12px; padding: 35px 20px; text-align: center;
  text-decoration: none; color: white;
  border: 1px solid rgba(204,0,0,0.2);
  background: linear-gradient(135deg, rgba(204,0,0,0.1), rgba(5,5,16,0.85));
  transition: transform 0.3s, opacity 0.3s, border-color 0.3s, box-shadow 0.3s;
  cursor: pointer;
  opacity: 0; transform: scale(0.9);
}
.section-nav-card.visible { opacity: 1; transform: scale(1); }
@media (hover: hover) {
  .section-nav-card:hover {
    border-color: rgba(204,0,0,0.7);
    background: linear-gradient(135deg, rgba(204,0,0,0.2), rgba(0,85,204,0.1));
    transform: translateY(-8px);
    box-shadow: var(--glow-red);
  }
}
.section-nav-card.tapped,
.section-nav-card:active {
  border-color: rgba(204,0,0,0.9) !important;
  background: linear-gradient(135deg, rgba(204,0,0,0.3), rgba(0,85,204,0.15)) !important;
  transform: scale(1.05) !important;
  box-shadow: var(--glow-red) !important;
}
.section-nav-card::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(255,45,85,0.25), transparent 50%);
  opacity: 0; transition: opacity 0.3s;
  pointer-events: none;
}
@media (hover: hover) {
  .section-nav-card:hover::before { opacity: 1; }
}

.section-nav-icon {
  font-size: 3.5rem;
  display: inline-block;
  margin-bottom: 12px;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
img.section-nav-icon {
  width: 90px; height: 90px;
  object-fit: cover;
  border-radius: 12px;
  margin: 0 auto 12px;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 4px 18px rgba(0,0,0,0.4);
}
@media (hover: hover) {
  .section-nav-card:hover .section-nav-icon {
    transform: scale(1.2) rotate(-8deg) translateY(-4px);
  }
}
.section-nav-name {
  font-family: 'Orbitron', monospace;
  font-size: 1rem; font-weight: 700;
  margin-bottom: 5px;
}

/* ── Coming-soon placeholder (empty categories) ────────────────── */
.coming-soon-block {
  max-width: 700px; margin: 0 auto; text-align: center;
  padding: 60px 30px; border-radius: 16px;
  background: linear-gradient(135deg, rgba(204,0,0,0.08), rgba(5,5,16,0.85));
  border: 1px dashed rgba(204,0,0,0.3);
}
.coming-soon-block .big-icon { font-size: 5rem; display: block; margin-bottom: 20px; filter: drop-shadow(0 0 25px var(--red)); }
.coming-soon-block h3 { font-family: 'Orbitron', monospace; font-size: 1.5rem; color: white; margin-bottom: 12px; }
.coming-soon-block p { color: rgba(255,255,255,0.6); line-height: 1.7; margin-bottom: 20px; }
.coming-soon-block .countdown { font-family: 'Orbitron', monospace; color: var(--red-bright); letter-spacing: 4px; font-size: 0.75rem; }

/* ── Laser divider (decorative line) ───────────────────────────── */
.laser-divider {
  height: 2px; margin: 40px 0;
  background: linear-gradient(90deg, transparent, var(--red), var(--blue-bright), var(--red), transparent);
  animation: laserPulse 2s ease-in-out infinite;
}
@keyframes laserPulse { 0%,100% { opacity: 0.5; } 50% { opacity: 1; box-shadow: 0 0 15px var(--red); } }

/* ── Featured news ticker (just below hero) ───────────────────── */
.ticker-heading {
  text-align: right; color: #ff2d55;
  font-size: 1rem; font-weight: 800; letter-spacing: 2px;
  padding: 6px 16px 4px;
  font-family: 'Cairo', sans-serif;
  text-shadow: 0 0 10px rgba(255,45,85,0.9), 0 0 25px rgba(255,45,85,0.6);
}
.news-ticker-wrap {
  /* Hidden by default \u2014 firestore.js adds .is-populated once items render. */
  display: none;
  align-items: center;
  direction: ltr;
  background: rgba(0,0,0,0.45);
  border-top: 1px solid rgba(255,45,85,0.35);
  border-bottom: 1px solid rgba(255,45,85,0.35);
  overflow: hidden;
  height: 110px;
  position: relative;
  z-index: 10;
}
.news-ticker-track-wrap { flex: 1; overflow: hidden; position: relative; height: 100%; direction: ltr; }
.news-ticker-track {
  display: flex; align-items: center; gap: 0;
  height: 100%; width: max-content;
  animation: tickerScroll 30s linear infinite;
  direction: ltr; will-change: transform;
}
@keyframes tickerScroll { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

.ticker-item {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 6px;
  padding: 0 18px;
  cursor: pointer;
  border-right: 1px solid rgba(255,255,255,0.08);
  transition: background 0.2s;
  height: 100%; position: relative;
}
.ticker-item:hover { background: rgba(255,255,255,0.06); }
.ticker-item img {
  width: 68px; height: 68px;
  border-radius: 8px; object-fit: cover;
  border: 2px solid rgba(255,255,255,0.2);
  flex-shrink: 0;
}
.ticker-item-name {
  font-size: 0.8rem; font-weight: 700; color: #fff;
  max-width: 220px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ticker-item-price { display: none; }
.ticker-item-badge { display: none; }

/* ── FOOTER ────────────────────────────────────────────────────── */
footer {
  background: #000;
  border-top: 1px solid rgba(204,0,0,0.2);
  padding: 40px; text-align: center;
  position: relative; z-index: 2;
}
.footer-logo {
  display: flex; align-items: center; justify-content: center;
  gap: 15px; margin-bottom: 15px;
}
.footer-logo img {
  width: 64px; height: 64px;
  object-fit: cover; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.12);
  box-shadow: 0 0 22px rgba(214,0,42,0.5), 0 0 34px rgba(30,111,230,0.35);
}
.footer-logo-text { font-family: 'Orbitron', monospace; font-size: 1.3rem; font-weight: 900; color: var(--white); }
.footer-logo-text span:nth-of-type(1) { color: #D6002A; text-shadow: 0 0 12px rgba(214,0,42,0.7); }
.footer-logo-text span:nth-of-type(2) { color: #00B83A; text-shadow: 0 0 12px rgba(0,184,58,0.7); }
.footer-logo-text span:nth-of-type(3) { color: #1E6FE6; text-shadow: 0 0 12px rgba(30,111,230,0.7); }
.footer-sub {
  font-family: 'Orbitron', monospace; font-size: 0.6rem;
  letter-spacing: 3px; color: rgba(204,0,0,0.5);
  margin-bottom: 15px;
}

.footer-social-icons { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin: 15px 0; }
.footer-social-icons .social-icon {
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: white;
  background: linear-gradient(135deg, rgba(255,255,255,0.12), rgba(255,255,255,0.05));
  border: 1px solid rgba(255,255,255,0.18);
  transition: transform 0.3s, box-shadow 0.3s;
  text-decoration: none;
}
.footer-social-icons .social-icon svg { display: block; flex-shrink: 0; }
.footer-social-icons .social-icon:hover { transform: translateY(-4px) scale(1.08); box-shadow: 0 12px 30px rgba(0,0,0,0.3); }
.footer-social-icons .social-icon.fb  { background: linear-gradient(135deg, #1877f2, #0d5cb6); border-color: rgba(24,119,242,0.5); }
.footer-social-icons .social-icon.ig  { background: linear-gradient(135deg, #e4405f, #833ab4, #f09433); border-color: rgba(228,64,95,0.4); }
.footer-social-icons .social-icon.wa  { background: linear-gradient(135deg, #25d366, #128c7e); border-color: rgba(37,211,102,0.5); }
.footer-social-icons .social-icon.map { background: linear-gradient(135deg, #ea4335, #c5221f); border-color: rgba(234,67,53,0.5); }
.footer-copy { font-size: 0.78rem; color: rgba(255,255,255,0.25); }

/* ── PAGE-AS-PAGE MODE ─────────────────────────────────────────── */
body:not(.in-page-mode) section:not(#home):not(#sections) { display: none; }
/* Ticker shows on the home page only. Inner-page mode hides both the
   heading and the strip. Higher specificity than .is-populated so CSS wins. */
.news-ticker-wrap.is-populated { display: flex; }

body.in-page-mode #home,
body.in-page-mode .stats-section,
body.in-page-mode #sections,
body.in-page-mode #ticker-heading,
body.in-page-mode #news-ticker-wrap,
body.in-page-mode #news-ticker-wrap.is-populated { display: none; }
body.in-page-mode section:not(.page-active) {
  visibility: hidden;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  pointer-events: none;
  opacity: 0;
}
body.in-page-mode section.page-active {
  visibility: visible;
  position: static;
  display: block;
  min-height: calc(100vh - 70px);
  padding-top: 110px;
  padding-bottom: 100px;
  animation: pageEnter 0.28s ease-out both;
}
/* Single-property animation \u2014 cheap to composite (opacity only, no transform) */
@keyframes pageEnter {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── Page back button ──────────────────────────────────────────── */
.page-back-btn {
  position: fixed; top: 84px; left: 24px;
  z-index: 9990;
  display: none;
  align-items: center; gap: 8px;
  padding: 11px 22px; border-radius: 50px;
  background: rgba(15,15,30,0.7);
  border: 1px solid rgba(255,45,85,0.6);
  color: white; font-family: 'Cairo', sans-serif;
  font-weight: 700; font-size: 0.9rem;
  cursor: pointer;
  box-shadow: var(--glow-red);
  transition: background 0.25s, transform 0.25s, box-shadow 0.25s;
}
body.in-page-mode .page-back-btn {
  display: inline-flex;
  animation: backBtnSlide 0.5s 0.3s both;
}
@keyframes backBtnSlide { from { opacity: 0; transform: translateX(-30px); } to { opacity: 1; transform: none; } }
.page-back-btn:hover {
  background: linear-gradient(135deg, var(--red), var(--red-bright));
  transform: translateX(-4px) scale(1.05);
  box-shadow: 0 0 35px rgba(255,45,85,0.8);
}
.page-back-btn.bottom {
  position: fixed; bottom: 20px; left: 20px;
  right: auto; top: auto;
  display: none; z-index: 9990;
}
body.in-page-mode .page-back-btn.bottom { display: inline-flex; }

/* ── PAGE TRANSITION OVERLAY (3 vertical color bars) ─────────────
   Heavily simplified for snappy perf:
   • single-color flat backgrounds (was 3-stop gradients)
   • no inset box-shadow (was 90px blurred shadow per bar)
   • no ::before gradient overlay (was extra layer per bar)
   • no mix-blend-mode on logos (compositor-expensive)
   • no drop-shadow filter on logos (paint-expensive)
   • transition shortened 0.6s → 0.32s + tighter stagger
   These match the JS timings in router.js. */
#page-transition {
  position: fixed; inset: 0; z-index: 99997;
  pointer-events: none;
  display: flex; flex-direction: row;
  direction: ltr;
}
#page-transition .trans-bar {
  flex: 1;
  transform: translateY(-105%);
  transition: transform 0.8s cubic-bezier(0.85, 0, 0.15, 1);
  position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
#page-transition .trans-bar:nth-child(1),
#page-transition .trans-bar-red   { background: #D6002A; transition-delay: 0s; }
#page-transition .trans-bar:nth-child(2),
#page-transition .trans-bar-green { background: #00B83A; transition-delay: 0.15s; }
#page-transition .trans-bar:nth-child(3),
#page-transition .trans-bar-blue  { background: #1E6FE6; transition-delay: 0.3s; }
#page-transition.show .trans-bar { transform: translateY(0); }
#page-transition.exit .trans-bar { transform: translateY(105%); }

#page-transition .trans-bar-logo {
  position: relative;
  width: clamp(180px, 28vw, 340px);
  height: auto; max-height: 55vh;
  object-fit: contain;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.7);
  transition: opacity 0.5s ease, transform 0.7s ease;
}
#page-transition.show .trans-bar-logo { opacity: 1; transform: scale(1); }
#page-transition.show .trans-bar:nth-child(1) .trans-bar-logo { transition-delay: 0.25s; }
#page-transition.show .trans-bar:nth-child(2) .trans-bar-logo { transition-delay: 0.45s; }
#page-transition.show .trans-bar:nth-child(3) .trans-bar-logo { transition-delay: 0.65s; }
#page-transition.exit .trans-bar-logo {
  opacity: 0; transform: scale(1.1);
  transition-delay: 0s;
}

#page-transition .trans-content {
  position: absolute;
  left: 0; right: 0; bottom: 6vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 14px;
  opacity: 0; transform: translateY(20px);
  transition: opacity 0.2s 0.18s ease, transform 0.22s 0.18s ease;
}
#page-transition.show .trans-content { opacity: 1; transform: translateY(0); }
#page-transition.exit .trans-content { opacity: 0; transform: translateY(12px); transition-delay: 0s; }

.trans-logo-orbits { display: none; }
#page-transition .trans-logo {
  position: relative; display: inline-block;
  padding: 10px 26px;
  background: rgba(0,0,0,0.45);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 999px;
  font-family: 'Orbitron', monospace;
  font-size: clamp(1.05rem, 2.6vw, 1.6rem);
  font-weight: 900;
  color: var(--trans-title-color, #D6002A);
  letter-spacing: 5px;
  text-align: center;
  /* single text-shadow instead of triple-layer glow — same legibility, much cheaper to paint */
  text-shadow: 0 0 12px var(--trans-title-color, #D6002A);
  transition: color 0.2s;
}
