/*
Theme Name: WorldSignal TV & Radio
Theme URI: https://example.com
Author: Your Name
Author URI: https://example.com
Description: Theme WordPress untuk situs Live TV & Radio Online dari berbagai negara, lengkap dengan slot iklan (Adsterra dan jaringan lain) dan Custom Post Type untuk mengelola channel/radio dari halaman admin.
Version: 1.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: worldsignal
*/

:root{
  --bg: #0B0E13;
  --bg-raised: #12161D;
  --bg-card: #171C24;
  --line: #262C36;
  --text: #E8EAED;
  --muted: #8B93A1;
  --live-red: #FF4433;
  --radio-amber: #F2B94D;
  --font-display: 'Archivo Black', 'Arial Black', sans-serif;
  --font-body: 'Inter', -apple-system, sans-serif;
  --font-mono: 'IBM Plex Mono', 'Courier New', monospace;
}

* { box-sizing: border-box; }
body.worldsignal-page {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.5;
}
.worldsignal-page a { color: inherit; text-decoration: none; }

/* ============ ON-AIR TICKER ============ */
.onair-ticker {
  background: var(--bg-raised);
  border-bottom: 1px solid var(--line);
  padding: 8px 0;
  overflow: hidden;
  white-space: nowrap;
  position: relative;
}
.onair-ticker::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 90px;
  background: linear-gradient(90deg, var(--bg-raised) 40%, transparent);
  z-index: 2;
}
.ticker-track {
  display: inline-flex;
  gap: 40px;
  animation: scroll-ticker 40s linear infinite;
  padding-left: 100%;
}
@keyframes scroll-ticker {
  from { transform: translateX(0); }
  to { transform: translateX(-100%); }
}
.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}
.dot-live {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--live-red);
  animation: pulse-dot 1.6s infinite;
  flex-shrink: 0;
}
@keyframes pulse-dot {
  0% { box-shadow: 0 0 0 0 rgba(255,68,51,0.5); }
  70% { box-shadow: 0 0 0 6px rgba(255,68,51,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,68,51,0); }
}
.ticker-item strong { color: var(--text); }

/* ============ HEADER ============ */
.ws-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
  gap: 16px;
}
.ws-logo {
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.ws-logo .dot-live { width: 9px; height: 9px; }
.ws-logo .custom-logo-link { display: flex; align-items: center; }
.ws-logo img.custom-logo {
  max-height: 44px;
  width: auto;
  display: block;
}
nav.mode-switch {
  display: flex;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px;
}
nav.mode-switch button {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 8px 20px;
  border: none;
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s;
}
nav.mode-switch button.active[data-mode="tv"] { background: var(--live-red); color: #fff; }
nav.mode-switch button.active[data-mode="radio"] { background: var(--radio-amber); color: #17130A; }

/* ============ AD SLOTS ============ */
.ad-slot {
  background: var(--bg-raised);
  border: 1px dashed var(--line);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: center;
  padding: 8px;
}
.ad-slot.top-banner    { max-width: 728px; height: 90px; margin: 20px auto; }
.ad-slot.sidebar       { height: 250px; width: 100%; margin-bottom: 16px; }
.ad-slot.footer-banner { max-width: 728px; height: 90px; margin: 30px auto; }

/* ============ SECTION HEADINGS ============ */
.section-heading {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 28px 32px 12px;
}
.section-heading h2 {
  font-family: var(--font-display);
  font-size: 22px;
  margin: 0;
}
.section-heading .count {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}

/* ============ COUNTRY FILTER ============ */
.country-filter {
  display: flex;
  gap: 8px;
  padding: 0 32px 16px;
  overflow-x: auto;
}
.country-filter button {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 8px 14px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
}
.country-filter button.active { border-color: var(--live-red); color: var(--text); }

/* ============ LAYOUT WITH SIDEBAR ============ */
.ws-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 24px;
  padding: 0 32px 40px;
  align-items: start;
}
.ws-sidebar { position: sticky; top: 20px; }
.ws-sidebar h3 {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  margin: 0 0 12px;
}

/* ============ CHANNEL GRID ============ */
.channel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.channel-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s;
}
.channel-card:hover { border-color: var(--live-red); transform: translateY(-2px); }
.channel-thumb {
  height: 130px;
  background: linear-gradient(135deg, #1B212C, #10141B);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
}
.live-badge {
  position: absolute;
  top: 10px; left: 10px;
  background: var(--live-red);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.live-badge .dot-live { background: #fff; width: 6px; height: 6px; }
.channel-info { padding: 12px 14px; }
.channel-info .name { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.channel-info .meta { font-size: 12px; color: var(--muted); font-family: var(--font-mono); }

/* ============ RADIO LIST ============ */
.radio-list { display: flex; flex-direction: column; gap: 10px; }
.radio-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 16px;
  cursor: pointer;
}
.radio-row:hover { border-color: var(--radio-amber); }
.radio-icon {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--bg-raised);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.radio-meta .name { font-weight: 600; font-size: 14px; }
.radio-meta .genre { font-size: 12px; color: var(--muted); font-family: var(--font-mono); }
.radio-row .play-icon { margin-left: auto; color: var(--radio-amber); font-size: 20px; }

/* ============ PLAYER MODAL ============ */
.player-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(5,6,9,0.92);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.player-overlay.open { display: flex; }
.player-box {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 12px;
  width: 100%;
  max-width: 900px;
  overflow: hidden;
}
.player-box .frame-wrap {
  aspect-ratio: 16/9;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 13px;
  text-align: center;
  padding: 20px;
}
.player-box .frame-wrap iframe { width: 100%; height: 100%; border: 0; }
.player-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
}
.player-header .name { font-weight: 700; }
.close-btn { background: none; border: none; color: var(--muted); font-size: 20px; cursor: pointer; }
.player-box .ad-slot { margin: 0 18px 18px; height: 90px; }

/* ============ FOOTER ============ */
.ws-footer {
  border-top: 1px solid var(--line);
  padding: 30px 32px;
  color: var(--muted);
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.ws-footer a { margin-right: 16px; }
.ws-footer a:hover { color: var(--text); }

@media (max-width: 860px) {
  .ws-layout { grid-template-columns: 1fr; }
  .ws-sidebar { position: static; }
}
