/* ============================================
   Watch Live Page – Additional Styles
   ============================================ */

.wl-hero {
  background: var(--black);
  padding: 48px 0 32px;
  border-bottom: 3px solid var(--orange);
}
.wl-hero .section-eyebrow { color: var(--orange); }
.wl-hero .section-title { color: var(--white); margin-bottom: 12px; }
.wl-hero .section-intro { color: rgba(255,255,255,0.7); margin-bottom: 20px; }

.wl-filter-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-top: 24px;
  padding-bottom: 8px;
  flex-wrap: wrap;
}

.wl-filter-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.wl-tab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 18px;
  border: 1.5px solid var(--border);
  border-radius: 100px;
  background: var(--white);
  color: var(--text-body);
  font-size: 14px; font-weight: 500;
  cursor: pointer;
  font-family: var(--font-body);
  transition: all 0.15s;
}
.wl-tab:hover { border-color: var(--orange); color: var(--orange-dark); }
.wl-tab.active { background: var(--orange); border-color: var(--orange); color: var(--white); }

.live-dot-sm {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #DC2626;
  animation: pulse 1.2s ease-in-out infinite;
  flex-shrink: 0;
}

.nav-active {
  color: var(--orange) !important;
  background: rgba(240,123,16,0.15) !important;
}

.embed-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  flex-wrap: wrap;
  gap: 12px;
}
.embed-title {
  font-weight: 600;
  font-size: 15px;
  color: var(--black);
}
.btn-sm { padding: 8px 16px; font-size: 13px; }

/* Larger stream grid for dedicated page */
.stream-grid {
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

@media (max-width: 600px) {
  .wl-hero { padding: 32px 0 24px; }
  .wl-filter-bar { flex-direction: column; align-items: flex-start; gap: 10px; }
  .wl-filter-bar .schedule-search { width: 100%; max-width: 100% !important; }
}

/* ============ MAIN TABS ============ */
.wl-tabs-bar {
  padding-top: 0;
  border-bottom: 2px solid var(--border);
  background: var(--white);
}
.wl-main-tabs {
  display: flex; gap: 0;
}
.wl-main-tab {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 16px 32px;
  background: none; border: none;
  font-size: 16px; font-weight: 600;
  font-family: var(--font-body);
  color: var(--gray-mid);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: all 0.15s;
  white-space: nowrap;
}
.wl-main-tab:hover { color: var(--black); background: var(--gray-light); }
.wl-main-tab.active {
  color: var(--orange-dark);
  border-bottom-color: var(--orange);
  background: none;
}
.wl-tab-content { display: block; }

/* Recorded card badge */
.recorded-badge {
  display: inline-block;
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  padding: 2px 8px; border-radius: 4px;
  position: absolute; top: 8px; right: 8px;
}
.badge-sermon { background: #EFF6FF; color: #1D4ED8; }
.badge-presentation { background: #F0FDF4; color: #166534; }
.badge-highlight { background: #FFF7ED; color: #C2410C; }
.badge-promotional { background: var(--orange-light); color: var(--orange-dark); }

.stream-card-duration {
  font-size: 11px; color: var(--gray-mid);
  background: rgba(0,0,0,0.6); color: white;
  position: absolute; bottom: 8px; right: 8px;
  padding: 2px 6px; border-radius: 4px;
}

/* Video modal on live page */
.video-modal-box {
  background: var(--black);
  border-radius: var(--radius-lg);
  padding: 16px;
  max-width: 860px;
  width: 100%;
  position: relative;
}

/* Close button — always visible in top-right corner */
.video-modal-box .modal-close {
  position: absolute;
  top: 8px; right: 8px;
  z-index: 10;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-size: 20px; line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.video-modal-box .modal-close:hover { background: rgba(255,255,255,0.35); }

/* iframe mode — classic padding-bottom 16:9 trick */
.video-modal-embed {
  position: relative;
  padding-top: 56.25%;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
}
.video-modal-embed iframe {
  position: absolute; inset: 0; width: 100%; height: 100%;
}

/* video mode — applied by JS when a <video> element is used instead of iframe */
.video-modal-embed.video-mode {
  padding-top: 0;
  overflow: visible;
  display: flex;
  align-items: center;
  justify-content: center;
}
.video-modal-embed.video-mode video {
  width: 100%;
  max-height: 70vh;
  border-radius: var(--radius);
  background: #000;
  display: block;
  outline: none;
}

.video-modal-title {
  color: rgba(255,255,255,0.8); font-size: 14px;
  margin-top: 12px; text-align: center;
}

/* ── Mobile video modal fixes ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  /* Make the overlay a proper full-screen flex container on mobile */
  #video-modal.modal-overlay {
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
  }

  /* Keep the box within the viewport, don't let it overflow */
  .video-modal-box {
    width: 100%;
    max-width: 100%;
    padding: 12px;
    margin: auto;
    /* Prevent the box from being taller than the screen */
    max-height: calc(100vh - 32px);
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  /* Cap video height tighter on mobile so controls stay visible */
  .video-modal-embed.video-mode video {
    max-height: 55vw; /* ~16:9 ratio on mobile width */
  }

  /* Ensure title doesn't push content off screen */
  .video-modal-title {
    font-size: 13px;
    margin-top: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* ============================================================
   Watch Live — Mobile Improvements
   ============================================================ */
@media (max-width: 600px) {
  /* Hero tighter */
  .wl-hero { padding: 24px 0 20px; }
  .wl-hero .section-title { font-size: 1.6rem; margin-bottom: 8px; }
  .wl-hero .section-intro { font-size: 13px; margin-bottom: 12px; }

  /* Main tabs: equal width, fill row */
  .wl-main-tabs { width: 100%; }
  .wl-main-tab {
    flex: 1;
    padding: 14px 8px;
    font-size: 14px;
    justify-content: center;
  }

  /* Filter bar stacks cleanly */
  .wl-filter-bar { gap: 8px; padding-top: 16px; }
  .wl-filter-tabs { width: 100%; justify-content: flex-start; }
  .wl-tab { padding: 7px 14px; font-size: 13px; }
  .wl-filter-bar .schedule-search { width: 100%; max-width: 100% !important; }

  /* Stream cards single column */
  .stream-grid {
    grid-template-columns: 1fr !important;
    gap: 14px;
  }

  /* Social links stack */
  .social-stream-links { flex-direction: column; gap: 10px; }
  .social-link-card { min-width: 0; padding: 14px 16px; }
  .social-link-card strong { font-size: 14px; }
  .social-link-card span { font-size: 12px; }

  /* Live indicator compact */
  .live-indicator { padding: 10px 14px; font-size: 13px; }
}
