/* ==========================================================================
   ELIMU TRACK — 2026 National Examinations Live Broadcast News Ticker
   Broadcast-style rolling ticker with 5-second interval headline transitions
   ========================================================================== */

.news-ticker-banner {
  width: 100% !important;
  background: linear-gradient(90deg, #022c22 0%, #064e3b 25%, #047857 55%, #059669 80%, #022c22 100%) !important;
  color: #ffffff !important;
  border-bottom: 2.5px solid #10b981 !important;
  position: relative !important;
  z-index: 999998 !important;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35) !important;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
  display: block !important;
}

/* 5-Second Linear Progress Bar */
.news-ticker-progress-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 2.5px;
  width: 0%;
  background: linear-gradient(90deg, #34d399 0%, #fbbf24 70%, #f59e0b 100%);
  box-shadow: 0 0 8px rgba(251, 191, 36, 0.8);
  transition: width 5s linear;
  z-index: 5;
}

.news-ticker-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 18px;
  min-height: 44px;
  box-sizing: border-box;
}

/* Left Section: Live Badge */
.news-ticker-badge-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.news-ticker-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981 0%, #047857 100%);
  color: #ffffff;
  font-size: 15px;
  border: 1.5px solid #6ee7b7;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
  flex-shrink: 0;
}

.news-ticker-badge {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  color: #0f172a;
  font-size: 10.5px;
  font-weight: 900;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  flex-shrink: 0;
}

.news-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #dc2626;
  display: inline-block;
  box-shadow: 0 0 6px #ef4444;
  animation: newsBeaconPulse 1.2s infinite ease-in-out;
}

@keyframes newsBeaconPulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.35);
    opacity: 0.45;
  }
}

/* Center Section: Viewport & Sliding Headlines with News Curtain Wipe */
.news-ticker-viewport {
  flex: 1;
  min-width: 0;
  height: 28px;
  position: relative;
  overflow: hidden;
}

/* TV Broadcast Wipe Curtain Runner */
.news-curtain-runner {
  position: absolute;
  top: 0;
  left: 0;
  width: 40px;
  height: 100%;
  pointer-events: none;
  opacity: 0;
  z-index: 25;
}

.news-curtain-runner::after {
  content: '';
  position: absolute;
  top: -4px;
  left: 0;
  width: 3.5px;
  height: calc(100% + 8px);
  background: linear-gradient(180deg, #fbbf24 0%, #ffffff 50%, #34d399 100%);
  box-shadow: 0 0 14px 2px #34d399, -5px 0 20px 4px rgba(251, 191, 36, 0.95);
  border-radius: 2px;
}

.news-curtain-runner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 36px;
  height: 100%;
  background: linear-gradient(90deg, rgba(251, 191, 36, 0.35) 0%, rgba(16, 185, 129, 0.18) 60%, transparent 100%);
}

.news-curtain-runner.sweeping {
  animation: runnerSweepRTL 0.62s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes runnerSweepRTL {
  0% {
    left: 100%;
    opacity: 1;
  }
  92% {
    left: 0%;
    opacity: 1;
  }
  100% {
    left: -40px;
    opacity: 0;
  }
}

.news-ticker-item {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  font-size: 13px;
  line-height: 28px;
  color: #f1f5f9;
  opacity: 0;
  clip-path: inset(0 0 0 100%);
  pointer-events: none;
}

.news-ticker-item.active {
  opacity: 1;
  clip-path: inset(0 0 0 0);
  pointer-events: auto;
}

/* Curtain Close from Right to Left */
.news-ticker-item.curtain-exit {
  animation: newsCurtainExitRTL 0.62s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  pointer-events: none;
}

/* Curtain Open / Reveal from Right to Left */
.news-ticker-item.curtain-enter {
  animation: newsCurtainEnterRTL 0.62s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  pointer-events: auto;
}

@keyframes newsCurtainExitRTL {
  0% {
    clip-path: inset(0 0 0 0);
    opacity: 1;
  }
  100% {
    clip-path: inset(0 100% 0 0);
    opacity: 0;
  }
}

@keyframes newsCurtainEnterRTL {
  0% {
    clip-path: inset(0 0 0 100%);
    opacity: 1;
  }
  100% {
    clip-path: inset(0 0 0 0);
    opacity: 1;
  }
}

.news-tag {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.3) 0%, rgba(220, 38, 38, 0.45) 100%);
  border: 1px solid #ef4444;
  color: #fca5a5;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.6px;
  padding: 1.5px 7px;
  border-radius: 4px;
  flex-shrink: 0;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 1px 4px rgba(239, 68, 68, 0.25);
}

.news-tag.highlight {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.25) 0%, rgba(5, 150, 105, 0.4) 100%);
  border-color: #10b981;
  color: #a7f3d0;
  box-shadow: 0 1px 4px rgba(16, 185, 129, 0.25);
}

.news-tag.accent {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25) 0%, rgba(217, 119, 6, 0.4) 100%);
  border-color: #f59e0b;
  color: #fde68a;
  box-shadow: 0 1px 4px rgba(245, 158, 11, 0.25);
}

.news-title {
  color: #ffffff;
  font-weight: 700;
  flex-shrink: 0;
}

.news-sub {
  color: #6ee7b7;
  font-weight: 600;
  flex-shrink: 0;
}

.news-desc {
  color: #e2e8f0;
  opacity: 0.95;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Right Section: Controls */
.news-ticker-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.news-ticker-county-chip {
  font-size: 11px;
  color: #a7f3d0;
  font-weight: 700;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(52, 211, 153, 0.4);
  padding: 3px 10px;
  border-radius: 8px;
}

.news-ticker-nav {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  padding: 2px 6px;
}

.news-ticker-btn {
  background: transparent;
  border: none;
  color: #cbd5e1;
  font-size: 14px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.15s;
}

.news-ticker-btn:hover {
  color: #ffffff;
}

.news-ticker-counter {
  font-size: 10px;
  font-weight: 800;
  color: #94a3b8;
  letter-spacing: 0.5px;
  min-width: 24px;
  text-align: center;
}

.news-ticker-close {
  background: transparent;
  border: none;
  color: #cbd5e1;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  transition: color 0.15s;
}

.news-ticker-close:hover {
  color: #ef4444;
}

/* Print Handling */
@media print {
  .news-ticker-banner {
    display: none !important;
  }
}

/* Responsive Breakpoints */
@media (max-width: 900px) {
  .news-ticker-county-chip {
    display: none !important;
  }
}

@media (max-width: 650px) {
  .news-ticker-container {
    padding: 6px 12px;
    gap: 8px;
  }
  .news-ticker-nav {
    display: none !important;
  }
  .news-desc {
    display: none !important;
  }
  .news-ticker-badge {
    font-size: 9.5px;
    padding: 2px 7px;
  }
}

/* Whole Banner Curtain Close Effect (Right to Left) */
.news-ticker-banner.closing-curtain {
  animation: bannerCurtainCloseRTL 0.72s cubic-bezier(0.4, 0, 0.2, 1) forwards !important;
  pointer-events: none !important;
  overflow: hidden !important;
}

.news-banner-curtain-blade {
  position: absolute;
  top: 0;
  left: 0;
  width: 5px;
  height: 100%;
  background: linear-gradient(180deg, #fbbf24 0%, #ffffff 50%, #34d399 100%);
  box-shadow: 0 0 18px 3px #34d399, -6px 0 25px 5px rgba(251, 191, 36, 0.95);
  pointer-events: none;
  opacity: 0;
  z-index: 999999;
}

.news-ticker-banner.closing-curtain .news-banner-curtain-blade {
  animation: bannerBladeSweepRTL 0.72s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes bannerCurtainCloseRTL {
  0% {
    clip-path: inset(0 0 0 0);
    opacity: 1;
    max-height: 80px;
  }
  80% {
    clip-path: inset(0 100% 0 0);
    opacity: 1;
    max-height: 80px;
  }
  100% {
    clip-path: inset(0 100% 0 0);
    opacity: 0;
    max-height: 0;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    border-bottom-width: 0 !important;
    margin: 0 !important;
  }
}

@keyframes bannerBladeSweepRTL {
  0% {
    left: 100%;
    opacity: 1;
    transform: scaleY(1.5);
  }
  92% {
    left: 0%;
    opacity: 1;
    transform: scaleY(1.5);
  }
  100% {
    left: -20px;
    opacity: 0;
    transform: scaleY(1);
  }
}
