/* ============================================
   CLD Module - Estilos específicos
   Versión: 6.6.3 - Final sin duplicados
   ============================================ */

:root {
    --cld-primary: #4361ee;
    --cld-primary-dark: #3a56d4;
    --cld-primary-light: #eef2ff;
    --cld-secondary: #f8f9fa;
    --cld-success: #06d6a0;
    --cld-warning: #ffb703;
    --cld-danger: #ef476f;
    --cld-info: #118ab2;
    --cld-text-primary: #2b2d42;
    --cld-text-secondary: #6c757d;
    --cld-border: #e9ecef;
}

/* ============================================
   HEADER
   ============================================ */
.content-header.bg-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
}

.content-header.bg-gradient::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQ0MCIgaGVpZ2h0PSI0MDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IHgxPSIwJSIgeTE9IjAlIiB4Mj0iMTAwJSIgeTI9IjEwMCUiIGlkPSJhIj48c3RvcCBzdG9wLWNvbG9yPSIjRkZGIiBzdG9wLW9wYWNpdHk9Ii4wNSIgb2Zmc2V0PSIwJSIvPjxzdG9wIHN0b3AtY29sb3I9IiNGRkYiIHN0b3Atb3BhY2l0eT0iMCIgb2Zmc2V0PSIxMDAlIi8+PC9saW5lYXJHcmFkaWVudD48L2RlZnM+PHBhdGggZD0iTTAgMGgxNDQwdjQwMEgweiIgZmlsbD0idXJsKCNhKSIgZmlsbC1ydWxlPSJldmVub2RkIi8+PC9zdmc+');
    background-size: cover;
    opacity: 0.1;
    pointer-events: none;
}

.breadcrumb .text-white-50 {
    color: rgba(255, 255, 255, 0.7) !important;
    transition: all 0.2s ease;
}

.breadcrumb .text-white-50:hover {
    color: white !important;
}

/* ============================================
   STATS CARDS
   ============================================ */
.small-box {
    border-radius: 12px;
    box-shadow: var(--cld-shadow-md, 0 4px 6px rgba(0, 0, 0, 0.05));
    transition: all 0.2s ease;
    border: none;
    overflow: hidden;
    position: relative;
}

.small-box:hover {
    transform: translateY(-2px);
    box-shadow: var(--cld-shadow-lg, 0 10px 15px rgba(0, 0, 0, 0.05));
}

.small-box .icon {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 4rem;
    color: rgba(255, 255, 255, 0.2);
    transition: all 0.2s ease;
}

.small-box:hover .icon {
    transform: scale(1.1) rotate(5deg);
    color: rgba(255, 255, 255, 0.3);
}

/* ============================================
   TABLA CLD
   ============================================ */
#tblCld {
    border-collapse: separate;
    border-spacing: 0 8px;
    margin-top: -8px;
}

#tblCld thead th {
    background: var(--cld-primary);
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 16px;
    border: none;
}

#tblCld tbody tr {
    background: white;
    border-radius: 12px;
    box-shadow: var(--cld-shadow-sm, 0 2px 4px rgba(0, 0, 0, 0.02));
    transition: all 0.2s ease;
}

.station-name {
    font-weight: 600;
    color: var(--cld-text-primary);
    font-size: 1rem;
}

.station-address {
    color: var(--cld-text-secondary);
    font-size: 0.9rem;
    line-height: 1.4;
}

/* ============================================
   BOTONES
   ============================================ */
.btn-map {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #06d6a0, #0496c0);
    color: white;
    transition: all 0.2s ease;
}

.btn-map:hover {
    transform: scale(1.1) rotate(10deg);
    color: white;
    box-shadow: 0 6px 12px rgba(6, 214, 160, 0.3);
}

/* ============================================
   TABS
   ============================================ */
.nav-link#edit-tab.active {
    display: block !important;
    background-color: #007bff;
    color: white;
}

.tab-pane#edit.active {
    display: block !important;
    opacity: 1;
    visibility: visible;
}

/* ============================================
   BADGES Y TABLA DE ACTIVIDADES
   ============================================ */
.badge-pill .fa-globe-americas {
    font-size: 0.7rem;
}

#tblAct tbody tr {
    transition: background-color 0.2s ease;
}

#tblAct tbody tr:hover {
    background-color: rgba(0, 123, 255, 0.05);
}

/* ============================================
   MODALES
   ============================================ */
.modal.fade .modal-dialog {
    transition: transform 0.3s ease-out;
}

.modal-fullscreen {
    width: 100vw;
    max-width: none;
    height: 100vh;
    margin: 0;
}

.modal-fullscreen .modal-content {
    height: 100vh;
    border: 0;
    border-radius: 0;
}

#modalMapaGeneral .modal-xl {
    max-width: 95%;
}

/* ============================================
   MAPA LEAFLET
   ============================================ */
#mapa-puntos {
    border-radius: 0 0 4px 4px;
}

/* ============================================
   MARCADORES DE ESTACIONES
   ============================================ */
.custom-estacion-icon {
    background: transparent;
    border: none;
    transition: transform 0.3s ease;
}

.custom-estacion-icon i {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease;
}

.custom-estacion-icon:hover {
    transform: scale(1.2);
    z-index: 1000 !important;
}

.custom-estacion-icon:hover i {
    transform: scale(1.3);
}

/* ============================================
   POPUPS DE LEAFLET - VERSIÓN MEJORADA
   ============================================ */
.leaflet-popup {
    filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.25));
    pointer-events: auto !important;
}

.leaflet-popup-content-wrapper {
    border-radius: 16px;
    overflow: hidden;
    background: transparent;
    box-shadow: none;
    padding: 0;
}

.leaflet-popup-content {
    margin: 0;
    padding: 0;
    min-width: 280px;
    max-width: 360px;
    pointer-events: auto !important;
}

.custom-popup .leaflet-popup-content-wrapper {
    border-radius: 12px;
    box-shadow:
        0 12px 28px rgba(0, 0, 0, 0.3),
        0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 0;
    overflow: hidden;
}

.custom-popup .leaflet-popup-content {
    margin: 0;
    padding: 0;
    pointer-events: auto !important;
}

.custom-popup .leaflet-popup-tip {
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

/* CONTENEDOR DEL POPUP MEJORADO */
.popup-container {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

/* HEADER DEL POPUP */
.popup-header {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    padding: 14px 18px;
    margin: 0;
}

.popup-header h6 {
    margin: 0;
    font-weight: 600;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.popup-header h6 i {
    font-size: 16px;
}

/* BODY DEL POPUP */
.popup-body {
    padding: 14px 18px;
    background: white;
}

.popup-info-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.popup-info-row:last-child {
    border-bottom: none;
}

.popup-info-icon {
    width: 24px;
    color: #6c757d;
    font-size: 14px;
    text-align: center;
    flex-shrink: 0;
}

.popup-info-text {
    flex: 1;
    font-size: 13px;
    line-height: 1.5;
    color: #2c3e50;
}

.popup-info-text strong {
    color: #007bff;
    font-weight: 600;
}

/* BADGES */
.popup-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.popup-badge-success {
    background: #d4edda;
    color: #155724;
}

.popup-badge-secondary {
    background: #e9ecef;
    color: #495057;
}

/* FOOTER DEL POPUP */
.popup-footer {
    background: #f8f9fa;
    padding: 12px 18px;
    border-top: 1px solid #e9ecef;
}

.popup-coords {
    font-size: 11px;
    color: #6c757d;
    margin-bottom: 10px;
    font-family: monospace;
    text-align: center;
}

.popup-buttons {
    display: flex;
    gap: 10px;
}

/* Botones del popup - texto blanco y negrita */
.popup-btn {
    flex: 1;
    padding: 6px 0;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700 !important;
    text-align: center;
    text-decoration: none;
    transition: all 0.2s ease;
    color: white !important;
    pointer-events: auto !important;
    cursor: pointer !important;
}

.popup-btn-google {
    background: #ea4335;
    color: white !important;
}

.popup-btn-google:hover {
    background: #c5221f;
    color: white !important;
    text-decoration: none;
    transform: translateY(-1px);
}

.popup-btn-osm {
    background: #7ab51d;
    color: white !important;
}

.popup-btn-osm:hover {
    background: #5a8f12;
    color: white !important;
    text-decoration: none;
    transform: translateY(-1px);
}

/* ============================================
   CONTADORES DEL MAPA - ESTILOS MEJORADOS
   ============================================ */
.mapa-contador-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    margin-left: 8px;
}

.mapa-contador-badge-success {
    background: #28a745;
    color: white;
}

.mapa-contador-badge-primary {
    background: #007bff;
    color: white;
}

.mapa-contador-badge i {
    font-size: 11px;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .modal-fullscreen {
        max-width: 100vw !important;
        margin: 0 !important;
    }

    .modal-fullscreen .modal-content {
        height: 100vh !important;
    }

    .custom-popup .leaflet-popup-content {
        min-width: 250px !important;
    }
}
