/* ============================================================
   ESTILOS OPERATIVO SOL - MAPA INTERACTIVO (AdminLTE 3 + Leaflet)
   ============================================================ */

/* General & Layout */
/* General & Layout Light Mode */
body {
    background-color: #f4f6f9 !important;
    color: #1e293b;
    font-family: 'Source Sans Pro', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.map-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
    margin-bottom: 20px;
    background: #ffffff;
}

.map-card .card-body {
    padding: 0;
    position: relative;
}

#map {
    width: 100%;
    height: 720px;
    background: #e2e8f0;
    z-index: 1;
}

/* Panel Flotante de Filtros (Glassmorphism Light) */
.filter-panel {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 1000;
    width: 320px;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 10px;
    padding: 16px 20px;
    color: #0f172a;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    transition: all 0.3s ease;
}

.filter-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 10px;
    margin-bottom: 12px;
}

.filter-panel-header h5 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #0284c7;
}

.filter-section-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #64748b;
    margin-top: 10px;
    margin-bottom: 6px;
    font-weight: 600;
}

/* Custom Switches & Checkboxes */
.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.custom-control-label {
    cursor: pointer;
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    gap: 6px;
    user-select: none;
    color: #334155;
}

/* Badges de Colores por Turno - Modo Claro */
.badge-turno-manana {
    background-color: #fef3c7;
    color: #b45309;
    border: 1px solid #fde68a;
    font-weight: 600;
}

.badge-turno-tarde {
    background-color: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
    font-weight: 600;
}

.badge-turno-noche {
    background-color: #e0e7ff;
    color: #4338ca;
    border: 1px solid #c7d2fe;
    font-weight: 600;
}

.badge-alojamiento {
    background-color: #f3e8ff;
    color: #7e22ce;
    border: 1px solid #d8b4fe;
    font-weight: 600;
}

/* Personalización de Popups de Leaflet - Textos en Negro de Máxima Legibilidad */
.leaflet-popup-content-wrapper {
    background: #ffffff !important;
    color: #000000 !important;
    border-radius: 10px !important;
    border: 1px solid #94a3b8 !important;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25) !important;
    padding: 0 !important;
}

.leaflet-popup-tip {
    background: #ffffff !important;
}

.leaflet-popup-content {
    margin: 0 !important;
    width: 320px !important;
    color: #000000 !important;
}

.popup-header {
    padding: 12px 16px;
    border-top-left-radius: 9px;
    border-top-right-radius: 9px;
    background: #f1f5f9;
    border-bottom: 1px solid #cbd5e1;
}

.popup-header h6 {
    margin: 0;
    font-size: 0.98rem;
    font-weight: 800;
    color: #000000 !important;
    line-height: 1.3;
}

.popup-body {
    padding: 14px 16px;
    max-height: 320px;
    overflow-y: auto;
    font-size: 0.88rem;
    color: #000000 !important;
}

.popup-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    color: #000000 !important;
}

.popup-section {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px dashed #cbd5e1;
}

.popup-section-title {
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    color: #000000 !important;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.personal-list {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.personal-list li {
    padding: 6px 10px;
    margin-bottom: 5px;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #000000 !important;
    font-weight: 600;
}

.residente-card {
    background: #f3e8ff;
    border: 1px solid #d8b4fe;
    border-left: 4px solid #9333ea;
    padding: 8px 10px;
    border-radius: 6px;
    margin-bottom: 6px;
}

.residente-name {
    font-weight: 700;
    color: #3b0764 !important;
}

.residente-cohabitants {
    font-size: 0.8rem;
    color: #000000 !important;
    font-weight: 500;
    margin-top: 2px;
}

/* Custom Marker Styles */
.custom-pin {
    width: 32px;
    height: 32px;
    border-radius: 50% 50% 50% 0;
    position: absolute;
    transform: rotate(-45deg);
    left: 50%;
    top: 50%;
    margin: -20px 0 0 -16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease, filter 0.25s ease;
    cursor: pointer;
}

.custom-pin:hover,
.custom-pin.pin-highlight {
    transform: rotate(-45deg) scale(1.25);
    box-shadow: 0 0 20px var(--pin-color, #0284c7), 0 0 35px var(--pin-color, #0284c7) !important;
    z-index: 1000 !important;
}

.custom-pin.dynamic-pin {
    border: 2px solid #ffffff;
}

/* Animación de Pulso Lumínico para Pines Dinámicos */
@keyframes pulseGlow {
    0% {
        box-shadow: 0 0 6px var(--pin-glow-color, rgba(2, 132, 199, 0.6));
    }
    50% {
        box-shadow: 0 0 18px var(--pin-glow-color, rgba(2, 132, 199, 0.95)), 0 0 28px var(--pin-glow-color, rgba(2, 132, 199, 0.5));
    }
    100% {
        box-shadow: 0 0 6px var(--pin-glow-color, rgba(2, 132, 199, 0.6));
    }
}

.custom-pin-glow {
    animation: pulseGlow 2.5s infinite ease-in-out;
}

.custom-pin-glow:hover,
.custom-pin-glow.pin-highlight {
    animation: none;
    box-shadow: 0 0 25px var(--pin-color, #0284c7), 0 0 45px var(--pin-color, #0284c7), 0 0 65px var(--pin-color, #0284c7) !important;
    transform: rotate(-45deg) scale(1.35) !important;
}

.custom-pin i {
    transform: rotate(45deg);
    color: #ffffff;
    font-size: 14px;
}

/* Indicadores de Estadísticas de Encabezado */
.info-box-custom {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border-radius: 10px;
    transition: transform 0.2s ease;
}

.info-box-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

/* ============================================================
   ESTILOS LISTADOR DE CADETES - ADMINLTE 3 & POPOVER DIRECCIÓN
   ============================================================ */

/* Celda Dirección e Indicador de Hover */
.cell-direccion-hover {
    cursor: pointer;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.cell-direccion-hover:hover {
    background-color: #e0f2fe !important;
}

.hover-indicator {
    opacity: 0.85;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.cell-direccion-hover:hover .hover-indicator {
    opacity: 1;
    transform: scale(1.05);
}

/* Popover Flotante de Dirección y Coordenadas */
.address-hover-popover {
    position: absolute;
    z-index: 9999;
    width: 340px;
    background: #ffffff;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.2);
    pointer-events: auto;
}

@keyframes popoverFadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.popover-fade-in {
    animation: popoverFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.popover-mini-map {
    background: #e2e8f0;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Custom Table Enhancements */
#cadetes-table thead th {
    vertical-align: middle;
    font-weight: 700;
    letter-spacing: 0.2px;
}

#cadetes-table tbody tr {
    transition: background-color 0.15s ease;
}

#cadetes-table tbody tr:hover {
    background-color: #f1f5f9 !important;
}

.badge-orden-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #1e293b;
}

.badge-orden-icon i {
    font-size: 0.9rem;
}

/* Pin Personalizado para Cadete PBA */
.custom-pin.cadete-pin {
    border: 2px solid #ffffff;
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.4);
}

/* Popup de Edición de Coordenadas X Y */
.cadete-popup-wrapper .popup-header {
    background: #1e293b !important;
}

.cadete-popup-wrapper input[type="number"] {
    font-family: monospace;
    font-weight: 700;
    color: #0f172a;
}

