/* =========================================
   1. BASE Y CONTENEDOR DEL MAPA
   ========================================= */
body, html { 
    margin: 0; 
    padding: 0; 
    height: 100%; 
    font-family: Arial, sans-serif; 
    overflow: hidden; 
}

#map { 
    position: absolute; 
    top: 0; 
    bottom: 0; 
    width: 100%; 
    z-index: 1; 
}

/* =========================================
   2. PANEL LATERAL (SIDEBAR) Y BOTONES
   ========================================= */
.toggle-btn {
    position: absolute; top: 20px; left: 20px; z-index: 2;
    padding: 10px 15px; background: white; border: 1px solid #ccc;
    border-radius: 4px; cursor: pointer; font-weight: bold;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.sidebar {
    position: absolute; top: 0; left: 0; 
    width: 320px; height: 100vh; 
    background-color: white; z-index: 3;
    padding: 20px; box-sizing: border-box;
    box-shadow: 2px 0 6px rgba(0,0,0,0.3);
    transition: transform 0.3s ease-in-out; 
    overflow-y: auto;
}

.sidebar.collapsed { transform: translateX(-105%); }

.close-btn {
    float: right; background: none; border: none;
    font-size: 16px; cursor: pointer; color: #666;
}

#isologo { max-width: 100%; height: auto; margin-top: 10px; margin-bottom: 20px; }

/* =========================================
   3. CONTROLES INTERNOS DEL PANEL
   ========================================= */
.control-group { margin-bottom: 25px; padding-bottom: 15px; border-bottom: 1px solid #eee; }
.control-group h3 { font-size: 14px; color: #333; margin-bottom: 10px; }
select, label { width: 100%; font-size: 14px; color: #555; }

/* =========================================
   4. CONTROL FLOTANTE (MAPA BASE)
   ========================================= */
.map-overlay {
    position: absolute;
    top: 20px;
    right: 58px;
    background: rgba(255, 255, 255, 0.9);
    padding: 10px;
    border-radius: 4px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
    z-index: 2; 
    font-family: Arial, sans-serif;
}

.map-overlay select {
    margin-top: 5px;
    width: 100%;
}


/* =========================================
   6. ÁRBOL DE CAPAS (ACORDEÓN Y METADATOS)
   ========================================= */
details {
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fafafa;
}

summary {
    padding: 10px;
    font-weight: bold;
    cursor: pointer;
    background-color: #f0f0f0;
    border-radius: 4px;
    list-style: none; 
}

.btn-meta {
    text-decoration: none;
    font-size: 14px;
    margin-left: 5px;
    cursor: help;
}

/* =========================================
   7. MODAL DE SERVICIOS WMS
   ========================================= */
.modal-oculto {
    display: none; /* Flex cuando esté activo */
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 10;
    align-items: center;
    justify-content: center;
    font-family: Arial, sans-serif;
}

.modal-contenido {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
}

.modal-header h3 {
    margin: 0;
    font-size: 16px;
    color: #333;
}

/* =========================================
   ESTILOS PARA HERRAMIENTAS DE EXPORTACIÓN PNG Y ETIQUETAS
   ========================================= */

/* Modal de Exportación */
.modal-industrial {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #ffffff;
    border: 1px solid #6c757d;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    padding: 15px;
    z-index: 9999;
    width: 300px;
    font-family: Arial, sans-serif;
    display: none; /* Oculto por defecto */
}

.modal-industrial h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #333;
    border-bottom: 1px solid #ccc;
    padding-bottom: 5px;
}

.modal-industrial label {
    font-size: 12px;
    font-weight: bold;
    color: #555;
    display: block;
    margin-top: 10px;
}

.modal-industrial input, 
.modal-industrial textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 6px;
    margin-top: 4px;
    border: 1px solid #ccc;
    border-radius: 2px;
    font-size: 12px;
}

.modal-industrial textarea {
    resize: vertical;
    min-height: 50px;
}

.modal-industrial .btn-group {
    margin-top: 15px;
    text-align: right;
}

.modal-industrial button {
    padding: 6px 12px;
    border: 1px solid #ccc;
    background: #f8f9fa;
    cursor: pointer;
    font-size: 12px;
    margin-left: 5px;
}

.modal-industrial button.btn-primary {
    background: #0d6efd;
    color: white;
    border-color: #0b5ed7;
}

/* Overlay del Título (Centro Arriba) */
.export-title-overlay {
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #333;
    padding: 8px 20px;
    text-align: center;
    z-index: 1000;
    pointer-events: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    font-size: 18px;
    font-weight: bold;
    color: #000;
}

/* Overlay de Descripción/Leyenda (Izquierda Medio) */
.export-desc-overlay {
    position: absolute;
    top: 50%; 
    left: 15px;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #333;
    padding: 10px 15px;
    text-align: left;
    z-index: 1000;
    pointer-events: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    font-size: 12px;
    color: #333;
    max-width: 250px;
}

.export-overlay h2 {
    margin: 0 0 5px 0;
    font-size: 18px;
    color: #000;
}

.export-overlay p {
    margin: 0;
    font-size: 12px;
    color: #333;
}

/* Marcadores de Texto (Etiquetas en el mapa) */
.etiqueta-marcador {
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid #333;
    padding: 2px 6px;
    font-size: 12px;
    font-weight: bold;
    color: #000;
    pointer-events: none;
    white-space: pre-wrap; /* Respeta los saltos de línea del usuario */
    box-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}