/* Demonstração da vista ao vivo (página /servicos/videovigilancia-lisboa).
   Câmaras fictícias desenhadas só com CSS: sem imagens, sem pedidos a terceiros. */

.demo { --sans: 'Be Vietnam Pro', system-ui, sans-serif; --ink: #141413; background: var(--ink); color: #f6f5f0; border-radius: 1rem; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0px 24px 48px rgba(43, 37, 35, 0.12); }
.demo-barra { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.75rem 1rem; border-bottom: 1px solid #2b2b28; }
.demo-nota { font: 500 0.6875rem/1rem var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: #a8a49c; }
.seg { display: inline-flex; border: 1px solid #3a3a36; border-radius: 0.5rem; overflow: hidden; }
.seg button { min-width: 2.5rem; padding: 0.4rem 0.75rem; background: transparent; border: 0; border-right: 1px solid #3a3a36; color: #cac6c1; font: 500 0.75rem/1rem var(--sans); letter-spacing: 0.08em; transition: background-color .2s, color .2s; cursor: pointer; }
.seg button:last-child { border-right: 0; }
.seg button:hover { color: #fff; }
.seg button[aria-pressed="true"] { background: #f6f5f0; color: var(--ink); }
.seg button:focus-visible { outline-offset: -2px; }

.demo-ecra { position: relative; aspect-ratio: 1 / 1; background: #0c0c0b; outline-offset: -2px; }
.demo-grelha { position: absolute; inset: 0; display: grid; gap: 2px; background: #0c0c0b; }
.demo-grelha[hidden] { display: none; }

.cam { position: relative; overflow: hidden; border: 0; padding: 0; margin: 0; text-align: left; color: #f6f5f0; background: hsl(var(--h) 18% 14%); isolation: isolate; min-width: 0; min-height: 0; }
.cam:focus-visible { outline: 2px solid #e8b3a0; outline-offset: -3px; z-index: 2; }
/* «Cena» ilustrativa: luz do dia que muda de câmara para câmara + uma silhueta que passa. */
.cam-cena { position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, hsl(var(--h) 22% 22%) 0%, hsl(var(--h) 16% 12%) 62%, hsl(var(--h) 12% 8%) 100%); }
.cam-cena::before { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 38%; background: linear-gradient(180deg, hsl(var(--h) 14% 17%), hsl(var(--h) 10% 10%)); border-top: 1px solid hsl(var(--h) 18% 26% / .6); }
.cam-cena::after { content: ''; position: absolute; bottom: 26%; left: -12%; width: 7%; height: 34%; min-width: 6px; border-radius: 40% 40% 12% 12%; background: hsl(var(--h) 20% 52% / .55); filter: blur(1.5px); animation: passagem var(--d, 14s) linear infinite; animation-delay: var(--atraso, 0s); }
@keyframes passagem { 0% { left: -12%; } 100% { left: 108%; } }
.cam::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(0deg, rgba(0, 0, 0, .16) 0 1px, transparent 1px 3px); opacity: .55; }
.cam-nome, .cam-hora, .cam-rec { position: absolute; z-index: 1; font: 500 0.625rem/1 var(--sans); letter-spacing: 0.1em; text-transform: uppercase; text-shadow: 0 1px 2px rgba(0, 0, 0, .7); }
.cam-nome { left: 0.5rem; top: 0.35rem; max-width: 70%; line-height: 1.6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cam-rec { right: 0.5rem; top: 0.5rem; display: flex; align-items: center; gap: 0.3rem; }
.cam-rec i { width: 0.45rem; height: 0.45rem; border-radius: 50%; background: #e0523a; animation: pisca 1.6s steps(2, jump-none) infinite; }
@keyframes pisca { 50% { opacity: .15; } }
.cam-hora { left: 0.5rem; bottom: 0.5rem; font-variant-numeric: tabular-nums; color: #dcd8d0; }
.demo-grelha .cam { cursor: zoom-in; }
.demo-grelha.muitas .cam-hora { display: none; }
.demo-grelha.muitas .cam-nome, .demo-grelha.muitas .cam-rec { font-size: 0.5625rem; top: 0.2rem; }
.demo-grelha.muitas .cam-rec { top: 0.3rem; right: 0.3rem; }
.demo-grelha.muitas .cam-nome { left: 0.3rem; }
.demo-grelha.muitas .cam-rec span { display: none; }

.demo-ampliada { position: absolute; inset: 0; display: none; }
.demo-ampliada.aberta { display: block; }
.demo-ampliada .cam { width: 100%; height: 100%; cursor: default; }
.demo-ampliada .cam-nome, .demo-ampliada .cam-hora, .demo-ampliada .cam-rec { font-size: 0.75rem; }
.demo-ampliada .cam-cena::after { width: 5%; }
.demo-nav { position: absolute; z-index: 3; top: 50%; transform: translateY(-50%); width: 2.75rem; height: 2.75rem; display: flex; align-items: center; justify-content: center; border: 1px solid rgba(255, 255, 255, .4); border-radius: 0.5rem; background: rgba(20, 20, 19, .55); color: #fff; cursor: pointer; }
.demo-nav:hover { border-color: #e8b3a0; color: #e8b3a0; }
.demo-nav.ant { left: 0.75rem; }
.demo-nav.seg-b { right: 0.75rem; }
.demo-fechar { position: absolute; z-index: 3; right: 0.75rem; bottom: 0.75rem; padding: 0.45rem 0.9rem; border: 1px solid rgba(255, 255, 255, .4); border-radius: 0.5rem; background: rgba(20, 20, 19, .55); color: #fff; font: 500 0.6875rem/1rem var(--sans); letter-spacing: 0.14em; text-transform: uppercase; cursor: pointer; }
.demo-fechar:hover { border-color: #e8b3a0; color: #e8b3a0; }
.demo .icone { width: 1.25rem; height: 1.25rem; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.demo-pe { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; padding: 0.6rem 1rem; border-top: 1px solid #2b2b28; min-height: 3.1rem; }
.paginas { display: inline-flex; align-items: center; gap: 0.6rem; font: 500 0.6875rem/1rem var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: #cac6c1; }
.paginas button { width: 2rem; height: 2rem; display: flex; align-items: center; justify-content: center; border: 1px solid #3a3a36; border-radius: 0.375rem; background: transparent; color: #f6f5f0; cursor: pointer; }
.paginas button:hover:not(:disabled) { border-color: #e8b3a0; color: #e8b3a0; }
.paginas button:disabled { opacity: .3; cursor: default; }
.demo-dica { font-size: 0.75rem; line-height: 1rem; color: #a8a49c; }

/* Ciclo de 30 dias: o mais antigo (esquerda) sai, o novo entra à direita. */
.dias { display: grid; grid-template-columns: repeat(15, 1fr); gap: 4px; }
.dias i { aspect-ratio: 1; border-radius: 2px; background: #1c1c1a; opacity: .3; }
.dias i.guardado { opacity: .3; }
.dias i.novo { background: #9f3c27; opacity: 1; animation: dia-entra .5s ease-out; }
.dias i.apagar { opacity: .06; }
@keyframes dia-entra { from { transform: scale(.4); } }

@media (min-width: 640px) {
  .demo-ecra { aspect-ratio: auto; height: 26rem; }
  .dias { grid-template-columns: repeat(30, 1fr); }
}
@media (min-width: 900px) {
  .cam-nome, .cam-hora, .cam-rec { font-size: 0.6875rem; }
}
@media (prefers-reduced-motion: reduce) {
  .cam-cena::after, .cam-rec i { animation: none; }
  .cam-cena::after { left: 40%; }
}
