/* ==========================================================================
   CFTV VMS DVR CONTINUOUS PLAYER & TIMELINE (Imagens 2 e 3)
   ========================================================================== */

/* Modal Popup do DVR por cima de tudo */
.modal-box-dvr {
  background: #0b1120;
  border: 1px solid rgba(59, 130, 246, 0.4);
  border-radius: 18px;
  padding: 24px;
  width: 100%;
  max-width: 1200px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85), 0 0 35px rgba(59, 130, 246, 0.2);
  max-height: 94vh;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  animation: modalDvrFadeIn 0.25s ease-out;
}

@keyframes modalDvrFadeIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.dvr-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.dvr-modal-title {
  font-size: 1.12rem;
  font-weight: 700;
  color: #60a5fa;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-cam-badge {
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: #93c5fd;
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
}

.btn-close-modal {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.btn-close-modal:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
  color: #f87171;
}

.stream-paused-overlay {
  position: absolute;
  inset: 0;
  background: rgba(9, 13, 22, 0.94);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
  z-index: 10;
  border-radius: 8px;
}

.dvr-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.dvr-date-picker {
  background: #1e293b !important;
  color: #f8fafc !important;
  color-scheme: dark;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.8rem;
  outline: none;
}

/* Player de Vídeo CFTV & HUD Watermark */
.dvr-video-wrapper {
  position: relative;
  background: #000000;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 16 / 9;
}

.dvr-video-wrapper video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.dvr-video-hud {
  position: absolute;
  top: 14px;
  left: 18px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.9), -1px -1px 2px rgba(0,0,0,0.8);
  pointer-events: none;
  z-index: 10;
  letter-spacing: 0.5px;
}

.dvr-video-cam-badge {
  position: absolute;
  bottom: 14px;
  right: 18px;
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #f8fafc;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  pointer-events: none;
  z-index: 10;
}

.dvr-video-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
  color: var(--text-muted);
  font-size: 0.8rem;
  background: rgba(0, 0, 0, 0.85);
  pointer-events: none;
}

.dvr-info-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: var(--text-muted);
  padding: 0 4px;
}

.btn-speed {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 0.7rem;
  cursor: pointer;
}

.btn-speed:hover {
  background: var(--primary);
}

/* Timeline com Régua Temporal e Zoom */
.dvr-timeline-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dvr-timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.zoom-btn-group {
  display: inline-flex;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  overflow: hidden;
}

.btn-zoom {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 4px 12px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.btn-zoom:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

.btn-zoom.active {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 0 10px var(--primary-glow);
}

.dvr-timeline-scroll-container {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(59, 130, 246, 0.6) rgba(15, 23, 42, 0.9);
  padding-bottom: 6px;
  cursor: grab;
}

.dvr-timeline-scroll-container:active {
  cursor: grabbing;
}

.dvr-timeline-scroll-container::-webkit-scrollbar {
  height: 6px;
}

.dvr-timeline-scroll-container::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.9);
  border-radius: 3px;
}

.dvr-timeline-scroll-container::-webkit-scrollbar-thumb {
  background: rgba(59, 130, 246, 0.5);
  border-radius: 3px;
}

.dvr-timeline-scroll-container::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

.dvr-timeline-inner {
  position: relative;
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 100%;
}

.dvr-timeline-ruler {
  position: relative;
  height: 20px;
  font-size: 0.68rem;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  user-select: none;
  margin-bottom: 2px;
}

.dvr-ruler-mark {
  position: absolute;
  transform: translateX(-50%);
  white-space: nowrap;
  pointer-events: none;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
}

.dvr-timeline-track {
  height: 40px;
  background: #090e1a;
  background-image: repeating-linear-gradient(90deg, transparent, transparent calc((100% / 24) - 1px), rgba(255, 255, 255, 0.05) calc(100% / 24));
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  position: relative;
  cursor: pointer;
  overflow: hidden;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.7);
}

.dvr-segment-bar {
  height: 100%;
  background: linear-gradient(180deg, #10b981 0%, #059669 100%);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
  position: absolute;
  border-radius: 1px;
  opacity: 0.9;
  cursor: pointer;
  transition: filter 0.15s, opacity 0.15s;
}

.dvr-segment-bar:hover {
  opacity: 1;
  filter: brightness(1.35);
  z-index: 4;
}

.dvr-playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #ef4444; /* Linha vermelha vertical de reprodução */
  box-shadow: 0 0 10px rgba(239, 68, 68, 1);
  pointer-events: none;
  z-index: 10;
  transition: left 0.1s linear;
}

.dvr-playhead::after {
  content: '';
  position: absolute;
  top: 0;
  left: -4px;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid #ef4444;
}

.dvr-timeline-tip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Controles Inferiores */
.dvr-controls-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.dvr-btn-ctrl {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #f8fafc;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.dvr-btn-ctrl:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.3);
}

.btn-live-red {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #ef4444;
  font-weight: 700;
}

.btn-live-red:hover {
  background: rgba(239, 68, 68, 0.3);
}

.dvr-date-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.dvr-date-display {
  font-size: 0.85rem;
  font-weight: 700;
  color: #38bdf8;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-pan {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: 700;
  transition: background 0.15s;
}

.btn-pan:hover {
  background: rgba(59, 130, 246, 0.3);
  border-color: var(--primary);
}

/* ==========================================================================
   HIKVISION PLAYBACK DESIGN SYSTEM (Foto 1)
   ========================================================================== */

.hik-action-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding: 8px 12px;
  background: rgba(15, 23, 42, 0.6);
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

.hik-pill-btn {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #f8fafc;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.hik-pill-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.35);
  transform: translateY(-1px);
}

.hik-pill-live {
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(239, 68, 68, 0.45);
  color: #ef4444;
  font-weight: 700;
}

.hik-pill-live:hover {
  background: rgba(239, 68, 68, 0.32);
}

.hik-bottom-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: rgba(15, 23, 42, 0.7);
  border-radius: 14px;
  border: 1px solid var(--border-color);
  margin-top: 10px;
  gap: 12px;
}

.hik-ctrl-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #f8fafc;
  padding: 8px 18px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.hik-ctrl-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.35);
  transform: translateY(-1px);
}

.hik-center-display {
  display: flex;
  align-items: center;
  gap: 16px;
}

.hik-play-btn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #ef4444;
  color: #ffffff;
  border: none;
  font-size: 1.25rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.55);
  transition: transform 0.15s ease, background 0.15s ease;
}

.hik-play-btn:hover {
  transform: scale(1.06);
  background: #dc2626;
}

.hik-clock-text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.55rem;
  font-weight: 800;
  color: #38bdf8;
  letter-spacing: 1px;
  text-shadow: 0 0 12px rgba(56, 189, 248, 0.35);
}

@media (max-width: 640px) {
  .hik-action-bar {
    gap: 6px;
    padding: 6px 8px;
  }
  .hik-pill-btn {
    padding: 6px 12px;
    font-size: 0.75rem;
  }
  .hik-bottom-bar {
    padding: 10px 12px;
  }
  .hik-ctrl-btn {
    padding: 6px 10px;
    font-size: 0.78rem;
  }
  .hik-clock-text {
    font-size: 1.15rem;
  }
  .hik-play-btn {
    width: 38px;
    height: 38px;
    font-size: 1.05rem;
  }
}

