/* =======================
   Importar Fuentes
======================= */
@import url('https://fonts.googleapis.com/css2?family=The+Serif:wght@400;700&display=swap');

/* =======================
   Estilos Generales
======================= */
html,
body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
}

body {
    background-color: #ffffffb1;
    /* Fondo claro */
    font-family: 'The Serif', serif;
    /* Tipografía principal */
    margin: 0;
    padding: 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: #455660;
    /* Títulos en gris oscuro */
    font-family: 'The Serif', serif;
    margin: 0 0 10px 0;
    text-align: center;
    /* Centrar títulos */
}

p {
    font-size: 16px;
    line-height: 1.6;
    font-family: 'The Serif', serif;
    color: #455660;
    /* Texto en gris oscuro */
    margin: 0 0 15px 0;
    text-align: center;
    /* Centrar descripciones */
}

/* =======================
   Enlaces Generales
======================= */
a {
    color: #455660;
    /* Azul corporativo */
    text-decoration: underline;
    font-family: 'The Serif', serif;
    font-weight: bold;
}

a:hover {
    color: #1a202c;
    /* Gris más oscuro en hover */
    font-family: 'The Serif', serif;
    text-decoration: none;
}

/* =======================
   Barra Lateral (Sidebar)
======================= */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 220px;
    min-width: 200px;
    max-width: 280px;
    padding: 20px;
    font-family: 'The Serif', serif;
    background-color: #455660;
    /* Fondo oscuro */
    color: #f8f9fa;
    /* Texto blanco */
    transition: left 0.3s ease, width 0.3s ease;
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;
}

.sidebar-header {
    font-size: 24px;
    font-weight: bold;
    font-family: 'The Serif', serif;
    color: #fff;
    margin-bottom: 20px;
}

.sidebar-text {
    color: #dcdcdc;
    /* Texto gris claro */
    margin-bottom: 10px;
    font-family: 'The Serif', serif;
}

.sidebar-link {
    display: block;
    color: #f8f9fa;
    /* Blanco para contraste */
    /* padding: 10px 0;*/
    text-decoration: none;
    font-family: 'The Serif', serif;
    font-weight: bold;
    transition: color 0.3s ease, text-decoration 0.3s ease;
}

.sidebar-link:hover {
    color: #ffa726;
    /* Un naranja claro para hover */
    text-decoration: underline;
    font-family: 'The Serif', serif;
}

.sidebar-logo img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto 20px;
}

/* =======================
   Contenido Principal
======================= */
.content {
    margin-left: 260px;
    /* Ajustar margen izquierdo */
    margin-top: 90px;
    /* Espacio para el header fijo */
    padding: 20px;
    background-color: #f8f9fa;
    /* Fondo claro */
    transition: margin-left 0.3s ease;
    min-height: 100vh;
    box-sizing: border-box;
}

.content-full {
    margin-left: 30px;
    /* Ajustar margen izquierdo para vista sin sidebar */
    transition: margin-left 0.3s;
}

/* =======================
   Estilos para la Tabla
======================= */
.dash-spreadsheet-container .dash-spreadsheet-footer .dash-pagination {
    display: flex;
    justify-content: center;
}

.dash-cell>a {
    color: #455660 !important;
    /* Azul corporativo */
    text-decoration: underline !important;
    font-weight: bold;
    font-family: 'The Serif', serif;
    font-size: 14px;
}

.dash-cell>a:hover {
    color: #1a202c !important;
    /* Gris oscuro en hover */
    text-decoration: none !important;
    font-family: 'The Serif', serif;
    font-size: 14px;
}

/* =======================
   Botones Generales
======================= */
button {
    padding: 10px 20px;
    background-color: #455660;
    font-family: 'The Serif', serif;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

button:hover {
    background-color: #1a202c;
    /* Gris oscuro en hover */
}

/* Botón personalizado */
.btn-guardar {
    width: 100%;
    background-color: #f8f9fa;
    color: #455660;
    border: none;
    padding: 10px 15px;
    font-family: 'The Serif', serif;
    font-size: 14px;
    cursor: pointer;
    text-align: center;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.btn-guardar-contraste {
    width: 60%;
    background-color: #455660;
    color: #f8f9fa;
    border: none;
    padding: 5px 10px;
    /* Reducido para hacer el botón más delgado */
    font-family: 'The Serif', serif;
    font-size: 14px;
    /* Tamaño de fuente reducido */
    cursor: pointer;
    text-align: center;
    height: 35px;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}


.btn-guardar-contraste:hover {
    background-color: #5a707d;
}

.btn-guardar:hover {
    background-color: #e0e0e0;
}

/* =======================
   Ajustes Variados
======================= */
.dropdown-container {
    margin-bottom: 20px;
    width: 100%;
    box-sizing: border-box;
}

.dropdown-class {
    margin-bottom: 10px;
    font-size: 14px;
    font-family: 'The Serif', serif;
    color: #455660;
    width: 100%;
    box-sizing: border-box;
}

.subtitle-sidebar {
    font-size: 15px;
    font-weight: bold;
    font-family: 'The Serif', serif;
    color: white;
}

/* Responsive containers */
.responsive-container {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: auto;
}

/* Flexible grid system */
.flex-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    width: 100%;
    box-sizing: border-box;
}

.flex-item {
    flex: 1;
    min-width: 300px;
    box-sizing: border-box;
}

.flex-item-half {
    flex: 0 0 calc(50% - 10px);
    min-width: 300px;
    box-sizing: border-box;
}

.flex-item-third {
    flex: 0 0 calc(33.333% - 14px);
    min-width: 250px;
    box-sizing: border-box;
}

/* Responsive adjustments for different desktop resolutions */

/* Large desktops (1920px and above) */
@media (min-width: 1920px) {
    .sidebar {
        width: 280px;
    }

    .content {
        margin-left: 320px;
        margin-top: 25px;
    }

    .table {
        max-width: 1400px;
    }
}

/* Standard desktops (1366px to 1919px) */
@media (min-width: 1366px) and (max-width: 1919px) {
    .sidebar {
        width: 240px;
    }

    .content {
        margin-left: 260px;
        margin-top: 25px;
    }
}

/* Small desktops and laptops (1024px to 1365px) */
@media (min-width: 1024px) and (max-width: 1365px) {
    .sidebar {
        width: 200px;
    }

    .content {
        margin-left: 220px;
        margin-top: 90px;
        padding: 15px;
    }

    .table {
        width: 95%;
    }
}

/* Very small desktops (768px to 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    .sidebar {
        width: 180px;
        padding: 15px;
    }

    .content {
        margin-left: 195px;
        margin-top: 90px;
        padding: 10px;
    }

    .table {
        width: 98%;
        font-size: 12px;
    }

    .table th,
    .table td {
        padding: 3px;
    }

    .flex-item-half {
        flex: 0 0 100%;
        min-width: auto;
    }

    .flex-item-third {
        flex: 0 0 100%;
        min-width: auto;
    }
}

/* Additional responsive styles for graphs and components */
.dash-graph {
    width: 100% !important;
    height: auto !important;
    min-height: 300px;
}

/* Estabilizar gráfico de distribución de industrias */
#grafico6 {
    width: 100% !important;
    height: 500px !important;
    position: relative;
    transition: none !important;
}

/* Contenedor estable para gráficos */
.graph-container-stable {
    width: 100%;
    height: 500px;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
}

/* Estabilizar contenedores flex para evitar movimiento de gráficos */
.flex-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    width: 100%;
    box-sizing: border-box;
    align-items: flex-start;
    min-height: 400px;
}

.flex-item-half {
    flex: 0 0 calc(50% - 10px);
    min-width: 300px;
    box-sizing: border-box;
    position: relative;
    min-height: 400px;
}

/* Estabilizar el contenedor responsive para el gráfico de distribución industrias */
.responsive-container {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: auto;
    position: relative;
    min-height: 500px;
}

/* Responsive tables for Dash DataTable */
.dash-spreadsheet-container {
    overflow: hidden;
    width: 100%;
    max-width: 100%;
}

.dash-spreadsheet-container .dash-spreadsheet-inner {
    width: 100%;
    max-width: 100%;
}

/* Responsive cards and containers */
.card-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    width: 100%;
    box-sizing: border-box;
}

.card-item {
    flex: 1;
    min-width: 250px;
    max-width: 400px;
    box-sizing: border-box;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Responsive form elements */
.form-group {
    width: 100%;
    margin-bottom: 15px;
    box-sizing: border-box;
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 20px;
    padding: 0;
    justify-content: space-between;
}

.form-col {
    width: 47%;
    box-sizing: border-box;
    padding: 0;
    margin-bottom: 15px;
}

.form-single {
    width: 97%;
    box-sizing: border-box;
    padding: 0;
    margin-bottom: 15px;
    margin-right: 3%;
}

/* Estilos específicos para labels en formularios */
.form-col label {
    word-wrap: break-word;
    white-space: normal;
    overflow-wrap: break-word;
    max-width: 100%;
    display: block;
    font-size: 0.95rem;
    line-height: 1.3;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
    text-align: left;
}

/* Estilos para campos de entrada en formularios */
.form-col input,
.form-col .Select-control,
.form-col .dash-dropdown {
    width: 100%;
    box-sizing: border-box;
    margin-top: 5px;
}

/* Responsive adjustments for form columns */
@media (max-width: 768px) {
    .form-row {
        padding: 0;
        gap: 15px;
    }

    .form-col {
        flex: 1 1 100%;
        min-width: auto;
        max-width: 100%;
        padding: 0;
    }
}

/* Responsive buttons */
.btn-responsive {
    width: 100%;
    max-width: 300px;
    padding: 10px 20px;
    box-sizing: border-box;
    margin: 5px 0;
}

@media (min-width: 1024px) {
    .btn-responsive {
        width: auto;
        margin: 5px;
    }
}


/* =======================
   Tablas
======================= */

/* styles.css */

/* General table styles */
.table {
    width: 100%;
    max-width: 100%;
    margin: auto;
    overflow-x: auto;
    display: block;
    white-space: normal;
    box-sizing: border-box;
}

/* Header styles */
.table th {
    background-color: #455660;
    color: #f2f3f4;
    font-family: 'The Serif', serif;
    font-size: 16px;
    text-align: center;
    padding: 5px;
}

/* Cell styles */
.table td {
    background-color: #f2f3f4;
    color: #333;
    text-align: center;
    font-family: 'The Serif', serif;
    font-size: 14px;
    padding: 8px;
    word-wrap: break-word;
    white-space: normal;
    width: auto;
    min-width: 120px;
    max-width: none;
    box-sizing: border-box;
}

/* Conditional styles for 'LINK' column */
.table .link-column {
    color: #455660;
    background-color: #f2f3f4;
    text-decoration: underline;
    font-weight: bold;
    text-align: center;
    font-family: 'The Serif', serif;
    font-size: 14px;
    padding: 5px;
    word-wrap: break-word;
    white-space: normal;
}

/* Conditional styles for active state in 'LINK' column */
.table .link-column.active {
    color: #1a202c;
    text-decoration: none;
}

/* Odd row styles */
.data-table-row-odd {
    background-color: #f2f3f4;
}

/* =======================
   Tooltips para Dropdown
======================= */

/* Estilos para tooltips en opciones de dropdown */
.Select-option[title] {
    position: relative;
}

.Select-option[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    margin-bottom: 5px;
    max-width: 400px;
    word-wrap: break-word;
    white-space: normal;
}

.Select-option[title]:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #333;
    z-index: 1000;
}

/* Estilos específicos para Dash Dropdown */
.dash-dropdown .Select-option[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    margin-bottom: 5px;
    max-width: 400px;
    word-wrap: break-word;
    white-space: normal;
}

.dash-dropdown .Select-option[title]:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #333;
    z-index: 1000;
}

/* =======================
   Estilos para Cards Mejoradas
======================= */
.hover-card {
    position: relative;
    transform: translateY(0);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(69, 86, 96, 0.02) 0%, rgba(69, 86, 96, 0.05) 100%);
    border-radius: 16px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.hover-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(69, 86, 96, 0.15) !important;
    border-color: rgba(69, 86, 96, 0.12) !important;
}

.hover-card:hover::before {
    opacity: 1;
}

.hover-card:active {
    transform: translateY(-4px);
    transition: all 0.1s ease;
}

/* Animación para iconos dentro de las cards */
.hover-card:hover .fas {
    transform: scale(1.1);
    transition: transform 0.3s ease;
}

.hover-card .fas {
    transition: transform 0.3s ease;
}
