/* ===================================================================
   CCTV LIVE SECTION & PLAYER STYLING
   Yayasan Dar el-Iman Padang
   Tema: Modern Islamic Emerald, Gold & Dark Stream Console
   =================================================================== */

.cctv-live-section {
  padding: 5rem 0;
  background: linear-gradient(180deg, #f8fafc 0%, #edf4f0 50%, #f8fafc 100%);
  position: relative;
  border-top: 1px solid var(--border-subtle);
}

.cctv-live-header {
  margin-bottom: 2rem;
}

.cctv-live-tag {
  background: #fee2e2;
  color: #dc2626;
  border: 1px solid rgba(220, 38, 38, 0.2);
}

/* ---------- Status Bar & Filters ---------- */
.cctv-live-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  background: #ffffff;
  padding: 0.85rem 1.4rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  margin-bottom: 2rem;
}

.cctv-live-status {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.88rem;
  color: var(--text-main);
}

.cctv-live-dot {
  width: 10px;
  height: 10px;
  background-color: #ef4444;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  animation: cctvPulseLive 1.8s infinite;
}

@keyframes cctvPulseLive {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.cctv-live-sep {
  color: var(--text-light);
}

.cctv-live-clock {
  font-family: Consolas, 'Courier New', monospace;
  font-size: 0.85rem;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-surface);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
}

/* Category Filters */
.cctv-live-filters {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.cctv-filter-btn {
  border: 1px solid var(--border-light);
  background: #ffffff;
  color: var(--text-muted);
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.cctv-filter-btn:hover {
  background: var(--bg-surface);
  color: var(--primary);
  border-color: var(--primary-light);
}

.cctv-filter-btn.is-active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 2px 6px var(--primary-glow);
}

/* ---------- CCTV Cards Grid ---------- */
.cctv-live-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.5rem;
}

.cctv-card {
  background: #ffffff;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.cctv-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(11, 80, 52, 0.2);
}

.cctv-card-player-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0f172a;
  overflow: hidden;
  cursor: pointer;
}

.cctv-card-player-wrap:hover .cctv-card-hover-overlay {
  opacity: 1;
}

/* Wadah player harus mengisi penuh area 16:9, jika tidak tingginya 0 */
.cctv-card-player-mount {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.cctv-card-hover-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 5;
  color: #ffffff;
  font-size: 1rem;
  font-weight: 600;
  gap: 0.5rem;
}

.cctv-badge-live {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(220, 38, 38, 0.9);
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  z-index: 4;
  backdrop-filter: blur(4px);
}

.cctv-badge-live span {
  width: 6px;
  height: 6px;
  background: #ffffff;
  border-radius: 50%;
  display: inline-block;
}

.cctv-badge-loc {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(15, 23, 42, 0.75);
  color: #cbd5e1;
  font-size: 0.7rem;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  z-index: 4;
  backdrop-filter: blur(4px);
}

.cctv-card-body {
  padding: 1.1rem 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.cctv-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.25rem;
}

.cctv-card-loc {
  font-size: 0.82rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.6rem;
}

.cctv-card-desc {
  font-size: 0.8rem;
  color: var(--text-light);
  line-height: 1.45;
  margin-bottom: 1rem;
  flex: 1;
}

.cctv-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-light);
  padding-top: 0.8rem;
  margin-top: auto;
}

.cctv-btn-expand {
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  transition: var(--transition);
}

.cctv-btn-expand:hover {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

/* Skeleton Loading */
.cctv-skeleton {
  aspect-ratio: 16 / 13;
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: cctvShimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

@keyframes cctvShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.cctv-live-empty {
  text-align: center;
  padding: 4rem 1.5rem;
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px dashed var(--border-light);
  color: var(--text-muted);
}

.cctv-live-empty i {
  font-size: 3rem;
  color: #94a3b8;
  margin-bottom: 1rem;
}

.cctv-live-empty h4 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.4rem;
}

.cctv-live-note {
  margin-top: 2rem;
  font-size: 0.8rem;
  color: var(--text-light);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-align: center;
}

/* ===================================================================
   SHARED PLAYER (ccp) STYLING
   =================================================================== */
.ccp {
  position: relative;
  width: 100%;
  height: 100%;
  background-color: #0b0f19;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  overflow: hidden;
}

.ccp-stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.ccp-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: cover;
  background: #000;
}

.ccp-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  color: #f1f5f9;
  font-size: 0.82rem;
  background: rgba(11, 15, 25, 0.85);
  backdrop-filter: blur(3px);
  z-index: 3;
  padding: 1rem;
  text-align: center;
}

.ccp-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--secondary-light);
  border-radius: 50%;
  animation: ccpSpin 0.9s linear infinite;
}

@keyframes ccpSpin {
  to { transform: rotate(360deg); }
}

.ccp-error i {
  font-size: 2rem;
  color: #ef4444;
}

.ccp-retry {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: var(--transition);
}

.ccp-retry:hover {
  background: var(--primary);
  border-color: var(--primary);
}

/* ===================================================================
   LIGHTBOX DIALOG STYLING
   =================================================================== */
.cctv-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(3, 7, 18, 0.92);
  backdrop-filter: blur(8px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.cctv-lightbox[hidden] {
  display: none !important;
}

.cctv-lb-panel {
  background: #111827;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.12);
  width: 100%;
  max-width: 1100px;
  max-height: 94vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.7);
}

.cctv-lb-head {
  padding: 1rem 1.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: #1e293b;
}

.cctv-lb-meta {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.cctv-lb-meta h3 {
  font-size: 1.15rem;
  color: #ffffff;
  font-weight: 700;
  margin: 0;
}

.cctv-lb-meta p {
  font-size: 0.8rem;
  color: #94a3b8;
  margin: 0.15rem 0 0;
}

.cctv-lb-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cctv-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.cctv-icon-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.cctv-lb-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #020617;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cctv-lb-player {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.cctv-lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 52px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: var(--transition);
  font-size: 1.1rem;
}

.cctv-lb-nav:hover {
  background: var(--primary);
  border-color: var(--primary-light);
}

.cctv-lb-nav.prev { left: 10px; border-radius: 0 8px 8px 0; }
.cctv-lb-nav.next { right: 10px; border-radius: 8px 0 0 8px; }

.cctv-osd {
  position: absolute;
  bottom: 12px;
  left: 14px;
  font-family: Consolas, 'Courier New', monospace;
  font-size: 0.75rem;
  color: #f8fafc;
  background: rgba(0, 0, 0, 0.6);
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  pointer-events: none;
  z-index: 10;
}

/* Lightbox Camera Thumbnails Bar */
.cctv-lb-thumbs {
  padding: 0.75rem 1rem;
  display: flex;
  gap: 0.65rem;
  background: #0f172a;
  overflow-x: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.cctv-thumb-item {
  flex-shrink: 0;
  width: 110px;
  background: #1e293b;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.5rem;
  cursor: pointer;
  color: #cbd5e1;
  text-align: left;
  transition: var(--transition);
}

.cctv-thumb-item:hover {
  background: #334155;
  color: #ffffff;
}

.cctv-thumb-item.is-active {
  border-color: var(--secondary-light);
  background: #1e293b;
  color: #ffffff;
}

.cctv-thumb-item strong {
  display: block;
  font-size: 0.75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cctv-thumb-item span {
  display: block;
  font-size: 0.65rem;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===================================================================
   RESPONSIVE
   =================================================================== */
@media (max-width: 768px) {
  .cctv-live-grid {
    grid-template-columns: 1fr;
  }
  .cctv-live-bar {
    flex-direction: column;
    align-items: flex-start;
  }
  .cctv-lightbox {
    padding: 0.5rem;
  }
  .cctv-lb-nav {
    width: 34px;
    height: 42px;
    font-size: 0.9rem;
  }
}

