/* ============================================================
   webtv.css — NDMA WebTV page
   ============================================================ */

#webtv-wrap *,
#webtv-wrap *::before,
#webtv-wrap *::after { box-sizing: border-box; margin: 0; padding: 0; }

#webtv-wrap {
  font-family: 'Inter', 'Segoe UI', sans-serif;
  position: relative;
  background-image: url('../img/hero.png');
  background-attachment: fixed;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  min-height: 100vh;
  --green:   #1a7a1a;
  --green-l: #22c55e;
  --gold:    #f0a500;
  --text:    #fff;
  --muted:   rgba(255,255,255,.55);
  --card-bg: rgba(255,255,255,0.09);
  --card-br: rgba(255,255,255,0.15);
  --sb-bg:   rgba(255,255,255,0.07);
}

#webtv-wrap .wtv-page__overlay {
  position: absolute;
  inset: 0;
  background: #0000008a;
  z-index: 0;
}

#webtv-wrap .wtv-page__content {
  position: relative;
  z-index: 1;
}

/* ── HERO / PAGE TITLE BAR ────────────────────────────────── */
#webtv-wrap .wtv-hero {
  padding: 28px 0 22px;
  border-bottom: 1px solid rgba(255,255,255,.10);
  text-align: center;
}

#webtv-wrap .wtv-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

#webtv-wrap .wtv-brand-icon {
  width: 48px; height: 48px;
  background: #c0392b;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 0 20px rgba(192,57,43,0.5);
}

#webtv-wrap .wtv-brand-text h1 {
  font-size: 1.6rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
  line-height: 1;
  text-shadow: 0 2px 8px rgba(0,0,0,.4);
}

#webtv-wrap .wtv-brand-text h1 span { color: #22c55e; }

#webtv-wrap .wtv-brand-text p {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 4px;
  letter-spacing: 0.06em;
}


/* ── TWO-COLUMN LAYOUT ────────────────────────────────────── */
#webtv-wrap .wtv-layout {
  max-width: 1340px;
  margin: 0 auto;
  padding: 28px 32px 60px;
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

/* ── SIDEBAR ──────────────────────────────────────────────── */
#webtv-wrap .wtv-sidebar {
  flex: 0 0 240px;
  width: 240px;
  position: sticky;
  top: 20px;
}

/* Search */
#webtv-wrap .wtv-sb-search {
  position: relative;
  margin-bottom: 20px;
}

#webtv-wrap .wtv-sb-search i {
  position: absolute;
  left: 13px; top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 0.88rem;
  pointer-events: none;
  transition: color .2s;
}

#webtv-wrap .wtv-sb-search:focus-within i { color: #22c55e; }

#webtv-wrap .wtv-sb-search input {
  width: 100%;
  background: var(--sb-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--card-br);
  border-radius: 10px;
  padding: 10px 14px 10px 36px;
  font-size: 0.84rem;
  color: #fff;
  outline: none;
  font-family: inherit;
  transition: border-color .2s, box-shadow .2s;
}

#webtv-wrap .wtv-sb-search input:focus {
  border-color: rgba(34,197,94,0.5);
  box-shadow: 0 0 0 3px rgba(34,197,94,0.10);
}

#webtv-wrap .wtv-sb-search input::placeholder { color: var(--muted); }

/* Category label */
#webtv-wrap .wtv-sb-label {
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 8px;
  padding-left: 4px;
}

/* Category nav */
#webtv-wrap .wtv-sb-nav {
  background: var(--card-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--card-br);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#webtv-wrap .wtv-sb-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 14px;
  border: none;
  border-bottom: 1px solid rgba(255,255,255,.07);
  background: transparent;
  color: var(--muted);
  font-size: 0.83rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: background .18s, color .18s;
  font-family: inherit;
}

#webtv-wrap .wtv-sb-btn:last-child { border-bottom: none; }

#webtv-wrap .wtv-sb-btn i {
  font-size: 0.9rem;
  flex-shrink: 0;
  width: 16px;
  text-align: center;
}

#webtv-wrap .wtv-sb-btn-label { flex: 1; }

#webtv-wrap .wtv-sb-btn:hover {
  background: rgba(255,255,255,0.07);
  color: #fff;
}

#webtv-wrap .wtv-sb-btn.active {
  background: rgba(26,122,26,0.25);
  color: #fff;
  border-left: 3px solid #22c55e;
  padding-left: 11px;
}

#webtv-wrap .wtv-sb-btn.active .wtv-sb-count {
  background: rgba(34,197,94,0.2);
  color: #22c55e;
}

#webtv-wrap .wtv-sb-count {
  background: rgba(255,255,255,0.1);
  border-radius: 20px;
  padding: 2px 8px;
  font-size: 0.62rem;
  color: var(--muted);
  font-weight: 700;
  flex-shrink: 0;
}

/* ── CONTENT AREA ─────────────────────────────────────────── */
#webtv-wrap .wtv-content { flex: 1; min-width: 0; }

#webtv-wrap .wtv-results-row {
  display: flex;
  align-items: center;
  margin-bottom: 18px;
}

#webtv-wrap .wtv-results-label {
  font-size: 0.82rem;
  color: var(--muted);
}

#webtv-wrap .wtv-results-label strong { color: #fff; }

/* ── VIDEO GRID ───────────────────────────────────────────── */
#webtv-wrap .wtv-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

#webtv-wrap .wtv-card {
  background: var(--card-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--card-br);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: transform .25s, box-shadow .25s, border-color .25s, background .25s;
}

#webtv-wrap .wtv-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.45);
  border-color: rgba(34,197,94,0.35);
  background: rgba(255,255,255,0.14);
}

/* thumbnail */
#webtv-wrap .wtv-thumb {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: rgba(0,0,0,0.3);
}

#webtv-wrap .wtv-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .4s ease, filter .4s ease;
  filter: brightness(0.85);
}

#webtv-wrap .wtv-card:hover .wtv-thumb img {
  transform: scale(1.06);
  filter: brightness(0.7);
}

#webtv-wrap .wtv-play-overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0);
  transition: background .3s;
}

#webtv-wrap .wtv-card:hover .wtv-play-overlay { background: rgba(0,0,0,0.25); }

#webtv-wrap .wtv-play-btn {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: rgba(192,57,43,0.92);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 1.2rem;
  transform: scale(0.85);
  opacity: 0;
  transition: transform .3s, opacity .3s;
  box-shadow: 0 4px 20px rgba(192,57,43,0.5);
}

#webtv-wrap .wtv-card:hover .wtv-play-btn { transform: scale(1); opacity: 1; }

#webtv-wrap .wtv-duration {
  position: absolute;
  bottom: 8px; right: 8px;
  background: rgba(0,0,0,0.75);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
}

#webtv-wrap .wtv-cat-badge {
  position: absolute;
  top: 8px; left: 8px;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 3px 8px;
  border-radius: 4px;
  color: #fff;
}

#webtv-wrap .wtv-cat-badge.psm          { background: #be185d; }
#webtv-wrap .wtv-cat-badge.monsoon      { background: #1d4ed8; }
#webtv-wrap .wtv-cat-badge.response     { background: #dc2626; }
#webtv-wrap .wtv-cat-badge.training     { background: #16a34a; }
#webtv-wrap .wtv-cat-badge.events       { background: #7c3aed; }
#webtv-wrap .wtv-cat-badge.international{ background: #0891b2; }
#webtv-wrap .wtv-cat-badge.briefing     { background: #b45309; }
#webtv-wrap .wtv-cat-badge.dewte        { background: #0e7490; }
#webtv-wrap .wtv-cat-badge.pedrr23      { background: #6d3d14; }
#webtv-wrap .wtv-cat-badge.humanitarian { background: #9d174d; }
#webtv-wrap .wtv-cat-badge.piedrr24     { background: #1e4d8c; }
#webtv-wrap .wtv-cat-badge.pedrr25      { background: #166534; }
#webtv-wrap .wtv-cat-badge.dialogue     { background: #4338ca; }
#webtv-wrap .wtv-cat-badge.nidm         { background: #92400e; }
#webtv-wrap .wtv-cat-badge.resilience   { background: #065f46; }

/* card info */
#webtv-wrap .wtv-info { padding: 13px 14px 15px; }

#webtv-wrap .wtv-title {
  font-size: 0.84rem;
  font-weight: 600;
  color: #fff;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 8px;
}

#webtv-wrap .wtv-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

#webtv-wrap .wtv-date,
#webtv-wrap .wtv-watch {
  font-size: 0.7rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* empty state */
#webtv-wrap .wtv-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}

#webtv-wrap .wtv-empty i {
  font-size: 3rem;
  margin-bottom: 16px;
  display: block;
  opacity: 0.4;
}

#webtv-wrap .wtv-empty p { color: rgba(255,255,255,.5); }

/* ── PAGINATION ───────────────────────────────────────────── */
#webtv-wrap .wtv-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 28px 0 12px;
  flex-wrap: wrap;
}

#webtv-wrap .wtv-page-btn {
  min-width: 38px; height: 38px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,0.07);
  color: rgba(255,255,255,.65);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .18s, color .18s;
  display: inline-flex; align-items: center; justify-content: center;
}

#webtv-wrap .wtv-page-btn:hover:not(.disabled):not(.active) {
  background: rgba(255,255,255,0.14);
  color: #fff;
}

#webtv-wrap .wtv-page-btn.active {
  background: #1a7a1a;
  color: #fff;
  border-color: #1a7a1a;
}

#webtv-wrap .wtv-page-btn.disabled { opacity: 0.35; cursor: default; }

#webtv-wrap .wtv-page-dots {
  padding: 0 4px;
  font-size: 0.9rem;
  opacity: 0.5;
  line-height: 38px;
  color: rgba(255,255,255,.6);
}

/* ── MODAL ────────────────────────────────────────────────── */
#webtv-modal {
  display: none;
  position: fixed; inset: 0;
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

#webtv-modal.is-open { display: flex; }

#webtv-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.88);
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

#webtv-modal-box {
  position: relative;
  background: rgba(10,20,10,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 16px;
  width: 100%;
  max-width: 900px;
  overflow: hidden;
  box-shadow: 0 32px 80px rgba(0,0,0,0.7);
  z-index: 1;
  animation: wtvSlideIn .28s ease;
}

@keyframes wtvSlideIn {
  from { transform: translateY(24px) scale(0.97); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}

#webtv-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,.12);
  gap: 16px;
}

#webtv-modal-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: #fff;
  line-height: 1.35;
  flex: 1;
}

#webtv-modal-close {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.2);
  color: #fff;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
  transition: background .2s, border-color .2s;
}

#webtv-modal-close:hover { background: #c0392b; border-color: #c0392b; }

#webtv-modal-iframe-wrap {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
}

#webtv-modal-iframe-wrap iframe {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border: none;
}

/* ── RESPONSIVE ───────────────────────────────────────────── */
@media (max-width: 1100px) {
  #webtv-wrap .wtv-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
  #webtv-wrap .wtv-layout {
    flex-direction: column;
    padding: 20px 16px 48px;
  }
  #webtv-wrap .wtv-sidebar {
    flex: none;
    width: 100%;
    position: static;
  }
  #webtv-wrap .wtv-sb-nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
    background: transparent;
    border: none;
    border-radius: 0;
  }
  #webtv-wrap .wtv-sb-btn {
    flex: 0 0 auto;
    width: auto;
    padding: 7px 14px !important;
    border-radius: 20px !important;
    border: 1px solid rgba(255,255,255,.18) !important;
    border-bottom: 1px solid rgba(255,255,255,.18) !important;
    font-size: 0.78rem;
    background: rgba(255,255,255,0.07);
  }
  #webtv-wrap .wtv-sb-btn.active {
    border-color: #22c55e !important;
    background: rgba(34,197,94,0.15);
    color: #22c55e;
  }
  #webtv-wrap .wtv-sb-count { display: none; }
}

@media (max-width: 540px) {
  #webtv-wrap .wtv-grid { grid-template-columns: 1fr; }
  #webtv-wrap .wtv-hero-inner { flex-direction: column; align-items: flex-start; }
  #webtv-wrap .wtv-hero { padding: 20px 0 16px; }
  #webtv-wrap .wtv-hero-inner { padding: 0 16px; }
}
