/* ============================================================
   Trang chủ: News Ticker + Cyber Portal
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700;900&display=swap');

/* --- Ticker trong hero (dưới hero-overlay) --- */
.hero-ticker-bar {
  position: relative;
  z-index: 2;
  padding: 14px 5%;
  pointer-events: auto;
  margin-top: 0.5rem;
}

.page-home .hero-slider {
  margin-top: var(--navbar-height);
}

.navbar-cyber-slot {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

/* ========== NEWS TICKER ========== */
.kg-ticker-isolation {
  all: initial;
  display: block;
  filter: none !important;
  -webkit-filter: none !important;
  color-scheme: light !important;
  margin: 0 !important;
  font-family: "Roboto", sans-serif;
}

.kg-ticker-premium {
  display: flex !important;
  align-items: center !important;
  width: 100% !important;
  height: 40px !important;
  background: #ffffff !important;
  border: 2px solid rgba(213, 7, 2, 0.12) !important;
  border-radius: 20px !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
  box-shadow: 0 10px 30px -12px rgba(213, 7, 2, 0.1) !important;
  position: relative;
}

.kg-ticker-label {
  width: 54px;
  min-width: 54px;
  height: 100%;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: #ffffff !important;
  border-right: 1px solid #f2f2f2 !important;
  z-index: 2;
  flex-shrink: 0 !important;
  overflow: visible !important;
  color: #d50702;
}

.kg-ticker-label svg {
  width: 40px !important;
  height: 40px !important;
  fill: #d50702 !important;
  filter: drop-shadow(0 4px 6px rgba(213, 7, 2, 0.3)) !important;
  overflow: visible !important;
}

#speaker-body {
  animation: kg-speaker-3d-shake 1.5s ease-in-out infinite;
  transform-origin: center;
  will-change: transform;
}

@keyframes kg-speaker-3d-shake {
  0%, 100% { transform: rotate(0deg) scale(1); }
  20% { transform: rotate(-12deg) scale(1.1) skewX(2deg); }
  80% { transform: rotate(12deg) scale(1.1) skewX(-2deg); }
}

.particle {
  fill: #d50702;
  animation: floatUp 1.5s linear infinite;
  opacity: 0;
}

@keyframes floatUp {
  0% { transform: translateY(0) scale(1); opacity: 0; }
  10% { opacity: 1; }
  100% { transform: translateY(-35px) translateX(15px) scale(5); opacity: 0; }
}

.p1 { animation-delay: 0s; }
.p2 { animation-delay: 0.5s; }
.p3 { animation-delay: 1s; }

.kg-ticker-viewport {
  flex: 1 !important;
  overflow: hidden !important;
  display: flex !important;
  align-items: center !important;
  position: relative;
}

.kg-ticker-track {
  display: flex !important;
  align-items: center !important;
  white-space: nowrap !important;
  width: max-content !important;
  will-change: transform;
  animation: kg-scroll-ltr 50s linear infinite !important;
}

.kg-ticker-track:hover {
  animation-play-state: paused !important;
}

.kg-ticker-item {
  display: flex !important;
  align-items: center !important;
  padding: 0 35px !important;
  color: #222 !important;
  text-decoration: none !important;
  font-size: 14px !important;
  font-weight: 900 !important;
  height: 40px !important;
}

.kg-ticker-item:hover {
  color: #d50702 !important;
}

.kg-ticker-dot {
  width: 8px;
  height: 8px;
  background: #d50702 !important;
  border-radius: 50%;
  margin-right: 10px;
  flex-shrink: 0;
  box-shadow: 0 0 5px rgba(213, 7, 2, 0.4);
  animation: kg-dot-pulse 0.8s infinite;
}

.kg-ticker-cat {
  font-size: 11px !important;
  color: #d50702 !important;
  background: rgba(213, 7, 2, 0.08) !important;
  font-weight: 900 !important;
  margin-right: 10px !important;
  padding: 3px 10px !important;
  border-radius: 8px !important;
  text-transform: uppercase !important;
  flex-shrink: 0;
  border: 0.8px solid rgba(213, 7, 2, 0.1) !important;
}

@keyframes kg-scroll-ltr {
  0% { transform: translate3d(-50%, 0, 0); }
  100% { transform: translate3d(0, 0, 0); }
}

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

/* ========== CYBER PORTAL (theme đỏ phim) ========== */
:root {
  --cy-c1: #2fc28c; /* soft green */
  --cy-c2: #6fead1; /* cyan-green */
  --cy-c3: #1aa36a; /* deep green */
  --cy-c4: #9feed6; /* pale green */
  --cy-dark: #071216;
}

.cyber-portal-container {
  position: relative !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin: 0 6px;
  vertical-align: middle;
  z-index: 9999 !important;
  isolation: isolate;
}

.cyber-portal-btn {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: transform 0.45s cubic-bezier(0.215, 0.61, 0.355, 1);
  will-change: transform;
}

.cyber-portal-btn:hover { transform: scale(1.06) rotate(6deg); }

.cy-ring {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.cy-plasma-glow {
  inset: -6px;
  background: conic-gradient(from 0deg, var(--cy-c1), var(--cy-c2), var(--cy-c3), var(--cy-c4), var(--cy-c1));
  animation: cy-spin 6s linear infinite;
  opacity: 0.28;
  filter: blur(6px);
  z-index: 0;
  transition: opacity 0.45s ease, filter 0.45s ease, transform 0.45s ease;
}

.cyber-portal-btn:hover .cy-plasma-glow {
  opacity: 0.7;
  filter: blur(12px);
  animation-duration: 1.2s;
  transform: scale(1.08);
}

.cy-plasma {
  inset: -3px;
  background: conic-gradient(from 0deg, var(--cy-c1), var(--cy-c2), var(--cy-c3), var(--cy-c4), var(--cy-c1));
  animation: cy-spin 8s linear infinite;
  z-index: 1;
  transition: transform 0.5s ease;
}

.cy-shield {
  inset: 3px;
  background: radial-gradient(circle at 35% 35%, #0e1626, var(--cy-dark));
  z-index: 2;
}

.cy-dash1 {
  inset: 6px;
  border: 1px dashed rgba(47, 194, 140, 0.32);
  animation: cy-spin 12s linear infinite;
  z-index: 3;
}

.cy-dash2 {
  inset: 11px;
  border: 1px dashed rgba(111, 234, 209, 0.28);
  animation: cy-spin-r 9s linear infinite;
  z-index: 3;
}

.cy-core {
  inset: 16px;
  background: radial-gradient(circle at 40% 40%, rgba(47,194,140,0.14), transparent 70%);
  animation: cy-breathe 4s ease-in-out infinite alternate;
  z-index: 4;
  border: 1px solid rgba(47,194,140,0.22);
}

.cy-compass-wrap {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cy-compass-svg {
  width: 28px;
  height: 28px;
}

.cd1 { transform-origin: 25px 25px; animation: cy-spin 18s linear infinite; }
.cd2 { transform-origin: 25px 25px; animation: cy-spin-r 10s linear infinite; }
.cd3 { transform-origin: 25px 25px; animation: cy-spin 6s linear infinite; }

.cyber-portal-btn:hover .cd1 { animation: cy-spin-r 2.5s linear infinite !important; }
.cyber-portal-btn:hover .cd2 { animation: cy-spin 1.8s linear infinite !important; }
.cyber-portal-btn:hover .cd3 { animation: cy-spin-r 0.9s linear infinite !important; }

.cyber-portal-btn.is-loading .cy-plasma,
.cyber-portal-btn.is-loading .cy-plasma-glow { animation-duration: 0.2s; }
.cyber-portal-btn.is-loading .cd1 { animation: cy-spin 0.4s linear infinite !important; }
.cyber-portal-btn.is-loading .cd2 { animation: cy-spin-r 0.3s linear infinite !important; }
.cyber-portal-btn.is-loading .cd3 { animation: cy-spin 0.2s linear infinite !important; }

@keyframes cy-spin { to { transform: rotate(360deg); } }
@keyframes cy-spin-r { to { transform: rotate(-360deg); } }
@keyframes cy-breathe {
  from { box-shadow: 0 0 6px rgba(229, 9, 20, 0.25); }
  to { box-shadow: 0 0 16px rgba(255, 77, 77, 0.45); }
}

.cyber-dropdown {
  position: absolute;
  top: calc(100% + 18px);
  right: 0;
  left: auto;
  transform: none;
  width: min(350px, calc(100vw - 2rem));
  background: rgba(5, 8, 16, 0.98);
  backdrop-filter: blur(14px);
  border-top: 2px solid var(--cy-c1);
  border-bottom: 2px solid var(--cy-c2);
  border-left: 1px solid rgba(229, 9, 20, 0.2);
  border-right: 1px solid rgba(255, 77, 77, 0.15);
  border-radius: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.38s ease, top 0.38s ease;
  z-index: 999999;
  overflow: hidden;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.95), 0 0 35px rgba(229, 9, 20, 0.12);
}

.cyber-dropdown.is-active {
  opacity: 1;
  pointer-events: auto;
  top: calc(100% + 10px);
}

.cy-thumb {
  width: 100%;
  height: 150px;
  background: #030508;
  overflow: hidden;
  position: relative;
  border-radius: 14px 14px 0 0;
}

.cy-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.82;
}

.cy-scan {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--cy-c1), transparent);
  animation: cy-scan 2s ease-in-out infinite;
}

@keyframes cy-scan {
  0% { top: 0; opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}

.cy-body { padding: 14px 16px; font-family: 'Roboto', sans-serif; }

.cy-system-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--cy-c1);
  text-transform: uppercase;
  margin-bottom: 5px;
  opacity: 0.7;
}

.cy-divider {
  height: 1px;
  background: linear-gradient(90deg, var(--cy-c2), transparent 80%);
  opacity: 0.3;
  margin-bottom: 12px;
}

.cy-title {
  font-weight: 900;
  font-size: 14px;
  color: #fff;
  text-transform: uppercase;
  line-height: 1.35;
  margin: 0 0 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cy-play-btn {
  display: block;
  text-align: center;
  padding: 11px;
  text-decoration: none;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 2px;
  color: #04060d !important;
  text-transform: uppercase;
  background: linear-gradient(90deg, var(--cy-c1), var(--cy-c2));
  border-radius: 6px;
  transition: filter 0.2s, transform 0.2s;
}

.cy-play-btn:hover {
  filter: brightness(1.15);
  transform: translateY(-1px);
}

.cy-no-signal {
  text-align: center;
  color: rgba(255, 77, 77, 0.85);
  font-family: Roboto, sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  padding: 8px 0;
  margin: 0;
}

@media (max-width: 768px) {
  .hero-ticker-bar {
    padding: 10px 4%;
  }

  .page-home {
    --navbar-height: 118px;
  }

  .kg-ticker-premium { height: 42px !important; }
  .kg-ticker-item {
    font-size: 13.5px !important;
    padding: 0 25px !important;
    height: 42px !important;
  }
  .kg-ticker-cat {
    font-size: 9px !important;
    padding: 2px 7px !important;
  }
  .kg-ticker-label {
    width: 44px;
    min-width: 44px;
  }
  .kg-ticker-label svg {
    width: 28px !important;
    height: 28px !important;
  }

  .cyber-portal-container {
    width: 44px;
    height: 44px;
  }
  .cyber-portal-btn {
    width: 44px;
    height: 44px;
  }
  .cyber-dropdown {
    right: -0.5rem;
    width: min(320px, calc(100vw - 1.5rem));
  }
}
