/* --- MAP REDESIGN: FULL SCREEN & FLOATING PANELS --- */
.map-view-container {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#mapContainer.map-full-screen {
    width: 100%;
    height: 100%;
    position: absolute;
    inset: 0;
    z-index: 1;
}

/* Fix para não ter margens no container app quando estiver no mapa */
.map-active .app-content {
    padding: 0 !important;
    margin: 0 !important;
}

/* Descer controles do Leaflet (Zoom +/-) para não cortar no topo e ficar abaixo do 3º botão */
.leaflet-top {
    top: 280px !important;
}

.map-active .card {
    border-radius: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
}

/* Floating Search Panels */
.floating-search-panel {
    position: absolute;
    top: 100px;
    left: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.floating-panel-item {
    background: transparent;
    padding: 0;
    border-radius: 50%;
    box-shadow: none;
    display: flex;
    align-items: center;
    pointer-events: auto;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 48px;
    height: 48px;
    overflow: visible;
    border: none;
}

.floating-panel-item.expanded {
    width: 280px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    padding-left: 5px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}

.panel-toggle-btn {
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: 50%;
    background: white;
    color: #4f46e5;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    font-size: 1.2rem;
}

.panel-toggle-btn:hover {
    transform: scale(1.1) rotate(5deg);
    background: #4f46e5;
    color: white;
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.4);
}

.panel-content {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s;
    flex: 1;
    margin-left: 10px;
}

.floating-panel-item.expanded .panel-content {
    opacity: 1;
    visibility: visible;
}

.panel-content input {
    width: 100%;
    border: none !important;
    background: transparent !important;
    font-size: 0.95rem;
    padding: 5px;
    color: #1e293b !important;
    outline: none !important;
}

/* --- NOVO COCKPIT DE MONITORAMENTO ELITE V7.0 --- */
:root {
    --bs-bg: rgba(15, 23, 42, 0.85); /* Slate 900 com transparência */
    --bs-border: rgba(255, 255, 255, 0.08);
    --bs-accent: #6366f1; /* Indigo 500 */
    --bs-success: #10b981; /* Emerald 500 */
    --bs-danger: #ef4444; /* Rose 500 */
    --bs-warning: #f59e0b; /* Amber 500 */
    --bs-glass: blur(16px) saturate(180%);
}

/* Bottom Sheet */
.bottom-sheet {
    position: absolute;
    bottom: -100%;
    left: 50%;
    transform: translateX(-50%);
    width: min(420px, 95%);
    background: var(--bs-bg);
    backdrop-filter: var(--bs-glass);
    -webkit-backdrop-filter: var(--bs-glass);
    border-radius: 32px 32px 0 0;
    z-index: 2000;
    transition: bottom 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    color: white !important;
    padding: 0;
    box-shadow: 0 -20px 60px rgba(0,0,0,0.5);
    border: 1px solid var(--bs-border);
    border-bottom: none;
}

/* Garante que o SweetAlert fique na frente do Bottom Sheet Adilson */
.swal2-container {
    z-index: 10000 !important;
}

.bottom-sheet * {
    color: white !important;
}

/* Exceções para manter cores de status se necessário */
.bottom-sheet .success, .bottom-sheet .success * { color: #10b981 !important; }
.bottom-sheet .danger, .bottom-sheet .danger * { color: #ef4444 !important; }
.bottom-sheet .warning, .bottom-sheet .warning * { color: #f59e0b !important; }
.bottom-sheet .bs-toggle-min, .bottom-sheet .bs-toggle-min * { color: white !important; }
.bottom-sheet .bs-stat-label { opacity: 0.6; }
.bottom-sheet .bs-info-item span { opacity: 0.9; }

.bs-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 32px;
    height: 32px;
    background: transparent !important;
    border: none !important;
    color: rgba(255,255,255,0.5) !important;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s;
    font-size: 1.5rem;
}

.bs-close-btn:hover {
    color: white !important;
    transform: rotate(90deg);
}

/* Ajuste para formatters (renderAcc, renderSignal) no Bottom Sheet */
.bottom-sheet .v-telemetry-item {
    background: rgba(255,255,255,0.05) !important;
    border-color: rgba(255,255,255,0.1) !important;
}

.bottom-sheet .v-telemetry-item span {
    color: inherit !important;
}

.bottom-sheet.active {
    bottom: 0;
}

.bs-handle-area {
    padding: 12px 16px 8px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.bs-handle {
    width: 40px;
    height: 4px;
    background: rgba(255,255,255,0.15);
    border-radius: 2px;
    margin-bottom: 12px;
}

.bs-toggle-min {
    background: #10b981;
    color: white;
    border-radius: 20px;
    padding: 6px 16px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.3);
}

.bs-content {
    padding: 0 24px 32px;
    max-height: 85vh;
    overflow-y: auto;
}

/* Header de Identidade Premium adilson */
.bs-vehicle-header {
    margin-bottom: 20px;
    padding-top: 5px;
}

.bs-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    width: 100%;
}

.bs-plate-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
}

/* Container de Foto Estilizado adilson */
.bs-photo-section {
    position: relative;
    width: 72px;
    height: 72px;
    min-width: 72px;
}

.bs-photo-frame {
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--bs-border);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: zoom-in;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.2);
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}

.bs-photo-frame:hover {
    transform: scale(1.08) rotate(-2deg);
    border-color: var(--bs-accent);
    box-shadow: 0 15px 35px rgba(99, 102, 241, 0.25);
}

.bs-photo-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bs-photo-frame i {
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.1) !important;
}

/* Botão de Upload Admin adilson */
.bs-admin-photo-btn {
    position: absolute;
    bottom: -4px;
    right: -4px;
    width: 26px;
    height: 26px;
    background: var(--bs-accent);
    border: 2px solid #0f172a;
    border-radius: 8px;
    color: white !important;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    transition: all 0.2s;
    z-index: 10;
}

.bs-admin-photo-btn:hover { background: #4f46e5; transform: scale(1.1); }

/* Estilo para o Modal de Bloqueio Premium adilson */
.premium-swal-popup {
    background: rgba(15, 23, 42, 0.95) !important;
    backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(255,255,255,0.08) !important;
    border-radius: 32px !important;
    color: white !important;
}

.premium-swal-title {
    font-weight: 800 !important;
    color: white !important;
    letter-spacing: -0.5px;
}

/* Badge tática de Placa Minimalista adilson */
.bs-plate-pill {
    background: #1e3a8a;
    color: white;
    padding: 2px 10px;
    border-radius: 6px;
    font-family: 'Roboto Mono', monospace;
    font-size: 0.9rem;
    font-weight: 800;
    letter-spacing: 1px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
}

.cockpit-console.minimal {
    padding-top: 5px;
}

/* Badge de Movimento Flutuante adilson */
.bs-status-badge {
    padding: 6px 14px;
    border-radius: 100px;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    white-space: nowrap;
}

.bs-status-badge.moving {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.3);
    color: var(--bs-success) !important;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.2);
}

/* Grid de Telemetria Moderna Adilson */
.bs-telemetry-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.bs-tele-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--bs-border);
    border-radius: 20px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: transform 0.2s;
}

.bs-tele-card:hover { transform: translateY(-2px); background: rgba(255, 255, 255, 0.05); }

.bs-tele-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.7rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.4) !important;
    text-transform: uppercase;
}

.bs-tele-header i { font-size: 0.8rem; color: var(--bs-accent) !important; }

.bs-tele-val { font-size: 1.3rem; font-weight: 800; color: white !important; }
.bs-tele-val small { font-size: 0.8rem; opacity: 0.5; margin-left: 2px; }

/* Info List Estilizada adilson */
.bs-details-box {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 20px;
    padding: 16px;
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.bs-detail-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.bs-detail-icon {
    width: 36px;
    height: 36px;
    min-width: 36px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bs-accent) !important;
}

.bs-detail-info { display: flex; flex-direction: column; gap: 2px; }
.bs-detail-label { font-size: 0.65rem; font-weight: 700; text-transform: uppercase; color: rgba(255, 255, 255, 0.4) !important; }
.bs-detail-val { font-size: 0.85rem; font-weight: 600; color: rgba(255, 255, 255, 0.9) !important; line-height: 1.4; }

/* Painel de Ações Adilson */
.bs-action-center {
    border-top: 1px solid var(--bs-border);
    padding-top: 24px;
}

.bs-primary-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 32px;
}

.bs-utility-row {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.bs-util-btn {
    flex: 1;
    height: 50px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--bs-border);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.8rem;
    font-weight: 700;
    color: white !important;
}

.bs-util-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.bs-util-btn i {
    font-size: 1rem;
    color: var(--bs-accent) !important;
}

.bs-util-btn.wa {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.2);
    color: #22c55e !important;
    position: relative;
}

.bs-util-btn.wa i { color: #22c55e !important; }

.bs-util-btn.wa:hover {
    background: rgba(34, 197, 94, 0.2);
    border-color: #22c55e;
}

/* --- ANIMAÇÕES DE STATUS ELITE --- */
@keyframes pulse-emerald {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

@keyframes pulse-amber {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4); }
    70% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(245, 158, 11, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

.bs-pulse-anchor {
    border-color: var(--bs-warning) !important;
    background: rgba(245, 158, 11, 0.1) !important;
}

.bs-pulse-anchor i {
    color: var(--bs-warning) !important;
    animation: pulse-amber 2s infinite;
}

/* Badge de Bloqueio Pulsante adilson */
.bs-badge-blocked-pulse {
    background: var(--bs-danger);
    color: white;
    font-size: 10px;
    font-weight: 900;
    padding: 4px 12px;
    border-radius: 100px;
    letter-spacing: 1px;
    animation: pulse-red-lite 2s infinite;
    display: inline-block;
}

@keyframes pulse-red-lite {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

/* Esconder elementos legados */
.bs-close-btn, .floating-controls { display: none !important; }

/* Estado de Comandando (Optimistic UI) */
.neo-toggle-container.neo-is-commanding {
    opacity: 0.7;
    pointer-events: none;
    filter: saturate(0.8);
    animation: neo-pulse-commanding 1.5s infinite ease-in-out;
}

@keyframes neo-pulse-commanding {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    50% { transform: scale(1.02); box-shadow: 0 0 20px 5px rgba(239, 68, 68, 0.2); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
}
