/**
 * RUT.CSS - Estilos específicos para Módulo de Rutas
 * ISO 25010: Usability
 * Fluent Design + Material Design Fusion
 *
 * @author Chief Enterprise Architect
 * @version 1.1.0 - Estilos para Leaflet y UI Mejorada
 */

/* ============================================
   MAPA Y RUTAS (Leaflet)
   ============================================ */

#mapa_ruta {
    width: 100%;
    height: 450px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
    transition: box-shadow 0.3s ease;
    border: 1px solid #e9ecef;
}

#mapa_ruta:hover {
    box-shadow: 0 8px 30px rgba(0, 123, 255, 0.15);
}

.leaflet-container {
    border-radius: 12px;
    font-family: 'Roboto', 'Source Sans Pro', sans-serif;
}

/* Marcadores personalizados */
.custom-marker {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    font-weight: bold;
    font-size: 14px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    border: 2px solid white;
    transition: transform 0.2s ease;
    cursor: pointer;
}

.custom-marker:hover {
    transform: scale(1.15);
    z-index: 1000 !important;
}

/* Popup personalizado */
.leaflet-popup-content-wrapper {
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 0;
    overflow: hidden;
}

.leaflet-popup-content {
    margin: 0;
    min-width: 260px;
}

.popup-content {
    padding: 0;
}

.popup-header {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    padding: 10px 15px;
    font-weight: 600;
    font-size: 14px;
}

.popup-row {
    display: flex;
    padding: 8px 15px;
    border-bottom: 1px solid #f1f3f5;
    font-size: 13px;
}

.popup-row:last-child {
    border-bottom: none;
}

.popup-label {
    font-weight: 600;
    width: 85px;
    color: #495057;
}

.popup-value {
    flex: 1;
    color: #2b2d42;
}

/* Línea de ruta animada */
.route-polyline {
    stroke-dasharray: 10, 10;
    animation: dash 30s linear infinite;
}

@keyframes dash {
    to {
        stroke-dashoffset: -200;
    }
}

/* ============================================
   TABLA DE PUNTOS (Diseño de Tarjetas)
   ============================================*/

#tabla_puntos {
    border-collapse: separate;
    border-spacing: 0 8px;
    margin-top: -8px;
}

#tabla_puntos thead th {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border: none;
    padding: 12px;
    font-weight: 600;
    color: #495057;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #dee2e6;
}

#tabla_puntos tbody tr {
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    border-radius: 10px;
    transition: all 0.2s ease;
    border: 1px solid #f1f3f5;
}

#tabla_puntos tbody tr:hover {
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.1);
    transform: translateY(-2px);
    border-color: #cce5ff;
}

#tabla_puntos tbody td {
    padding: 14px 12px;
    border: none;
    vertical-align: middle;
    background-color: white;
}

#tabla_puntos tbody td:first-child {
    border-top-left-radius: 10px;
    border-bottom-left-radius: 10px;
}

#tabla_puntos tbody td:last-child {
    border-top-right-radius: 10px;
    border-bottom-right-radius: 10px;
}

/* ============================================
   FORMULARIO DE PUNTOS (Modal)
   ============================================*/

.punto-form .form-group {
    margin-bottom: 1.2rem;
}

.punto-form label {
    font-weight: 500;
    color: #2b2d42;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 6px;
}

.punto-form .form-control:not([readonly]) {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.punto-form .form-control:not([readonly]):focus {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.punto-form .form-control[readonly] {
    background-color: #f8f9fa;
    border: 1px dashed #ced4da;
    cursor: default;
    color: #6c757d;
}

/* ============================================
   INFO-BOX PARA RESULTADOS (Optimización)
   ============================================*/

.info-box {
    min-height: 90px;
    border-radius: 12px;
    margin-bottom: 15px;
    border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
    transition: transform 0.2s ease;
}

.info-box:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}

.info-box.bg-info { background: linear-gradient(135deg, #17a2b8, #138496); }
.info-box.bg-success { background: linear-gradient(135deg, #28a745, #1e7e34); }
.info-box.bg-warning { background: linear-gradient(135deg, #ffc107, #d39e00); }
.info-box.bg-primary { background: linear-gradient(135deg, #007bff, #0056b3); }

.info-box .info-box-icon {
    border-radius: 12px 0 0 12px;
    width: 80px;
    background: rgba(255,255,255,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
}

.info-box .info-box-content {
    padding: 12px 15px;
}

.info-box .info-box-text {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255,255,255,0.85);
}

.info-box .info-box-number {
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1.2;
    color: white;
}

.info-box .info-box-unit {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.75);
    margin-left: 5px;
}

/* ============================================
   DARK MODE SOPORTE (Automático)
   ============================================*/

@media (prefers-color-scheme: dark) {
    #mapa_ruta {
        border-color: #495057;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    }

    #tabla_puntos thead th {
        background: linear-gradient(135deg, #2b2d42, #1e1f2c);
        color: #e9ecef;
        border-bottom-color: #495057;
    }

    #tabla_puntos tbody tr {
        background: #2b2d42;
        border-color: #495057;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    }

    #tabla_puntos tbody td {
        background-color: #2b2d42;
        color: #f8f9fa;
    }

    .popup-row {
        border-bottom-color: #495057;
    }
    .popup-label { color: #adb5bd; }
    .popup-value { color: #f8f9fa; }

    .punto-form .form-control[readonly] {
        background-color: #343a40;
        border-color: #495057;
        color: #ced4da;
    }
}