@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@700&display=swap');
:root {
    --primary-color: #4a7b8c;
    --secondary-color: #ffd000;
    --background-color: #ecf0f1;
    --text-color: #34495e;
    --border-color: #bdc3c7;
    --sidebar-bg-color: #4a7b8c;
    --sidebar-text-color: #ffffff;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--background-color);
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header {
    background-color: var(--primary-color);
    color: white;
    padding: 1rem;
    text-align: center;
}

.main-container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.sidebar {
    width: 250px;
    background-color: var(--sidebar-bg-color);
    color: var(--sidebar-text-color);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease;
}

.content {
    flex: 1;
    padding: 1rem;
    overflow: auto;
    display: flex;
    flex-direction: column;
}

.chart-container, .map-container, .table-container, .scatter-container, .comparison-container {
    flex: 1;
    background-color: white;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: none;
}

.map-container {
    height: 500px;
}

select, input {
    width: 100%;
    padding: 0.5rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    background-color: white;
    color: var(--text-color);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    border: 1px solid var(--border-color);
    padding: 0.75rem;
    text-align: left;
}

th {
    background-color: var(--primary-color);
    color: white;
}


  
  .search-container {
    position: relative;
    display: flex;
    align-items: center;
  }
  


.filter-input {
    display: flex;
    gap: 0.5rem;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-spinner {
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.modal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 90%;
    max-width: 800px;
    border-radius: 8px;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

#aiAnalysisResult {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #333;
}

.view-icons {
    display: flex;
    justify-content: space-around;
    margin-top: 1rem;
}

.view-icon {
    font-size: 1.5rem;
    color: var(--sidebar-text-color);
    cursor: pointer;
    transition: color 0.3s ease;
}

.view-icon:hover, .view-icon.active {
    color: var(--secondary-color);
}

.ai-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    background-color: var(--primary-color);
    color: white;
}
.ai-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: background-color 0.3s, transform 0.3s;
}

.ai-button:hover {
    background-color: var(--secondary-color);
    transform: scale(1.1);
}

.download-button {
    background-color: var(--secondary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 10px;
    transition: background-color 0.3s;
}

.download-button:hover {
    background-color: #ffd000;
}

.theme-toggle {
    background: none;
    border: none;
    color: var(--sidebar-text-color);
    font-size: 0.8rem;
    cursor: pointer;
    margin-bottom: 1rem;
}

.view-data-btn {
    background-color: #4CAF50;
    border: none;
    color: white;
    padding: 5px 10px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 12px;
    margin: 4px 2px;
    cursor: pointer;
    border-radius: 3px;
}

.view-data-btn:hover {
    background-color: #45a049;
}        

/* Estilos para el tema oscuro */
body.dark-theme {
    --background-color: #2c3e50;
    --text-color: #ecf0f1;
    --border-color: #34495e;
    --sidebar-bg-color: #34495e;
    --primary-color: #4a7b8c;
    --secondary-color: #ffd000;
}


.brand-text {
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: bold;
    margin-left: 10px; /* Asegura separación entre el logo y el texto */
}

.documentation-button, .theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: white;
    font-size: 20px; /* Ajusta el tamaño del icono */
    margin-left: 10px; /* Espaciado entre los botones */
    font-size: 0.8rem;
}

/* Media queries para diseño responsivo */
@media (max-width: 768px) {
    .main-container {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        max-height: 300px;
        overflow-y: auto;
    }
    .content {
        padding: 0.5rem;
    }
}
 
  .search-container {
    position: relative;
  }
  
  .filter-container {
    position: relative;
    z-index: 1002; /* Asegura que el contenedor esté por encima de otros elementos */
  }
  
  .autocomplete {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-top: none;
    z-index: 1003; /* Asegura que esté por encima del contenedor y otros elementos */
    max-height: 200px;
    overflow-y: auto;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    display: none; /* Se mostrará cuando haya sugerencias */
  }
  
  .autocomplete-items {
    list-style: none;
    padding: 0;
    margin: 0;
  }
  
  .autocomplete-items li {
    padding: 10px;
    cursor: pointer;
    background-color: #fff;
    border-bottom: 1px solid #d4d4d4;
    color: #34495e;
  }
  
  .autocomplete-items li:hover {
    background-color: #e9e9e9;
  }
  
  /* Asegura que el contenido debajo no tape el autocompletado */
  .filter-section + .filter-section {
    margin-top: 10px; /* Ajusta este valor según sea necesario */
  }
  .filter-input {
    display: flex;
    align-items: center;
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 6px 6px;
    transition: all 0.3s ease;
}

.filter-input:focus-within {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.filter-input input {
    border: none;
    outline: none;
    background: transparent;
    font-size: 14px;
    width: 100%;
    padding: 0 8px;
}

.filter-input .search-icon {
    color: #757575;
    font-size: 16px;
}

.filter-input .clear-button {
    background: none;
    border: none;
    color: #757575;
    cursor: pointer;
    font-size: 18px;
    padding: 0;
    margin-left: 8px;
}

.filter-input .clear-button:hover {
    color: #333;
}