/* ===== Thanh Hoa TV — Custom Styles ===== */

/* --- CSS Variables (Dark Theme) --- */
:root {
  --bg-primary: #062340;
  --bg-secondary: #0B2D4E;
  --bg-elevated: #10375C;
  --text-primary: #F1F5F9;
  --text-secondary: #8BADC4;
  --accent-red: #DC2626;
  --accent-live: #EF4444;
  --accent-radio: #3B82F6;
  --accent-cta: #F97316;
  --border-color: #1A4060;
}

/* --- Base --- */
body {
  font-family: 'Be Vietnam Pro', 'Noto Sans', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
}

/* --- Scrollbar (dark) --- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: #1A4060; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #245680; }

/* --- Global focus-visible --- */
:focus-visible {
  outline: 2px solid var(--accent-red);
  outline-offset: 2px;
  border-radius: 4px;
}

/* --- Live pulse dot --- */
.live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--accent-live);
  border-radius: 50%;
  animation: pulse-live 1.5s ease-in-out infinite;
}

@keyframes pulse-live {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.3); }
}

/* --- Hero slider overlay gradient --- */
.hero-overlay {
  background: linear-gradient(to top, rgba(6,35,64,0.95) 0%, rgba(6,35,64,0.4) 40%, transparent 100%);
}

/* --- Hero bottom fade (smooth hero-to-content transition) --- */
#hero {
  position: relative;
}
#hero::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 40px;
  background: linear-gradient(to bottom, transparent, var(--bg-primary));
  z-index: 5;
  pointer-events: none;
}

/* --- Sticky header shadow on scroll --- */
.header-scrolled {
  box-shadow: 0 2px 20px rgba(0,0,0,0.5);
}

/* --- Section title underline accent --- */
.section-title::after {
  content: '';
  display: block;
  width: 48px;
  height: 3px;
  background: var(--accent-red);
  margin-top: 8px;
  border-radius: 2px;
}

/* --- Section spacing rhythm --- */
section + section {
  border-top: 1px solid var(--border-color);
}
section.bg-th-bg2 + section.bg-th-bg2 {
  border-top: none;
}

/* --- Scroll reveal --- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Card hover lift --- */
.group:hover .card-lift {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

/* --- Leader box gradient background --- */
#site-header + .h-\[104px\] + section + section + section .bg-th-bg2.rounded-xl {
  background: linear-gradient(135deg, #121829 0%, #1a2235 50%, #0f1525 100%);
}

/* --- Schedule list: highlight active --- */
.schedule-item.is-active {
  background: var(--bg-elevated);
  border-left: 3px solid var(--accent-red);
}


/* --- Video.js theming /ptth (giữ lại; phần position/big-play/pip cũ đã bỏ vì nay dùng dmediaEmbeds) --- */
.video-js .vjs-play-progress, .video-js .vjs-volume-level { background-color: var(--accent-red); }
.video-js .vjs-control-bar { background: rgba(0, 0, 0, 0.7); }

/* --- Short video card (9:16 aspect) --- */
.short-video-card {
  aspect-ratio: 9/16;
}

/* --- Podcast waveform placeholder --- */
.podcast-wave {
  background: repeating-linear-gradient(
    90deg,
    var(--accent-red) 0px, var(--accent-red) 2px,
    transparent 2px, transparent 5px
  );
  height: 32px;
  opacity: 0.4;
  border-radius: 4px;
}

/* --- Dropdown styled for dark theme --- */
.dropdown-dark {
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-radius: 6px;
  padding: 8px 12px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  cursor: pointer;
}

.dropdown-dark:focus {
  outline: 2px solid var(--accent-red);
  outline-offset: 2px;
}

/* --- Trending number style --- */
.text-th-red\/40 {
  font-family: 'Be Vietnam Pro', sans-serif;
  font-weight: 800;
  font-style: italic;
  line-height: 1;
}

/* --- Location tags scrollbar --- */
#location-tags::-webkit-scrollbar { display: none; }
#location-tags { scrollbar-width: none; }

/* --- Location tag hover --- */
#location-tags a:hover {
  background: var(--accent-red) !important;
  border-color: var(--accent-red) !important;
  color: white !important;
}

/* --- Mega menu animation --- */
#mega-menu:not(.hidden) {
  animation: slideDown 0.25s ease;
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Nav active indicator --- */
#nav-menu li a:hover,
#nav-menu li a.active {
  position: relative;
}
#nav-menu li a:hover::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 70%;
  height: 2px;
  background: var(--accent-red);
  border-radius: 1px;
}

/* --- Social icon hover --- */
footer a[aria-label] svg {
  transition: transform 0.2s ease, color 0.2s ease;
}
footer a[aria-label]:hover svg {
  transform: scale(1.15);
  color: var(--accent-red);
}

/* --- Go-to-top button enhancement --- */
#btn-top {
  transition: opacity 0.3s ease, transform 0.3s ease;
}
#btn-top:hover {
  background: var(--accent-red) !important;
  border-color: var(--accent-red) !important;
  transform: translateY(-2px);
}

/* --- Banner ad section borders --- */
#bao-in + div {
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
  .live-dot { animation: none; }
  .pip-player { transition: none; }
  .swiper-wrapper { transition-duration: 0ms !important; }
  .reveal { transition: none; opacity: 1; transform: none; }
  #mega-menu { animation: none; }
}

/* --- Mobile adjustments --- */
@media (max-width: 767px) {
  .pip-player {
    width: 180px;
    bottom: 12px;
    right: 12px;
  }
}

/* ============================================================
   Animation gom từ inline <style> của các trang /ptth (2026-07-03)
   ============================================================ */

/* Soundwave equalizer — card Phát thanh (index.html) */
.ptth-eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 13px; }
.ptth-eq i {
  width: 2px; height: 100%; border-radius: 1px;
  background: var(--th-radio, #3B82F6);
  transform-origin: bottom; transform: scaleY(.3);
  animation: ptth-eq .9s ease-in-out infinite;
}
.ptth-eq i:nth-child(2) { animation-delay: .15s; }
.ptth-eq i:nth-child(3) { animation-delay: .30s; }
.ptth-eq i:nth-child(4) { animation-delay: .45s; }
.ptth-eq i:nth-child(5) { animation-delay: .60s; }
.ptth-radio-card:hover .ptth-eq i { animation-duration: .5s; }
@keyframes ptth-eq { 0%, 100% { transform: scaleY(.3); } 50% { transform: scaleY(1); } }
@media (prefers-reduced-motion: reduce) { .ptth-eq i { animation: none; transform: scaleY(.6); } }

/* Soundwave audio hero — trang chi tiết Phát thanh (detail_pt.html) */
@keyframes ptthWave { 0%, 100% { transform: scaleY(0.35); } 50% { transform: scaleY(1); } }
.ptth-wave { transform-origin: bottom; animation: ptthWave 1s ease-in-out infinite; }

/* Mega-menu mở (layout.htm) */
@keyframes ptthMegaIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
#mega-menu:not(.hidden) .ptth-mega-panel { animation: ptthMegaIn .18s ease-out; }

/* ============================================================
   Player LIVE /ptth (dmediaEmbeds livetv/liveradio) — GIỐNG trang chủ:
   để video.js vjs-fluid tự dựng 16:9 (nút play + canvas visualizer đúng), chỉ ép full-width
   (sửa radio audio mặc định hẹp 448px -> viền đen). KHÔNG ép absolute/padding-top (phá fluid).
   ============================================================ */
#tv-player, #radio-player { position: relative; }
#player-container .dglivetv-container,
#player-container .dgliveradio-container { width: 100%; max-width: none; margin: 0; }
#player-container .video-js { width: 100% !important; max-width: 100% !important; }
/* Badge "TRỰC TIẾP" trên TV live (giống trang chủ) — ẩn khi đã phát */
#tv-player .live-badge-tt {
  position: absolute; top: 12px; left: 12px; z-index: 6; pointer-events: none;
  display: inline-flex; align-items: center; gap: 6px;
  background: #c1041c; color: #fff; font-size: 12px; font-weight: 600; line-height: 1;
  padding: 5px 10px; border-radius: 4px; text-transform: uppercase;
}
#tv-player:has(.video-js.vjs-has-started) .live-badge-tt { display: none; }

/* Nav-sticky mobile: nhóm hamburger + brand CHỈ hiện khi header đã cuộn mất (nav dính đỉnh, .nav-stuck).
   Chưa cuộn -> header còn hiển thị (đã có hamburger riêng) -> ẩn để tránh 2 nút mở menu. */
#nav-sticky:not(.nav-stuck) .nav-sticky-mobile { display: none; }
