/* --- 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;
}

/* Bottom Sheet */
.bottom-sheet {
    position: absolute;
    bottom: -100%;
    left: 50%;
    transform: translateX(-50%);
    width: min(400px, 95%);
    background: #111827; /* Darker Slate/Black */
    border-radius: 28px 28px 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 -10px 50px rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.05);
}

/* 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: 24px;
    max-height: 80vh;
    overflow-y: auto;
}

.bs-vehicle-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.bs-vehicle-info {
    flex: 1;
}

.bs-vehicle-title {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-start;
}

.bs-title-info h3 {
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0;
    color: #fff;
}

.bs-title-info p {
    font-size: 0.9rem;
    opacity: 0.5;
    margin: 4px 0 0;
}

.bs-vehicle-img {
    width: 140px;
    height: 140px;
    background: #fff;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

.bs-vehicle-img img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.bs-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    background: rgba(255, 255, 255, 0.03);
    padding: 10px;
    border-radius: 12px;
    margin-bottom: 15px;
}

.bs-stat-item {
    background: rgba(255,255,255,0.03);
    padding: 12px;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    border: 1px solid rgba(255,255,255,0.05);
}

.bs-stat-val { font-size: 1.1rem; font-weight: 800; color: #fff; }
.bs-stat-label { font-size: 0.7rem; opacity: 0.4; text-transform: uppercase; font-weight: 700; letter-spacing: 0.5px; }

.bs-info-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 24px;
    background: rgba(255,255,255,0.02);
    padding: 16px;
    border-radius: 16px;
}

.bs-info-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    color: rgba(255,255,255,0.8);
}

.bs-info-item i { 
    width: 24px; 
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6366f1; 
    background: rgba(99, 102, 241, 0.1);
    border-radius: 6px;
    font-size: 0.8rem;
}

.bs-actions {
    display: flex;
    gap: 12px;
    margin-top: 10px;
}

.bs-btn {
    flex: 1;
    height: 52px;
    border-radius: 14px;
    border: none;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.95rem;
}

.bs-btn.command { 
    background: #10b981; 
    color: white; 
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.2);
}

.bs-btn.utility { 
    background: transparent !important; 
    color: #fff !important; 
    width: 44px; 
    height: 44px;
    flex: none; 
    border: none !important;
    font-size: 1.5rem;
    padding: 0;
    box-shadow: none !important;
    transition: transform 0.2s, color 0.2s;
}

.bs-btn.utility:hover {
    color: #818cf8 !important;
    transform: scale(1.15);
}

.bs-btn:hover { 
    transform: translateY(-3px); 
    filter: brightness(1.1); 
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

/* Floating controls right side - REMOVIDO conforme solicitado Adilson */
.floating-controls {
    display: none;
}

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

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

/* --- Animação de Pulsação para ACC Ligado Adilson --- */
@keyframes pulse-acc-green {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.pulse-acc-on {
    background: #10b981 !important;
    color: white !important;
    animation: pulse-acc-green 2s infinite !important;
    border-color: #059669 !important;
}

/* --- Container de Foto do Veículo Premium Adilson --- */
.bs-photo-upload-wrapper {
    position: relative;
    width: 140px;
    height: 140px;
    background: #2d3748;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid rgba(255,255,255,0.1);
    transition: all 0.3s;
}

.bs-photo-upload-wrapper:hover {
    border-color: #3b82f6;
    transform: scale(1.05);
}

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

.bs-photo-upload-wrapper i.fa-camera {
    font-size: 1.5rem;
    color: rgba(255,255,255,0.5);
}

.bs-photo-upload-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.bs-photo-upload-wrapper:hover .bs-photo-upload-overlay {
    opacity: 1;
}

.bs-photo-upload-overlay i {
    color: white;
    font-size: 1.2rem;
}

/* Novo botão de upload abaixo da foto Adilson */
.bs-photo-admin-btn {
    margin-top: 10px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #60a5fa !important;
    font-size: 11px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    width: 100%;
    justify-content: center;
}

.bs-photo-admin-btn:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: #3b82f6;
    color: #fff !important;
}

/* --- Animações Pulsantes Adilson --- */
@keyframes pulse-orange {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7); }
    70% { transform: scale(1.1); 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); }
}

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

.bs-pulse-anchor i {
    color: #f59e0b !important;
    animation: pulse-orange 2s infinite;
}

.bs-badge-blocked-pulse {
    background: #ef4444 !important;
    color: white !important;
    font-weight: 900;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    letter-spacing: 1px;
    animation: pulse-red 1s infinite;
    display: inline-block;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.5);
}
