/* General Reset */

body {
    /*font-family: 'Crimson Pro', sans-serif, serif;*/
    font-family: "Montserrat", "Open Sans", "Roboto", Arial, sans-serif;
}
/*
navbar color
    gris:    #e0e0de;
    verde:  #2ca73c;
    verdeciko claro: #edffec;
*/
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    
    /* fondo azul letra blanca
    background-color: #1d4a86;
    color: #fff;*/

    /* fondo blanco letra verde
    background-color: #fff;
    color: #2ca73c;
    */

    /* fondo verde letra verde*/
    /*background-color: #edffec;
    color: #0078d7;*/

    /*color: #0078d7;*/

    /* fondo azul letra verde*/
    background-color: #1d2549;
    color: #bdf347;
    
    padding: 10px 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
.navbar .menu li a, .navbar .menu li, .file-section th {
    background-color: #1d2549;
    color: #bdf347;
    font-weight: bold;
}

h2, h2 a {
    color: #1d2549;
    text-decoration: none;
}

.button, .btnDescarga {
    background-color: #bdf347;
    color: #1d2549;
    font-weight: bold;
}

footer {
    background-color: #1d2549;
    color: white;
    text-align: center;
    padding: 10px 0;
    margin-top: 20px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Layout */
html {
  height: 100%;
}
body {
  min-height: 100%;
}
body {
    line-height: 1.5;
    display: flex;
    flex-direction: column;
    min-height: 100vh;

}

header {
    background-color: #0078d7;
    color: white;
    padding: 1rem;
    text-align: center;
}

main {
    display: flex;
    flex-wrap: wrap;
    flex-grow: 1;
    padding: 1rem;
    gap: 1rem;
}

/* File Section */
#fileTable {

}

/* User Section */
.user-section {
    flex: 1;
    min-width: 200px;
    max-width: 300px;
    background-color: #f9f9f9;
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.user-section h2 {
    margin-bottom: 1rem;
}

.user-section ul {
    list-style: none;
    padding: 0;
}

.user-section li {
    padding: 0.5rem;
    cursor: pointer;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-bottom: 0.5rem;
    text-align: center;
    transition: background-color 0.2s;
}

.user-section li:hover {
    background-color: #0078d7;
    color: white;
}

/* File Section */
.file-section {
    flex: 3;
    min-width: 300px;
    background-color: #fff;
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.table-container {
            width: 100%;
            overflow-x: auto; /* Permite el desplazamiento horizontal en pantallas pequeñas */
            margin: 20px auto;
            /*border: 1px solid #ddd;*/
            border-radius: 8px;
        }

.file-section table {
    width: 100%;
    border-collapse: collapse;
    overflow-x: auto; /* Horizontal */
}

.file-section th, .file-section td {
    white-space:nowrap;
/*    padding: 0.5rem;*/
    padding: 12px;
    border: 1px solid #ddd;
    text-align: left;
    min-width: 100px;
}

.file-section th {
    /*background-color: #B4CF66;
    color: #44803F;*/
    /*background: #7AA4DC;
    color: #fff;*/

}

.file-section td {
    vertical-align: middle;
}

.file-section .actions button {
    padding: 0.5rem 0.75rem;
    margin-right: 0.5rem;
    border: none;
    border-radius: 5px;
    background-color: #0078d7;
    color: white;
    cursor: pointer;
    transition: background-color 0.2s;
}

.file-section .actions button:hover {
    background-color: #005fa3;
}

.up {
    float: left;
}
.down {
    float: right;
}
.up, .down {
    width: 5px;
    color: #fff;
    padding-right: 15px;
    text-decoration: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    main {
        flex-direction: column;
    }

    .user-section {
        max-width: 100%;
    }

    .file-section {
        max-width: 100%;
    }
}


/* Estilo general de la tabla */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: #fff;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

th {
    position: relative;
    background-color: #0056b3;
    color: #fff;
    padding: 10px;
    text-align: left;
    cursor: pointer;
    font-size: 14px;
    vertical-align: middle;
}

/* Contenedor flexible dentro del th */
.th-wrapper {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

/* Estilo para el input de búsqueda */
.th-search {
    width: 90%;
    padding: 5px;
    font-size: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    outline: none;
}

/* Efecto hover para el input */
.th-search:focus {
    border-color: #0056b3;
    box-shadow: 0 0 5px rgba(0, 91, 187, 0.5);
}

/* Ícono de ordenación */
.sort-icon {
    font-size: 12px;
    margin-left: 5px;
    opacity: 0.8;
}

/* Hover para la cabecera sortable */
th.sortable:hover {
/*    background-color: #0056b3;*/
}

th.sortable .sort-icon {
    transition: transform 0.3s ease;
}

/* Orden ascendente o descendente */
th.sortable[data-order="asc"] .sort-icon {
    transform: rotate(0deg);
}

th.sortable[data-order="desc"] .sort-icon {
    transform: rotate(180deg);
}

        /* Estilo General */
        body {
            margin: 0;
            background-color: #f4f4f9;
        }

        /* Barra de Navegación */
        .navbar {
            display: flex;
            align-items: center;
            justify-content: space-between;
            
            /* fondo azul letra blanca
            background-color: #1d4a86;
            color: #fff;*/

            /*background-color: #fff;
            color: #2ca73c;*/
            /*color: #0078d7;*/

            padding: 10px 20px;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
        }

        /* Logo */
        .navbar .logo {
            display: flex;
            align-items: center;
        }

        .navbar .logo img {
            height: 24px;
            margin-right: 10px;
            display: block;
            vertical-align: middle;
        }

        .navbar .logo span {
            font-size: 20px;
            font-weight: bold;
        }

        /* Opciones del Menú */
        .navbar .menu {
            display: flex;
            align-items: center;
            list-style: none;
            margin: 0;
            padding: 0;
        }

        .navbar .menu li {
            margin: 0 10px;
        }

        .navbar .menu li a {
            text-decoration: none;
            font-size: 16px;
            transition: color 0.3s ease;
        }

        .navbar .menu li a:hover {
            color: #ffdd57;
        }

        .toggle-button {
            display: none;
        }

        /* Responsividad */
        @media (max-width: 768px) {
            .navbar .menu {
                display: none;
                flex-direction: column;
                position: absolute;
                top: 60px;
                right: 20px;
                background-color: #1d4a86;
                border-radius: 8px;
                width: 200px;
                box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
                z-index: 1000;
            }

            .navbar .menu a {
                line-height: 2em;
                text-align: center;
                padding: 10px 20px;
            }

            .navbar .menu.show {
                display: flex;
            }

            .toggle-button {
                cursor: pointer;
                display: block;
            }
        }


/* Botón básico */
.button, .btnDescarga {
    display: inline-block;
    padding: 12px 20px;
    margin-right: 0.2rem;
    margin-left: 0.2rem;
    font-size: 16px;
    font-weight: bold;
    /*color: #ffffff;
    background-color: #243C5D;*/
    border: none;
    border-radius: 5px;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btnDescarga {
    float: right;
}

/* Hover: Cambia ligeramente el color y la sombra */
.button:hover {
    background-color: #0056b3;
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}

/* Active: Indica presión con un ligero desplazamiento */
.button:active {
    transform: translateY(2px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
}

/* Deshabilitado: Apariencia apagada */
.button:disabled {
    background-color: #cccccc;
    color: #666666;
    cursor: not-allowed;
    box-shadow: none;
}

/* Botón secundario */
.button-secondary {
    background-color: #6c757d;
    color: #ffffff;
}

.button-secondary:hover {
    background-color: #565e64;
}

/* Botón éxito */
.button-success {
    background-color: #28a745;
    color: #ffffff;
}

.button-success:hover {
    background-color: #218838;
}

/* Botón peligro */
.button-danger {
    background-color: #dc3545;
    color: #ffffff;
}

.button-danger:hover {
    background-color: #c82333;
}

/* Estilo base para la alerta */
.alert {
    padding: 15px 20px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: 5px;
    font-family: Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
}

/* Tipos de alerta */
.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.alert-error {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.alert-warning {
    color: #856404;
    background-color: #fff3cd;
    border-color: #ffeeba;
}

.alert-info {
    color: #0c5460;
    background-color: #d1ecf1;
    border-color: #bee5eb;
}

/* Iconos o énfasis */
.alert strong {
    font-weight: bold;
}

/* Cerrar alerta */
.alert .close {
    float: right;
    font-size: 18px;
    font-weight: bold;
    color: #000;
    text-decoration: none;
    line-height: 1;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.3s;
}

.alert .close:hover {
    opacity: 0.9;
}