/* =============================================
   ESTILO.CSS - UNIFICADO PARA TODA LA APLICACIÓN
   ============================================= */

/* ====================
   RESET Y BASE
   ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif; /* Fuente base para toda la app */
    margin: 0;
    padding: 0;
    font-size: 24px;
    background-color: #FFDAB9; /* Peach Puff */
}

/* ====================
   TIPOGRAFÍA Y TÍTULOS
   ==================== */
h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 2.5em;
}

h1.titulo {
    /* Estilo específico para listado.html (rojo y más pequeño) */
    text-align: center;
    color: red;
    margin-bottom: 20px;
    font-size: 2em;
}

.titulo {
    text-align: center;
}

.subtitulo {
    text-align: center;
    color: #555;
    margin-bottom: 20px;
    font-size: 1.1em;
}

.obs{
    text-align: center;
    color: #555;
    font-size: 0.5em;

}

/* ====================
   CONTENEDORES PRINCIPALES
   ==================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Estilo específico para mapa_nodo.html */
.container.mapa-nodo {
    width: 95%;
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    height: auto;
}

/* ====================
   BOTONES Y ENLACES
   ==================== */

/* Botón "Ver listado de nodos" en index.html */
.button-container {
    text-align: center;
    margin: 20px 0;
}

#btn-ver-tabla {
    background-color: #007BFF;
    color: white;
    padding: 12px 20px;
    cursor: pointer;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    font-size: 18px;
    transition: background-color 0.3s ease;
    display: inline-block;
}

#btn-ver-tabla:hover {
    background-color: #0056b3;
}

/* Botón "Ver Detalle" en la tabla de listado.html */
.btn-ver {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
    width: 100px;
}

.btn-ver:hover {
    background-color: #2980b9;
}

/* Botón "Ver en mapa individual" (extraído de funciones.js) */
.btn-ver-mapa-individual {
    background-color: #007BFF;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 15px;
    font-weight: bold;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* ====================
   MAPA Y MARCADORES
   ==================== */

/* Contenedor del mapa (index.html y mapa_nodo.html) */
.map-section,
#map-container {
    display: flex;
    justify-content: center;
    
}

#map-container {
    width: 100%;
    max-width: 1000px;
    height: 600px;
}

#map {
    width: 100%;
    height: 600px;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

/* Estilo específico para mapa_nodo.html */
#map-container.mapa-nodo {
    height: 80vh;
    width: 100%;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 0 8px rgba(0,0,0,0.15);
}

#map.mapa-nodo {
    height: 100%;
    width: 100%;
    border-radius: 0;
}

/* Etiqueta de nodo en el mapa */
.nodo-label {
    font-size: 10px;
    font-weight: bold;
    color: #000;
    background-color: #FFD700;
    padding: 1px 3px;
    border-radius: 2px;
    white-space: nowrap;
    text-align: center;
    font-family: 'Courier New', monospace, sans-serif;
    pointer-events: none;
    box-shadow: 0 0 2px rgba(0,0,0,0.2);
    border: 1px solid #CCAA00;
    line-height: 1;
}

/* Icono personalizado para mapa_nodo.html */
.icon-marker-label {
    color: white;
    text-shadow: 1px 1px 2px black, 0 0 5px #000;
    font-size: 24px;
    font-weight: bold;
    line-height: 1;
    text-align: center;
}

/* ====================
   LEYENDA
   ==================== */
.leyenda {
    text-align: center;
    font-size: 16px;
    color: #333;
    margin: 10px 0 30px;
}

/* Estilo específico para leyenda en mapa_nodo.html */
.leyenda.mapa-nodo {
    width: 95%;
    margin: 15px auto;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 5px;
    box-shadow: 0 0 5px rgba(0,0,0,0.1);
    font-size: 0.9em;
    color: #555;
    text-align: center;
}

/* ====================
   TABLAS
   ==================== */

/* Tabla principal en listado.html */
.table-wrapper {
    flex: 1;
    overflow: auto;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: relative;
    max-height: calc(100vh - 200px);
}

.main-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 800px;
}

.main-table thead {
    background-color: #34495e;
    color: white;
    position: sticky;
    top: 0;
    z-index: 10;
}

.main-table thead th {
    padding: 15px 12px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #2c3e50;
    white-space: nowrap;
}

.main-table tbody td {
    padding: 6px;
    border-bottom: 1px solid #ecf0f1;
    white-space: nowrap;
    font-size: 20px;
}

.main-table tbody tr:hover {
    background-color: #f8f9fa;
    transition: background-color 0.3s ease;
}

.main-table tbody tr:nth-child(even) {
    background-color: #fdfdfd;
}

/* Anchos específicos para columnas */
.fecha-col {
    width: 200px;
}

.accion-col {
    width: 120px;
    text-align: center;
}

/* Tabla de detalles en modal */
.detail-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.detail-table thead {
    background-color: #ecf0f1;
    position: sticky;
    top: 0;
    z-index: 10;
}

.detail-table th {
    padding: 12px;
    text-align: left;
    border-bottom: 2px solid #bdc3c7;
}

.detail-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #ecf0f1;
}

.detail-table tr:hover {
    background-color: #f8f9fa;
}

.detail-table tr:nth-child(even) {
    background-color: #fdfdfd;
}

/* Estilo para tabla embebida en modal (index.html y mapa_nodo.html) */
#detalle-contenido table {
    width: 100%;
    font-size: 14px;
    border-collapse: collapse;
}

#detalle-contenido th {
    text-align: center;
    background: #444;
    color: white;
    padding: 8px;
}

#detalle-contenido td {
    padding: 6px;
    border-bottom: 1px solid #ddd;
}



/* ====================
   MODAL 
   ==================== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
    animation: fadeIn 0.3s ease;
}

/* Estilo para listado.html  */
.modal-content {
    background-color: white;
    margin: 5% auto; /* Centrado vertical más cercano al top */
    padding: 0;
    border-radius: 8px;
    width: 90%;
    max-width: 800px;
    position: relative;
    display: flex;
    flex-direction: column;
    animation: slideIn 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 90vh; /* Límite máximo para evitar que salga de la pantalla */
}

.modal-content h2 {
    background-color: #34495e;
    color: white;
    padding: 20px;
    margin: 0;
    border-radius: 8px 8px 0 0;
    font-size: 1.5em;
}

.close-detalle {
    color: white;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    padding: 0 10px;
}

.close-detalle:hover {
    color: #f1c40f;
}

/* Contenedor de la tabla: ocupa el espacio disponible */
.modal-table-container {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    
}

/* Tabla de detalles en modal */
.detail-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.detail-table thead {
    background-color: #ecf0f1;
    position: sticky;
    top: 0;
    z-index: 10;
}

.detail-table th {
    padding: 12px;
    text-align: left;
    border-bottom: 2px solid #bdc3c7;
}

.detail-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #ecf0f1;
}

.detail-table tr:hover {
    background-color: #f8f9fa;
}

.detail-table tr:nth-child(even) {
    background-color: #fdfdfd;
}




/* ====================
   ENLACES 
   ==================== */
.volver-container {
    text-align: center;
    margin-top: 10px;
}

.volver-container img {
    transition: opacity 0.3s ease;
}

.volver-container img:hover {
    opacity: 0.8;
}

/* Estilo específico para mapa_nodo.html */
.volver-container.mapa-nodo img {
    transition: transform 0.2s;
}

.volver-container.mapa-nodo img:hover {
    transform: scale(1.1);
}

/* ====================
   ANIMACIONES
   ==================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ====================
   SCROLL PERSONALIZADO
   ==================== */
.table-wrapper::-webkit-scrollbar,
.modal-table-container::-webkit-scrollbar,
#detalle-contenido::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.table-wrapper::-webkit-scrollbar-track,
.modal-table-container::-webkit-scrollbar-track,
#detalle-contenido::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.table-wrapper::-webkit-scrollbar-thumb,
.modal-table-container::-webkit-scrollbar-thumb,
#detalle-contenido::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.table-wrapper::-webkit-scrollbar-thumb:hover,
.modal-table-container::-webkit-scrollbar-thumb:hover,
#detalle-contenido::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* ====================
   RESPONSIVE
   ==================== */
@media (max-width: 768px) {
    body {
        font-size: 16px; /* Reduce el tamaño base para móviles */
    }

    h1 {
        font-size: 2em;
    }

    h1.titulo {
        font-size: 1.5em;
        margin-bottom: 15px;
    }

    .container > p {
        font-size: 14px;
        margin-bottom: 15px;
    }

    .table-wrapper {
        max-height: calc(100vh - 120px);
    }

    .main-table thead th,
    .main-table tbody td {
        padding: 4px 4px;
        font-size: 14px;
    }

    .main-table tbody td {
        font-size: 12px;
    }

    .main-table thead th {
        font-size: 13px;
    }

    .fecha-col {
        width: 150px;
    }

    .accion-col {
        width: 100px;
    }

    .btn-ver {
        padding: 6px 8px;
        font-size: 12px;
        width: 80px;
    }

    .modal-content {
        width: 95%;
        margin: 10% auto;
    }

    .volver-container {
        margin-top: 8px;
    }

    .volver-container img {
        width: 20%;
        max-width: 80px;
    }

    /* Estilo para mapa_nodo.html en móviles */
    .container.mapa-nodo {
        padding: 10px;
        margin: 10px auto;
    }

    .subtitulo {
        font-size: 1em;
    }

    .leyenda {
        font-size: 14px;
    }

    .leyenda.mapa-nodo {
        font-size: 0.8em;
        padding: 8px;
    }
}
