/**
 * Estilos para o Roteirizador de Entregas
 * 
 * @author Frete API
 * @version 1.0.0
 */

/* Ajustes gerais do modal */
#modalRoteirizador .modal-dialog {
    max-width: 90%;
    margin: 1.75rem auto;
}

#modalRoteirizador .modal-content {
    border-radius: 8px;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

#modalRoteirizador .modal-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding: 1rem 1.5rem;
}

#modalRoteirizador .modal-body {
    padding: 1.5rem;
}

#modalRoteirizador .modal-footer {
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    padding: 1rem 1.5rem;
}

/* Estilos do mapa */
#mapa-rota {
    height: 450px;
    border-radius: 8px;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Estilos das informações estratégicas */
.info-section {
    padding: 1.25rem;
    height: 100%;
    transition: all 0.3s ease;
}

.info-section:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.section-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding-bottom: 0.5rem;
}

/* Estilos da tabela de informações estratégicas */
#tabela-rota {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    border: none;
    font-size: 0.875rem;
}

#tabela-rota thead th {
    background-color: #f8f9fa;
    border-top: none;
    border-bottom: 1px solid #e9ecef;
    color: #495057;
    font-weight: 600;
    padding: 0.75rem;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

#tabela-rota tbody tr {
    background-color: #ffffff;
    transition: all 0.2s ease;
}

#tabela-rota tbody tr:nth-child(odd) {
    background-color: #fbfbfd;
}

#tabela-rota tbody tr:hover {
    background-color: #f8f9fa;
}

#tabela-rota td {
    padding: 0.6rem 0.75rem;
    border-top: none;
    border-bottom: 1px solid #f0f0f0;
    color: #333;
    vertical-align: middle;
}

/* Linha de origem na tabela */
#tabela-rota tr:first-child {
    background-color: #f0f7ff !important;
}

#tabela-rota tr:first-child td {
    border-top: none;
    border-bottom: 1px solid #e1ecf7;
    font-weight: 500;
    color: #0d6efd;
}

/* Formatação especial para células específicas */
#tabela-rota td:nth-child(8) {  /* Coluna de Distância Total */
    font-weight: 500;
    color: #0d6efd;
    text-align: right;
}

#tabela-rota td:nth-child(9) {  /* Coluna de Peso */
    text-align: right;
}

#tabela-rota td:nth-child(10) span {  /* Coluna de QTDs */
    cursor: help;
    border-bottom: 1px dotted #ccc;
    position: relative;
    display: inline-block;
}

/* Estilos para tooltip personalizado */
[title] {
    position: relative;
}

[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 0;
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    max-width: 250px;
    text-overflow: ellipsis;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Ajusta a posição do tooltip para abrir para a esquerda na coluna QTDs */
#tabela-rota td:nth-child(10) [title]:hover::after {
    left: auto;
    right: 0;
    transform: translateX(-50%);
}

/* Versão ainda mais à esquerda para garantir visibilidade */
#tabela-rota tr td:last-child [title]:hover::after {
    right: 0;
    left: auto;
    transform: translateX(-50%);
}

/* Estilos da lista de pedidos */
#lista-pedidos-rota {
    max-height: 350px;
    overflow-y: auto;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
}

#lista-pedidos-rota .list-group-item {
    border-left: 0;
    border-right: 0;
    border-radius: 0;
    transition: all 0.2s ease;
}

#lista-pedidos-rota .list-group-item:first-child {
    border-top: 0;
}

#lista-pedidos-rota .list-group-item:last-child {
    border-bottom: 0;
}

#lista-pedidos-rota .list-group-item:hover {
    background-color: rgba(0, 123, 255, 0.05);
}

.cursor-move {
    cursor: move;
}

/* Loading overlay */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-content {
    background-color: white;
    margin-top: -500px;
    padding: 2rem;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.loading-message {
    margin-top: 1rem;
    font-weight: 500;
}

/* Estilos para impressão */
@media print {
    body * {
        visibility: hidden;
    }
    
    #modalRoteirizador,
    #modalRoteirizador * {
        visibility: visible;
    }
    
    #modalRoteirizador {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        overflow: visible;
    }
    
    .no-print {
        display: none !important;
    }
    
    #mapa-rota {
        page-break-after: always;
        height: 500px;
    }
    
    .card {
        break-inside: avoid;
    }
}

/* Responsividade */
@media (max-width: 767.98px) {
    #modalRoteirizador .modal-dialog {
        max-width: 95%;
        margin: 0.5rem auto;
    }
    
    #modalRoteirizador .modal-body {
        padding: 1rem;
    }
    
    #mapa-rota {
        height: 300px;
    }
    
    .info-section {
        margin-bottom: 1rem;
    }
} 