/* ==========================================
   GAZETA TRÂNSITO ENTERPRISE V4
   FRONTEND
========================================== */

.gte-dashboard,
.gte-camera-grid,
.gte-ocorrencia-list,
.gte-camera-slider,
.gte-dashboard *,
.gte-camera-grid *,
.gte-ocorrencia-list *,
.gte-camera-slider *{
    box-sizing:border-box;
    font-family:'Inter',system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;
}

.gte-dashboard{
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:18px;
    margin:24px 0;
}

.gte-dash-card{
    padding:22px;
    border:1px solid #e5e7eb;
    border-radius:22px;
    background:#fff;
    box-shadow:0 16px 38px rgba(15,23,42,.08);
}

.gte-dash-card strong{
    display:block;
    color:#dc2626;
    font-size:34px;
    font-weight:950;
    line-height:1;
}

.gte-dash-card span{
    display:block;
    margin-top:8px;
    color:#475569;
    font-size:12px;
    font-weight:900;
    text-transform:uppercase;
    letter-spacing:.08em;
}

.gte-empty{
    padding:18px 20px;
    border:1px dashed #cbd5e1;
    border-radius:18px;
    background:#f8fafc;
    color:#64748b;
    font-weight:800;
}

.gte-camera-grid{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:22px;
}

.gte-camera-slider{
    display:flex;
    gap:18px;
    overflow-x:auto;
    scroll-snap-type:x mandatory;
    padding:4px 2px 14px;
}

.gte-camera-slide{
    min-width:320px;
    scroll-snap-align:start;
}

.gte-camera-card{
    overflow:hidden;
    border:1px solid #e5e7eb;
    border-radius:24px;
    background:#fff;
    box-shadow:0 16px 40px rgba(15,23,42,.10);
    transition:transform .25s ease, box-shadow .25s ease;
}

.gte-camera-card:hover{
    transform:translateY(-4px);
    box-shadow:0 24px 54px rgba(15,23,42,.15);
}

.gte-camera-media{
    position:relative;
    aspect-ratio:16/9;
    background:#0f172a;
    overflow:hidden;
}

.gte-camera-media img{
    width:100%;
    height:100%;
    object-fit:cover;
    display:block;
}

.gte-status{
    position:absolute;
    z-index:2;
    top:14px;
    left:14px;
    display:inline-flex;
    align-items:center;
    gap:6px;
    padding:7px 11px;
    border-radius:999px;
    background:#dc2626;
    color:#fff;
    font-size:11px;
    font-weight:950;
    text-transform:uppercase;
    letter-spacing:.05em;
    box-shadow:0 10px 25px rgba(220,38,38,.28);
}

.gte-status::before{
    content:'';
    width:7px;
    height:7px;
    border-radius:50%;
    background:#fff;
    animation:gtePulse 1.2s infinite;
}

.gte-status-instavel,
.gte-status-manutencao{background:#f59e0b;box-shadow:0 10px 25px rgba(245,158,11,.28);}
.gte-status-offline{background:#475569;box-shadow:0 10px 25px rgba(71,85,105,.22);}

@keyframes gtePulse{
    0%,100%{opacity:1; transform:scale(1);}
    50%{opacity:.45; transform:scale(.7);}
}

.gte-placeholder{
    height:100%;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:7px;
    color:#fff;
    text-align:center;
    background:linear-gradient(135deg,#111827,#334155);
}

.gte-placeholder span{
    width:54px;
    height:38px;
    border:3px solid rgba(255,255,255,.75);
    border-radius:10px;
}

.gte-placeholder strong{font-size:15px;font-weight:950;}
.gte-placeholder em{font-size:12px;color:#cbd5e1;font-style:normal;}

.gte-camera-body{
    padding:18px;
}

.gte-camera-body h3{
    margin:0 0 12px;
    color:#0f172a;
    font-size:18px;
    line-height:1.18;
    font-weight:950;
    letter-spacing:-.02em;
}

.gte-tags{
    display:flex;
    flex-wrap:wrap;
    gap:7px;
    margin-bottom:12px;
}

.gte-tags span{
    display:inline-flex;
    padding:6px 9px;
    border-radius:999px;
    background:#f1f5f9;
    color:#334155;
    font-size:11px;
    font-weight:900;
}

.gte-camera-body p{
    margin:0;
    color:#64748b;
    font-size:12px;
    font-weight:700;
}

.gte-open-camera{
    margin-top:14px;
    width:100%;
    height:42px;
    border:0;
    border-radius:999px;
    background:#dc2626;
    color:#fff;
    font-weight:950;
    cursor:pointer;
}

.gte-ocorrencia-list{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:18px;
}

.gte-ocorrencia{
    padding:20px;
    border:1px solid #e5e7eb;
    border-radius:20px;
    background:#fff;
    box-shadow:0 14px 34px rgba(15,23,42,.08);
}

.gte-ocorrencia strong{
    color:#dc2626;
    font-size:11px;
    font-weight:950;
    text-transform:uppercase;
    letter-spacing:.08em;
}

.gte-ocorrencia h3{
    margin:8px 0;
    color:#111827;
    font-size:17px;
    font-weight:950;
}

.gte-ocorrencia p{color:#64748b;margin:0 0 10px;}
.gte-ocorrencia small{color:#334155;font-weight:900;}

.gte-modal{
    position:fixed;
    inset:0;
    z-index:999999;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:24px;
    background:rgba(15,23,42,.88);
}

.gte-modal[hidden]{display:none;}
.gte-modal-inner{position:relative;max-width:1100px;width:100%;}
.gte-modal img{width:100%;border-radius:20px;display:block;background:#111827;}
.gte-modal-title{margin:0 0 12px;color:#fff;font-size:22px;font-weight:950;}
.gte-modal-close{position:absolute;right:-12px;top:-12px;width:42px;height:42px;border:0;border-radius:50%;background:#dc2626;color:#fff;font-size:24px;cursor:pointer;}

@media(max-width:1024px){
    .gte-dashboard,
    .gte-camera-grid,
    .gte-ocorrencia-list{grid-template-columns:repeat(2,minmax(0,1fr));}
}

@media(max-width:680px){
    .gte-dashboard,
    .gte-camera-grid,
    .gte-ocorrencia-list{grid-template-columns:1fr;}
    .gte-camera-slide{min-width:86vw;}
}

/* Diagnóstico visível apenas para administradores quando ativado */
.gte-debug{
    margin:22px 0;
    padding:18px;
    border:1px solid #cbd5e1;
    border-radius:16px;
    background:#f8fafc;
    color:#0f172a;
    font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}
.gte-debug pre{
    max-height:360px;
    overflow:auto;
    white-space:pre-wrap;
    background:#0f172a;
    color:#e5e7eb;
    padding:14px;
    border-radius:12px;
    font-size:12px;
}
.gte-empty small{opacity:.75;}

/* ==========================================
   SPRINT 3 — MODAL, SLIDER E REFRESH
========================================== */

.gte-slider-shell,
.gte-slider-shell *{
    box-sizing:border-box;
    font-family:'Inter',system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;
}

.gte-slider-head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:16px;
    margin:0 0 14px;
}

.gte-slider-head strong{
    color:#0f172a;
    font-size:22px;
    font-weight:950;
    letter-spacing:-.03em;
}

.gte-slider-prev,
.gte-slider-next{
    width:38px;
    height:38px;
    border:1px solid #e5e7eb;
    border-radius:999px;
    background:#fff;
    color:#0f172a;
    font-size:25px;
    font-weight:900;
    line-height:1;
    cursor:pointer;
    box-shadow:0 10px 24px rgba(15,23,42,.08);
}

.gte-slider-prev:hover,
.gte-slider-next:hover{
    border-color:#dc2626;
    color:#dc2626;
}

.gte-card-actions{
    display:flex;
    align-items:center;
    gap:10px;
    margin-top:14px;
}

.gte-card-actions .gte-open-camera{
    margin-top:0;
    flex:1;
}

.gte-refresh-camera{
    width:42px;
    height:42px;
    border:1px solid #fecaca;
    border-radius:999px;
    background:#fff;
    color:#dc2626;
    font-size:17px;
    font-weight:950;
    cursor:pointer;
}

.gte-refresh-camera:hover{
    background:#fff1f2;
}

.gte-img-refreshing{
    opacity:.58;
    filter:saturate(.75);
    transition:opacity .25s ease, filter .25s ease;
}

.gte-modal-inner{
    display:grid;
    grid-template-columns:1fr;
    gap:14px;
    max-width:1180px;
}

.gte-modal-media{
    border-radius:24px;
    overflow:hidden;
    background:#020617;
    box-shadow:0 30px 90px rgba(0,0,0,.45);
}

.gte-modal-info{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:16px;
    padding:16px 18px;
    border:1px solid rgba(255,255,255,.12);
    border-radius:20px;
    background:rgba(15,23,42,.88);
    backdrop-filter:blur(14px);
}

.gte-modal-info .gte-modal-title{
    margin:0;
    flex:1;
}

.gte-modal-status{
    display:inline-flex;
    align-items:center;
    gap:7px;
    padding:7px 11px;
    border-radius:999px;
    background:#dc2626;
    color:#fff;
    font-size:11px;
    font-weight:950;
    text-transform:uppercase;
}

.gte-modal-status::before{
    content:'';
    width:7px;
    height:7px;
    border-radius:50%;
    background:#fff;
}

.gte-modal-source{
    margin:0;
    color:#cbd5e1;
    font-size:13px;
    font-weight:800;
}

.gte-modal-refresh{
    height:38px;
    padding:0 15px;
    border:0;
    border-radius:999px;
    background:#dc2626;
    color:#fff;
    font-weight:950;
    cursor:pointer;
    white-space:nowrap;
}

@media(max-width:760px){
    .gte-modal-info{
        align-items:flex-start;
        flex-direction:column;
    }
    .gte-modal-refresh{
        width:100%;
    }
}

/* ==========================================
   SPRINT 4 — SMART TRAFFIC
========================================== */
.gte-ticker,
.gte-timeline,
.gte-ticker * ,
.gte-timeline *{
    box-sizing:border-box;
    font-family:'Inter',system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;
}

.gte-ticker{
    display:flex;
    align-items:center;
    gap:14px;
    width:100%;
    margin:18px 0;
    padding:12px 14px;
    border-radius:999px;
    background:#111827;
    color:#fff;
    overflow:hidden;
    box-shadow:0 16px 38px rgba(15,23,42,.18);
}

.gte-ticker > strong{
    flex:0 0 auto;
    padding:7px 12px;
    border-radius:999px;
    background:#dc2626;
    font-size:12px;
    font-weight:950;
    text-transform:uppercase;
    letter-spacing:.04em;
}

.gte-ticker-track{
    display:flex;
    gap:26px;
    min-width:0;
    overflow:auto;
    scrollbar-width:none;
}

.gte-ticker-track::-webkit-scrollbar{display:none;}

.gte-ticker-track span{
    flex:0 0 auto;
    font-size:14px;
    white-space:nowrap;
    color:#f9fafb;
}

.gte-ticker-track b{color:#fecaca;}

.gte-timeline{
    display:flex;
    flex-direction:column;
    gap:14px;
    margin:22px 0;
}

.gte-timeline-item{
    display:grid;
    grid-template-columns:74px 1fr;
    gap:16px;
    padding:18px;
    border:1px solid #e5e7eb;
    border-radius:22px;
    background:#fff;
    box-shadow:0 14px 35px rgba(15,23,42,.07);
}

.gte-timeline-item time{
    display:flex;
    align-items:center;
    justify-content:center;
    height:42px;
    border-radius:14px;
    background:#fee2e2;
    color:#991b1b;
    font-weight:950;
}

.gte-timeline-item strong{
    display:inline-flex;
    margin-right:8px;
    color:#dc2626;
    font-size:12px;
    text-transform:uppercase;
    letter-spacing:.04em;
}

.gte-priority{
    display:inline-flex;
    margin-right:8px;
    padding:4px 9px;
    border-radius:999px;
    background:#f3f4f6;
    color:#374151;
    font-size:11px;
    font-weight:900;
    text-transform:uppercase;
}

.gte-timeline-item h3{
    margin:6px 0 6px;
    font-size:19px;
    line-height:1.2;
    font-weight:950;
    color:#111827;
}

.gte-timeline-item p{
    margin:0 0 8px;
    color:#4b5563;
    font-size:14px;
    line-height:1.5;
}

.gte-timeline-item small{
    color:#6b7280;
    font-weight:750;
}

@media (max-width:640px){
    .gte-ticker{border-radius:18px;align-items:flex-start;flex-direction:column;}
    .gte-timeline-item{grid-template-columns:1fr;}
    .gte-timeline-item time{justify-content:flex-start;padding:0 14px;width:max-content;}
}
