:root {
  --bg: #0c0c0c;
  --panel: #1a1a1a;
  --border: #2e2e2e;
  --text: #e0e0e0;
}

@font-face {
  font-family: 'ITC Avant Garde Gothic Pro Book';
  src: url('/Fonts/ITC.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
}

body {
  background: var(--bg);
  color: var(--text);
  margin: 0;
  padding: 0;
  text-align: center;
  font-family: 'Noto Sans', system-ui, sans-serif;
}

header {
  padding: 20px 0 10px;
  border-bottom: 1px solid var(--border);
}

h1 {
  font-weight: 400;
  font-size: 21px;
  margin: 0;
}

#history-container {
  padding-bottom: 50px;
  margin-bottom: 20px;
}

.close-container {
  width: 50px;
  height: 50px;
  cursor: pointer;
  margin: 20px auto 0 auto;
  position: relative;
}

.leftright,
.rightleft {
  height: 100px;
  width: 10px;
  position: absolute;
  top: 0;
  left: 50%;
  transform-origin: center;
  background-color: white;
  border-radius: 2px;
  transition: all 0.3s ease-in;
}

.leftright {
  transform: rotate(45deg);
}

.rightleft {
  transform: rotate(-45deg);
}

.close-container:hover .leftright {
  transform: rotate(-45deg);
  background-color: #F25C66;
}

.close-container:hover .rightleft {
  transform: rotate(45deg);
  background-color: #F25C66;
}


.subtitle {
  font-size: 13px;
  color: #9b9b9b;
  margin-top: 5px;
}

.controls {
  margin: 20px 0 10px;
}

.btn {
  background: #001d27;
  color: white;
  border: 2px solid white;
  margin: 4px;
  font-size: 11px;
  letter-spacing: 0.35em;
  padding: 0.8em 2em;
  border-radius: 0;
  cursor: pointer;
  transition: background-color 0.3s, color 0.3s;
  font-weight: bold;
  -webkit-tap-highlight-color: transparent;
}

.delete-btn {
  background: #bd0505;
  color: #ffb9b9;
  border: 1px solid #ffffff;
  padding: .8em 2em;
  font-size: 11px;
  letter-spacing: .35em;
  font-weight: 600;
  cursor: pointer;
}

.delete-btn:hover {
  background: #a00;
}

@media (hover: hover) and (pointer: fine) {

  .btn:hover,
  .day-btn:hover {
    background: white !important;
    color: black !important;
    transform: scale(0.98);
    transition: background-color .2s, color .2s, transform .15s;
  }
}

@media (hover: none),
(pointer: coarse) {

  .btn:hover,
  .day-btn:hover {
    background: #001d27 !important;
    color: white !important;
    transform: none !important;
  }

  .btn:active,
  .day-btn:active {
    background: white !important;
    color: black !important;
    transform: scale(0.97);
    transition: background-color .15s, color .15s, transform .1s;
  }
}

.day-btn {
  font-family: "Inter", system-ui, sans-serif;
  background: var(--panel);
  color: var(--text);
  border: 1px solid #a1a1a1;
  width: 100px;
  height: 30px;
  font-size: 13px;
  cursor: pointer;
  transition: background-color .2s, color .2s, transform .15s;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 6px rgba(0, 0, 0, .2);
}

.btn:hover,
.day-btn:hover {
  background-color: white;
  color: black;
}

#dayList {
  display: none;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 20px auto;
  max-width: 650px;
}

.gallery {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  padding: 10px 10px 90px;
}

.image-card {
  background: var(--panel);
  border-radius: 8px;
  overflow: hidden;
  width: calc(50% - 10px);
  max-width: 380px;
  cursor: pointer;
  transition: transform .2s;
}

.image-card:hover {
  transform: scale(1.01);
}

.image-card img {
  width: 100%;
  height: auto;
  display: block;
}

.timestamp {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  background: none;
  padding: 5px 0;
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.70);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s;
  z-index: 1000;
}

.lightbox.visible {
  opacity: 1;
  visibility: visible;
}

.lightbox img,
.lightbox video {
  max-width: 95%;
  max-height: 80%;
  border-radius: 8px;
  background: #000;
}

.lightbox-buttons {
  margin-top: 25px;
  display: flex;
  gap: 10px;
  justify-content: center;
}

#seeVideoBtn {
  font-size: 11px;
  letter-spacing: .35em;
  padding: .8em 2em;
  margin: 4px;
  border-radius: 0;
  font-weight: 500;
  transition: background-color .3s,
    box-shadow .3s, color .3s, border-color .3s;
  border: 1px solid #fff;
  background: #fff;
  color: #000;
}

#backBtn {
  font-size: 11px;
  letter-spacing: .35em;
  padding: .8em 2em;
  margin: 4px;
  border-radius: 0;
  font-weight: 500;
  transition: background-color .3s,
    box-shadow .3s, color .3s, border-color .3s;
  border: 1px solid #fff;
  background: var(--panel);
  font-weight: 600;
  color: var(--text);
}

#backBtn:hover {
  border: 1px solid red;
  background: var(--panel);
  color: red;
}

#seeVideoBtn:hover {
  border: 1px solid #fffeff;
  background: #441647;
  color: #ffddf3;
}

footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: var(--panel);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 10px 0px 10px 0px;
  z-index: 1000;
}

#btnSud,
#btnNord {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  margin: 4px;
  font-size: 10px;
  letter-spacing: .35em;
  padding: .8em 2em;
  border-radius: 0;
  transition: .3s;
}

#btnSud.active,
#btnNord.active {
  box-shadow: inset 0 0 1em rgba(0, 170, 170, .5), 0 0 1em rgba(0, 170, 170, .5);
  border: 2px solid #ccffff;
}

.lyrarc {
  padding: 1.5rem 2rem;
  border-radius: 12px;
  background: rgb(255 50 50 / 10%);
  border: 1px solid rgb(255 50 50 / 30%);
  color: #ff6b6b;
  max-width: 600px;
  margin-bottom: 400px;
  text-align: center;
  font-size: 1rem;
  width: 70%;
}

@media(min-width:600px) {
  .image-card {
    width: calc(33.3% - 10px);
  }
}

.thumb-delete {
  display: block;
  width: 100%;
  background: #bd0505;
  color: #ffb9b9;
  border: none;
  padding: 6px 0;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.2s;
}

.thumb-delete:hover {
  background: #a00;
  color: white;
}


.day-btn.no-data {
  background: #3b0000;
  color: #ffcccc;
  border: 1px solid #ff4444;
  opacity: 0.7;
}

.day-btn.no-data:hover {
  background: #5a0000;
  color: #fff;
  opacity: 1;
}

.video-grid {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 16px;
  width: 92%;
  margin: 20px auto 0 auto;
  background: transparent;
  flex-wrap: wrap;
}

.video-grid iframe {
  flex: 1 1 48%;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  background: transparent;
  display: block;
  overflow: hidden;
}

.video-grid .live-container {
  position: relative;
  flex: 1 1 48%;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  background: transparent;
  display: block;
  overflow: hidden;
}

.video-grid .live-container iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: auto;
  border: 0;
  display: block;
  aspect-ratio: 16 / 9;
}

video {
  object-fit: contain !important;
}

.live-status {
  position: absolute;
  top: 8px;
  left: 12px;
  background: rgba(0, 0, 0, 0.55);
  color: #e0fff8;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 6px;
  font-family: "Inter", system-ui, sans-serif;
  z-index: 2;
  pointer-events: none;
  user-select: none;
  transition: opacity .35s ease, visibility .35s ease;
}

.live-status.hidden {
  opacity: 0;
  visibility: hidden;
}

.flux-wait {
  position: absolute;
  top: 10px;
  left: 12px;
  background: rgba(20, 20, 20, 0.6);
  color: #00e5ff;
  font-size: 10px;
  font-weight: 500;
  padding: 3px 8px;
  border-left: 3px solid #00e5ff;
  border-radius: 4px;
  z-index: 5;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.live-container {
  position: relative;
  overflow: hidden;
}

.live-container::before {
  content: "";
  position: absolute;
  inset: 0;
  background: black;
  opacity: 1;
  transition: opacity 0.6s ease;
  z-index: 4;
}

.live-container.flux-ok::before {
  opacity: 0;
}

@media (max-width: 900px) {
  .video-grid .live-container {
    flex: none;
    width: 100%;
    aspect-ratio: 16 / 9;
  }
}

@media (max-width: 900px) {
  .video-grid {
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 95%;
  }

  .video-grid iframe {
    flex: none;
    width: 100%;
    aspect-ratio: 16 / 9;
  }
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}


* {
  scrollbar-width: thin;
  scrollbar-color: #154761 #0f0f0f;
  -webkit-tap-highlight-color: transparent;
}

.live-status-badge {
  position: absolute;
  top: 5px;
  left: 6px;
  background: rgba(0, 0, 0, 0.6);
  color: #00e5ff;
  font-size: 10px;
  font-weight: 500;
  padding: 3px 8px;
  border-left: 3px solid #00e5ff;
  border-radius: 4px;
  z-index: 5;
  backdrop-filter: blur(1px);
  -webkit-backdrop-filter: blur(1px);
}

.live-status-badge.direct {
  background: rgba(0, 0, 0, 0.5);
  color: #00ff6a;
  border-left-color: #00ff6a;
  font-weight: 600;
}

.live-status-badge.refuse {
  background: rgba(0, 0, 0, 0.5);
  color: #ff4b4b !important;
  border-left-color: #ff4b4b !important;
  font-weight: 600 !important;
}

.ptz-wrapper {
  width: 95%;
  max-width: 1100px;
  margin: 25px auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 25px;
}

@media (max-width: 900px) {
  .ptz-wrapper {
    grid-template-columns: 1fr;
  }
}

.ptz-title {
  color: #00e5ff;
  font-size: 14px;
  letter-spacing: 2px;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.ptz-button {
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  display: inline-block;
  font-weight: bold;
  padding: 0.6em 1.6em;
  border: 2px solid white;
  border-radius: 2px;
  margin: 6px;
  color: white;
  background: transparent;
  transition: .2s;
  cursor: pointer;
}

.ptz-button:active {
  transform: scale(0.9);
  background: white;
  color: black;
}

.btn-fullscreen {
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  display: inline-block;
  font-weight: bold;
  padding: 0.5em 2em;
  border: 2px solid #00f6ff;
  border-radius: 2px;
  margin: 5px;
  color: #00f6ff;
  background: transparent;
  transition: 0.2s;
  cursor: pointer;
}

.btn-fullscreen:active {
  transform: scale(0.9);
  border: 2px solid white;
  background: white;
  color: black;
}

.ptz-row {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.ptz-zoom {
  border-color: white;
  color: white;
}

.ptz-zoom:active {
  background: white;
  color: black;
}

.cam-column {
  flex: 1 1 48%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.cam-column .live-container {
  width: 100%;
  flex: none;
}

.ptz-controller-box {
  display: none;
}

.ptz-controller-box {
  border: 1px solid #2e2e2e;
  border-radius: 8px;
  padding: 12px 0 16px;
  text-align: center;
  box-shadow: 0 0 10px #000;
  width: 92%;
  zoom: 1.3;
}

.ptz-title {
  color: #00e5ff;
  font-size: 12px;
  letter-spacing: 2px;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.ptz-button {
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  display: inline-block;
  font-weight: bold;
  padding: 0.5em 2em;
  border: 2px solid white;
  border-radius: 2px;
  margin: 5px;
  color: white;
  background: transparent;
  transition: 0.2s;
  cursor: pointer;
}

.ptz-button:active {
  transform: scale(0.9);
  background: white;
  color: black;
}

.ptz-row {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.controle {
  padding-top: 20px;
}

.ptz-arrows-row {
  gap: 50px;
}

.ptz-button svg {
  width: 10px;
  height: 10px;
  display: block;
  margin: 0 auto;
  color: white;
}

.ptz-dir {
  padding: 8px 25px;
  background: transparent;
}

.ptz-dir:active {
  background: white;
}

.ptz-dir:active svg {
  color: black;
}

@media (max-width: 900px) {
  .cam-column {
    flex: none;
    width: 100%;
  }
}
