/* Modal Styles */
/* Mejora el fondo y centra el modal #modalDownloadChoice */
#modalDownloadChoice {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.4); /* Fondo oscuro */
    justify-content: center;
    align-items: center;
}

#modalDownloadChoice .modal-content {
    position: relative;
    margin: auto;
    top: 10vh;
    background-color: #fff;
    padding: 30px;
    border-radius: 10px;
    max-width: 350px;
    box-shadow: 0 2px 10px #0002;
    text-align: center;
}
.modal-content {
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    width: 100%;
    max-width: 100%;
    text-align: center;
    /* min-height: 100%; */
}

#viewModal .modal-content {
    min-height: 100%;
}
#comp-modal-content {
    min-height: 100%;
}

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

#saveSearchModal .modal-body {
    margin: 0px !important;
}
#saveSearchModal .modal-header {
    padding: 0px !important;
}
#saveSearchModal .modal-footer {
    padding: 5px 0px 0px 0px !important;
}

#viewModal .modal-body {
    margin: 0px !important;
}

.modal-body h2 {
    font-size: 1.5rem;
    color: #001848;
    margin-bottom: 10px;
}

.modal-body p {
    color: #001848;
    font-size: 1rem;
    margin-bottom: 20px;
}

.modal-body input[type="text"],
.modal-body input[type="email"] {
    width: 100%;
    padding: .375rem .75rem;;
    margin: 10px 0;
    border: 1px solid #001848;
    border-radius: 5px;
    box-sizing: border-box;
    font-size: 1rem;
}

#search-name {
    border: 1px solid #EEEEEE;
}

.download-now-btn {
    background-color: #FF9900;
    color: #000000;
    padding: 15px 20px;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    width: 100%;
    margin-top: 20px;
}

#results-table thead tr {
    display: block;
    position: sticky;
    top: 0;
    z-index: 10; /* Asegura que el encabezado esté sobre las filas */
}
#results-table tbody {
    display: block;
    /* overflow-y: auto; */
    max-height: 500px;
    min-height: 250px;
}

#results-table {
    width: max-content;
    min-width: 100%;
    border-collapse: collapse;
}

#comp-modal-body {
    align-items: center;
    justify-items: anchor-center;
    overflow-y: auto;
    overflow-x: hidden;
}

.rank-content {
    width: 100%;
    height: calc(100vh + 300px);
    display: flex;
    flex-direction: row;

}

.import-content {
    width: 50%;
    padding-left: 5px;
    padding-right: 5px;
    height: auto;
    display: flex;
    flex-direction: column;
}

.export-content {
    width: 50%;
    padding-left: 5px;
    padding-right: 5px;
    height: auto;
    display: flex;
    flex-direction: column;
}

.dropdown-container {
    display: inline-block;
    position: relative;
}

.dropdown-menu button {
    display: block;
    width: 100%;
    margin-bottom: 5px;
}


/* --- FIX alineación y popover en el modal (Visualización Completa) --- */

/* Deja que la tabla ocupe el 100% y calcule anchos reales */
#viewModal #results-table {
  width: 100% !important;          /* Ancho completo en la vista resumida */
  table-layout: auto !important;
}

/* Asegura que todos los envoltorios ocupen el ancho del modal */
#viewModal .dataTables_wrapper,
#viewModal .dataTables_scroll,
#viewModal .dataTables_scrollHead,
#viewModal .dataTables_scrollBody,
#viewModal #long-view {
  width: 100% !important;
}

/* Evita anchos fijos de celdas (como 200px) solo dentro del modal */
#viewModal #results-table th {
  width: auto !important;
  max-width: none !important;
}

#results-table td {
    white-space: normal;
    overflow: hidden;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    word-break: break-word;
}


/* Evitar que el header tenga un ancho distinto al body cuando hay pocas columnas */
#results-table .dataTables_scrollHeadInner,
#results-table .dataTables_scrollBody table {
  width: 100% !important;
}
/* Si usabas sticky “manual” para el thead, restáuralo a tabla normal:
   (FixedHeader/scrollX de DataTables se encarga del header) */
#viewModal #results-table thead tr {
  display: table-row !important;
  position: static !important;
  top: auto !important;
  z-index: auto !important;
}
#viewModal #results-table tbody {
  display: table-row-group !important;
  max-height: none !important;
  min-height: 0 !important;
}