/* AfricanConnect – WebTV Module Styles */

/* ── Player container ─────────────────────────────────────── */
.ac-webtv-player {
  aspect-ratio: 16 / 9;
  background: #000;
  position: relative;
  overflow: hidden;
}

.ac-webtv-player iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* ── Placeholder when no stream ───────────────────────────── */
.ac-webtv-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--ac-spacing-md);
  background: #050505;
  text-align: center;
  padding: var(--ac-spacing-xl);
}

/* ── Video grid thumbs ────────────────────────────────────── */
.ac-webtv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--ac-spacing-md);
  padding: var(--ac-spacing-md);
}

.ac-video-thumb {
  border-radius: var(--ac-radius-md);
  overflow: hidden;
  transition: var(--ac-transition);
  cursor: pointer;
}

.ac-video-thumb:hover {
  transform: translateY(-3px);
  box-shadow: var(--ac-shadow-md);
}

.ac-video-thumb:hover .ac-play-overlay > div {
  background: rgba(0, 200, 83, 0.7) !important;
}

/* ── Sidebar ──────────────────────────────────────────────── */
.ac-webtv-sidebar {
  background: var(--ac-black2);
  border-left: 1px solid rgba(255,255,255,0.06);
  display: flex;
  flex-direction: column;
  max-height: 600px;
}

/* ── Chat area ────────────────────────────────────────────── */
.ac-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--ac-spacing-md);
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,200,83,0.3) transparent;
}

.ac-chat-messages::-webkit-scrollbar {
  width: 4px;
}

.ac-chat-messages::-webkit-scrollbar-thumb {
  background: rgba(0,200,83,0.3);
  border-radius: 4px;
}

.ac-chat-msg {
  display: flex;
  gap: 8px;
  animation: ac-fadeIn 0.3s ease;
}

.ac-chat-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  overflow: hidden;
}

.ac-chat-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ac-chat-author {
  font-size: 12px;
  font-weight: 700;
  color: var(--ac-green);
  margin-bottom: 2px;
}

.ac-chat-text {
  font-size: 13px;
  color: var(--ac-white2);
  line-height: 1.4;
  word-break: break-word;
}

/* ── Chat input ───────────────────────────────────────────── */
.ac-chat-input-row {
  padding: 10px var(--ac-spacing-md);
  display: flex;
  gap: 8px;
  border-top: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}

.ac-chat-send {
  background: var(--ac-green);
  color: var(--ac-black);
  border: none;
  border-radius: var(--ac-radius-sm);
  width: 36px;
  height: 36px;
  cursor: pointer;
  font-size: 14px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--ac-transition);
}

.ac-chat-send:hover {
  background: var(--ac-green2);
}

/* ── Program item ─────────────────────────────────────────── */
.ac-program-item {
  background: var(--ac-black3);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: var(--ac-transition);
  cursor: pointer;
}

.ac-program-item:hover {
  background: rgba(255,255,255,0.06);
}

.ac-program-item.is-live {
  border-left: 2px solid var(--ac-red);
}

.ac-program-item.is-next {
  border-left: 2px solid var(--ac-green);
}

.ac-program-time {
  font-size: 11px;
  color: var(--ac-gray);
  min-width: 44px;
  font-weight: 700;
  font-family: var(--ac-font-heading);
}

.ac-program-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--ac-white);
}

.ac-program-cat {
  font-size: 11px;
  color: var(--ac-gray);
  margin-top: 2px;
}

/* ── Viewers count ────────────────────────────────────────── */
.ac-viewers-count {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: var(--ac-gray);
}

/* ── Tab panel ────────────────────────────────────────────── */
.ac-tab-panel[hidden] {
  display: none;
}

.ac-tab-panel:not([hidden]) {
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* ── HLS Player (Video.js) overrides ──────────────────────── */
.video-js {
  background: #000;
  font-family: var(--ac-font-body);
}

.video-js .vjs-big-play-button {
  background: rgba(0, 200, 83, 0.8) !important;
  border: none !important;
  border-radius: 50% !important;
  width: 70px !important;
  height: 70px !important;
  line-height: 70px !important;
  top: 50% !important;
  left: 50% !important;
  margin-top: -35px !important;
  margin-left: -35px !important;
}

.video-js .vjs-big-play-button:hover {
  background: var(--ac-green) !important;
}

.video-js .vjs-control-bar {
  background: linear-gradient(transparent, rgba(0,0,0,0.85));
}

.video-js .vjs-play-progress {
  background: var(--ac-green);
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 1024px) {
  .ac-webtv-layout {
    grid-template-columns: 1fr;
  }

  .ac-webtv-sidebar {
    border-left: none;
    border-top: 1px solid rgba(255,255,255,0.06);
    max-height: 400px;
  }
}

@media (max-width: 768px) {
  .ac-webtv-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
    padding: 10px;
  }
}
