/* ================= GLOBAL ================= */
html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: #000;
  font-family: system-ui, sans-serif;
}

main, #sermonFeedContainer {
  width: 100%;
  height: 100%;
}

/* ================= HEADER FIX ================= */
.main-navigation {
  position: fixed;
  top: 0;
  width: 100%;
  height: 40px; /* smaller nav */
  background: rgba(0,0,0,0.95);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  font-size: 0.85rem; /* reduce text size */
}

.page-header {
  position: fixed;
  top: 40px; /* below nav */
  width: 100%;
  height: 40px; /* minimal header */
  text-align: center;
  z-index: 900;
  background: linear-gradient(to bottom, rgba(0,0,0,0.95), transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  padding: 0 8px;
}

main {
  padding-top: 80px; /* nav + header */
  height: calc(100vh - 80px);
  overflow: hidden;
}

/* ================= FEED ================= */
.sermon-videos {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.sermon-videos::-webkit-scrollbar {
  display: none;
}

/* ================= VIDEO CARD ================= */
.tiktok-video {
  position: relative;
  width: 100%;
  height: 100vh; /* full viewport height */
  scroll-snap-align: start;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}

/* ================= VIDEO WRAPPER ================= */
.video-wrapper {
  position: relative;
  width: 100%;
  max-width: 480px;
  aspect-ratio: 9 / 16;
  max-height: 90vh;
  margin: 0 auto;
}

.video-wrapper video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}

/* ================= PLAY BUTTON ================= */
.play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 3rem;
  color: rgba(255,255,255,0.85);
  cursor: pointer;
  z-index: 5;
  text-shadow: 0 2px 8px rgba(0,0,0,0.8);
  transition: transform 0.2s ease;
}

.play-btn:hover {
  transform: translate(-50%, -50%) scale(1.1);
}

/* ================= OVERLAY ================= */
.sermon-overlay {
  position: absolute;
  bottom: 120px;
  left: 16px;
  right: 16px;
  color: #fff;
  z-index: 4;
  text-shadow: 0 2px 10px rgba(0,0,0,0.8);
}

/* ================= ACTION BUTTONS ================= */
.sermon-actions {
  position: absolute;
  right: 12px;
  bottom: 120px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  z-index: 4;
}

/* ================= BLINKING YOUTUBE BUTTON ================= */
.youtube-btn {
  position: fixed;
  top: 90px; /* below nav + header */
  right: 16px;
  z-index: 10000;
  height: 32px;
  padding: 0 12px;
  display: none; /* controlled by JS */
  align-items: center;
  justify-content: center;
  background: rgba(220,0,0,0.95);
  color: #fff;
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  border-radius: 999px;
  white-space: nowrap;
  box-shadow: 0 3px 8px rgba(0,0,0,0.35);
  animation: pulseGlow 1.4s infinite;
}

@keyframes pulseGlow {
  0% { box-shadow: 0 0 0 rgba(255,0,0,0.6); transform: scale(1); }
  50% { box-shadow: 0 0 14px rgba(255,0,0,0.9); transform: scale(1.05); }
  100% { box-shadow: 0 0 0 rgba(255,0,0,0.6); transform: scale(1); }
}

.youtube-btn:hover {
  background: rgba(255,0,0,1);
  animation-play-state: paused;
}

/* ================= COMMENTS BOX ================= */
.comments-box {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 92%;
  max-width: 300px;
  max-height: 50vh;
  min-height: 160px;
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(3px);
  display: none;
  flex-direction: column-reverse;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
  z-index: 999;
  overflow: hidden;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.15);
}

/* ================= RESPONSIVE ================= */
@media (max-width: 768px) {
  .sermon-title { font-size: 1.2rem; }
  .sermon-desc { font-size: 0.9rem; }
  .sermon-actions button { font-size: 1.3rem; padding: 6px; }
  .play-btn { font-size: 2.5rem; }
  .youtube-btn { font-size: 0.7rem; height: 28px; top: 70px; } /* adjust for small screens */
}