/* debug-reserva-rota.css - Estilos exclusivos para a página de debug de rotas */

/* Estilos do mapa */
#debugMap {
    width: 100%;
    height: 600px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
}

/* Marcadores customizados */
.debug-marker-origem,
.debug-marker-destino {
    cursor: pointer;
}

.debug-marker-content {
    background: #28a745;
    color: white;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    border: 3px solid white;
    position: relative;
}

.debug-marker-destino .debug-marker-content {
    background: #dc3545;
}

.debug-marker-content i {
    font-size: 16px;
    margin-bottom: -5px;
}

.debug-marker-content span {
    font-size: 14px;
    line-height: 1;
}

/* Pontos GPS */
.debug-gps-point {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.debug-gps-point.na-rota {
    background-color: #28a745;
    border: 2px solid #1e7e34;
}

.debug-gps-point.fora-rota {
    background-color: #dc3545;
    border: 2px solid #bd2130;
    animation: pulse 2s infinite;
}

.debug-gps-point.auxiliar {
    background-color: #6c757d;
    border: 2px solid #495057;
    opacity: 0.6;
}

.debug-gps-point:hover {
    transform: scale(1.5);
    z-index: 1000;
}

/* Setas de direção */
.debug-direction-arrow {
    color: #ffc107;
    font-size: 20px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    transform-origin: center;
}

/* Marcadores de waypoints */
.debug-waypoint-marker {
    cursor: pointer;
}

.waypoint-content {
    background: #6f42c1;
    color: white;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    border: 2px solid white;
    position: relative;
    font-size: 12px;
}

.waypoint-content i {
    font-size: 14px;
    margin-bottom: -3px;
}

.waypoint-content span {
    font-size: 10px;
    line-height: 1;
}

/* Marcadores de início/fim da trajetória */
.debug-trajectory-start,
.debug-trajectory-end {
    font-size: 24px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    cursor: pointer;
}

.debug-trajectory-start {
    color: #28a745;
}

.debug-trajectory-end {
    color: #dc3545;
}

/* Popups customizados */
.debug-popup {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    padding: 10px;
}

.debug-popup h6 {
    margin: 0 0 8px 0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 5px;
}

.debug-popup p {
    margin: 3px 0;
    font-size: 12px;
    color: #666;
}

.debug-popup.gps-popup .info-grid {
    display: grid;
    gap: 5px;
    margin-top: 5px;
}

.debug-popup.gps-popup .info-grid div {
    font-size: 12px;
    color: #555;
}

.debug-popup .status-ok {
    color: #28a745;
    font-weight: 600;
}

.debug-popup .status-fora {
    color: #dc3545;
    font-weight: 600;
}

.debug-popup .endereco {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #e0e0e0;
    font-size: 11px;
    color: #777;
}

/* Legenda do mapa */
.debug-map-legend {
    background: white;
    padding: 10px 15px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    font-size: 12px;
    max-width: 200px;
}

.legend-title {
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 5px;
}

.legend-item {
    display: flex;
    align-items: center;
    margin: 5px 0;
    color: #666;
}

.legend-line {
    width: 30px;
    height: 4px;
    margin-right: 8px;
    border-radius: 2px;
}

.legend-line.route-calculated {
    background-color: #007cbf;
    position: relative;
}

.legend-line.route-calculated::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

.legend-line.route-fallback {
    background-color: #ffa500;
    background-image: repeating-linear-gradient(
        90deg,
        #ffa500,
        #ffa500 6px,
        transparent 6px,
        transparent 12px
    );
}

.legend-line.gps-trajectory {
    background-color: #28a745;
    background-image: repeating-linear-gradient(
        90deg,
        #28a745,
        #28a745 3px,
        transparent 3px,
        transparent 8px
    );
}

.legend-point {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.legend-point.na-rota {
    background-color: #28a745;
    border: 2px solid #1e7e34;
}

.legend-point.fora-rota {
    background-color: #dc3545;
    border: 2px solid #bd2130;
}

.legend-arrow {
    color: #ffc107;
    margin-right: 8px;
    font-size: 16px;
}

.legend-marker {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    margin-right: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 10px;
    font-weight: bold;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.legend-marker.origem {
    background-color: #28a745;
}

.legend-marker.origem::after {
    content: 'A';
}

.legend-marker.destino {
    background-color: #dc3545;
}

.legend-marker.destino::after {
    content: 'B';
}

.legend-waypoint {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    margin-right: 8px;
    background-color: #6f42c1;
    color: white;
    font-size: 10px;
    font-weight: bold;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.legend-waypoint::after {
    content: '1';
}

/* Controle de estilo do mapa */
#debugMapStyleToggle {
    width: 30px;
    height: 30px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Animações */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(220, 53, 69, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0);
    }
}

/* Cards de estatísticas */
.card.bg-primary,
.card.bg-info,
.card.bg-success,
.card.bg-secondary {
    border: none;
}

.card-header h5 {
    display: flex;
    align-items: center;
    margin: 0;
}

.card-header h5 i {
    margin-right: 8px;
}

/* Tabela de pontos GPS */
.table-responsive {
    max-height: 500px;
    overflow-y: auto;
}

.table-responsive::-webkit-scrollbar {
    width: 8px;
}

.table-responsive::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Linhas da tabela GPS com transições */
.gps-row {
    transition: background-color 0.3s ease;
}

.gps-row .status-cell {
    transition: all 0.3s ease;
}

.gps-row .badge {
    transition: all 0.3s ease;
}

/* Indicadores de análise dinâmica */
.status-auxiliar {
    color: #6c757d;
    font-style: italic;
}

/* Estatísticas dinâmicas */
#pontosNaRota, #pontosForaRota {
    transition: color 0.3s ease, transform 0.3s ease;
}

#pontosNaRota:not([data-original]) {
    animation: highlight-success 1s ease-in-out;
}

#pontosForaRota:not([data-original]) {
    animation: highlight-danger 1s ease-in-out;
}

@keyframes highlight-success {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); color: #198754; }
    100% { transform: scale(1); }
}

@keyframes highlight-danger {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); color: #dc3545; }
    100% { transform: scale(1); }
}

/* Responsividade */
@media (max-width: 768px) {
    #debugMap {
        height: 400px;
    }
    
    .debug-map-legend {
        font-size: 11px;
        max-width: 150px;
        padding: 8px 12px;
    }
    
    .legend-line {
        width: 20px;
    }
    
    .card-body h6 {
        font-size: 14px;
    }
    
    .table {
        font-size: 12px;
    }
}

/* Tema escuro - compatibilidade */
@media (prefers-color-scheme: dark) {
    .debug-map-legend {
        background: #2d3748;
        color: #e2e8f0;
    }
    
    .legend-title {
        color: #e2e8f0;
        border-bottom-color: #4a5568;
    }
    
    .legend-item {
        color: #cbd5e0;
    }
    
    .debug-popup {
        background: #2d3748;
        color: #e2e8f0;
    }
    
    .debug-popup h6 {
        color: #e2e8f0;
        border-bottom-color: #4a5568;
    }
    
    .debug-popup p {
        color: #cbd5e0;
    }
    
    .debug-popup .info-grid div {
        color: #cbd5e0;
    }
}

/* Loading overlay */
.debug-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    border-radius: 8px;
}

.debug-loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #007cbf;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}