/* Estilos globales */
body {
    font-family: 'Poppins', sans-serif;
    background-color: #f0f2f5;
    margin: 0;
    padding: 20px;
    color: #333;
}

/* Encabezados */
h1, h2 {
    text-align: center;
    color: #34495e;
    letter-spacing: 1.5px;
}

.action-buttons {
    display: flex;
    gap: 5px; /* Espacio entre botones */
    align-items: center;
    justify-content: center;
}

/* Reducir un poco el tamaño de los botones para ahorrar espacio */
.action-buttons .btn {
    padding: 6px 12px; /* Reduce el padding */
    font-size: 0.8em;  /* Reduce el tamaño de fuente */
    min-width: auto;  /* Permite que se adapten al contenido */
}

/* Opcional: si quieres que los botones tengan un ancho uniforme y más pequeño */
.action-buttons .btn {
    min-width: 100px;
}

/* Contenedor de botones flotantes */
.btn-container {
    position: absolute;

}

/* Botones */
.btn {
    white-space: nowrap;
    background-color: #3498db;
    color: white;
    border: none;
    cursor: pointer;
    text-decoration: none;
    border-radius: 30px;
    font-weight: bold;
    font-size: 0.9em;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.btn:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
}

/* Botón de peligro */
.btn-danger {
    background-color: #e74c3c;
}

.btn-danger:hover {
    background-color: #c0392b;
}

/* Tablas */
table {
    width: 100%;
    border-collapse: collapse !important;
  border-spacing: 0 !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

table, th, td {
    border: 1px solid #ddd;
}

th {
  padding: 10px; /* antes 10px */
  text-align: left;
  font-size: 0.85em;
}

td * {
  margin: 0 !important;
  padding: 0 !important;
  line-height: 3 !important;
}

th {
    background-color: #007bff;
    color: white;
    text-transform: uppercase;
    letter-spacing: 1px;
}

tr:nth-child(even) {
    background-color: #f7f9fa;
}

tr:hover {
    background-color: #eaeaea;
    transition: background-color 0.2s ease;
}

/* Formularios */
form {
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #34495e;
    font-weight: bold;
    font-size: 0.9em;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 10px;
    box-sizing: border-box;
    border: 1px solid #ccc;
    border-radius: 5px;
    transition: border-color 0.3s ease;
}

.form-group select {
    height: 45px;
}

.add-user {
    white-space: nowrap;
    background-color: #9e4853;
    color: white;
    padding: 10px 20px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    border-radius: 30px;
    margin-left: 15px;
    font-weight: bold;
    margin-bottom: 20px;
    font-size: 0.9em;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.add-user:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
}

.admin-emp {
    white-space: nowrap;
    background-color: #84bd76;
    color: white;
    padding: 10px 20px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    border-radius: 30px;
    margin-left: 15px;
    font-weight: bold;
    margin-bottom: 20px;
    font-size: 0.9em;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.admin-emp:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
}

.versiones {
    white-space: nowrap;
    background-color: #ff5dff;
    color: white;
    padding: 10px 20px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    border-radius: 30px;
    margin-left: 15px;
    font-weight: bold;
    margin-bottom: 20px;
    font-size: 0.9em;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.versiones:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
}

/* Estilo común para Buscar, Mostrar todos, Regresar y Cerrar sesión */
.search-bar a.btn_buscar,
.search-bar a.mostrar-todos,
.search-bar a.btn_return {
margin-left: 10px;
  padding: 16px 32px !important;    /* mayor padding */
  font-size: 1.2em !important;       /* texto más grande */
  border-radius: 6px !important;     /* esquinas menos redondeadas */
  min-width: 150px !important;       /* ancho mínimo */
  text-align: center;
}

/* Mantén sus colores originales (si quieres colores distintos, repítelos aquí) */
.search-bar a.btn_buscar,
.search-bar a.mostrar-todos,
.search-bar a.btn_return {
  background-color: #007bff !important;
  color: #fff !important;
}

.search-bar a.btn-logout {
  background-color: #e74c3c !important;
  color: #fff !important;
}

/* Hover más activo */
.search-bar a.btn_buscar:hover,
.search-bar a.mostrar-todos:hover,
.search-bar a.btn_return:hover,
.search-bar a.btn-logout:hover {
  transform: translateY(-2px) scale(1.05);
} 

.form-group input:focus, .form-group select:focus {
    border-color: #3498db;
    outline: none;
}


/* Barra de búsqueda */
.search-container {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.search-container button,
.search-container a {
    font-size: 15px !important;
    padding: 12px 20px !important;
    display: inline-block !important;
    text-decoration: none !important;
}

.search-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.search-bar input[type="text"] {
    padding: 12px;
    width: 250px;
    border: 2px solid #000000;
    border-radius: 30px;
    
    transition: border-color 0.3s ease;
}

.search-bar input[type="text"]:focus {
    border-color: #3498db;
}

.search-bar button, .clear-btn {
    padding: 12px 20px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease;
    font-size: 0.9em;
}

.search-bar button:hover, .clear-btn:hover {
    background-color: #45a049;
    transform: translateY(-2px);
}

/* Botones */
.btn {
    background-color: #0099ff;
    color: white;
    padding: 12px 20px;  /* Asegura un tamaño consistente */
    border: none;
    margin-bottom: 20px;
    cursor: pointer;
    text-decoration: none;
    border-radius: 30px;
    margin-left: 15px;
    font-weight: bold;
    font-size: 0.9em;
    transition: background-color 0.3s ease, transform 0.3s ease;
    display: inline-block; /* Asegura que los botones se alineen correctamente */
    min-width: 150px; /* Asegura un ancho mínimo consistente */
    text-align: center;
}

.btn:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
}

/* Botón de peligro (Borrar) */
.btn-danger {
    margin-top: 20px;
    background-color: #e74c3c;
}

.btn-danger:hover {
    background-color: #c0392b;
}

/* Asegurar que los botones de la misma clase tengan el mismo tamaño */
.btn, .btn-danger {

    padding: 12px 20px;  /* Mismo tamaño de padding */
    min-width: 150px;    /* Mismo ancho mínimo */
    font-size: 0.9em;    /* Mismo tamaño de fuente */
}

.styled-select {

    width: 100%; /* Ajusta el ancho según sea necesario */
    padding: 10px;
    font-size: 16px;
    color: #333; /* Color del texto */
    background-color: #f9f9f9; /* Color de fondo */
    border: 2px solid #4CAF50; /* Borde de color verde */
    border-radius: 5px; /* Bordes redondeados */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* Sombra suave */
    -webkit-appearance: none; /* Elimina el estilo predeterminado en algunos navegadores */
    -moz-appearance: none;
    appearance: none;
    cursor: pointer; /* Cambia el cursor a mano */
    transition: border-color 0.3s ease; /* Transición para el cambio de borde */
}

.styled-select:hover {
    border-color: #2196F3; /* Cambia el borde cuando el usuario pasa el ratón */
}

.styled-select:focus {
    border-color: #4CAF50; /* Cambia el color del borde al enfocarse */
    outline: none; /* Elimina el borde adicional */
    box-shadow: 0 0 5px rgba(76, 175, 80, 0.5); /* Sombra suave */
}

.styled-select2 {
    margin-bottom: 20px;
    width: 100%; /* Ajusta el ancho según sea necesario */
    padding: 10px;
    font-size: 16px;
    color: #333; /* Color del texto */
    background-color: #f9f9f9; /* Color de fondo */
    border: 2px solid #4CAF50; /* Borde de color verde */
    border-radius: 5px; /* Bordes redondeados */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* Sombra suave */
    -webkit-appearance: none; /* Elimina el estilo predeterminado en algunos navegadores */
    -moz-appearance: none;
    appearance: none;
    cursor: pointer; /* Cambia el cursor a mano */
    transition: border-color 0.3s ease; /* Transición para el cambio de borde */
}

.styled-select2:hover {
    border-color: #2196F3; /* Cambia el borde cuando el usuario pasa el ratón */
}

.styled-select2:focus {
    border-color: #4CAF50; /* Cambia el color del borde al enfocarse */
    outline: none; /* Elimina el borde adicional */
    box-shadow: 0 0 5px rgba(76, 175, 80, 0.5); /* Sombra suave */
}

/* Responsive Web Design */

/* Pantallas medianas (tabletas, dispositivos medianos) */
@media (max-width: 768px) {
    body {
        padding: 15px;
    }

    .btn-container {
        position: static;
        text-align: center;
    
    }

    .search-bar {
    display: block;           /* para que se comporte como bloque */
    width: 100% !important;   /* full-width respecto a contenedor-principal */
    max-width: none !important;
    margin: 0;                /* sin márgenes externos */
    padding: 0 10px;          /* opcional: deja 10 px de espacio interno */
    box-sizing: border-box;   /* para que el padding esté dentro del ancho 100% */
  }

    table, th, td {
        font-size: 0.8em;
    }

    .btn {
        min-width: 200px;
    }

    .search-container {
    width: 100% !important; 
    max-width: none !important;
    padding: 0 10px;      /* opcional, si quieres un poco de margen interior */
    margin: 0;            /* evitar márgenes externos */
  }
}

/* Pantallas pequeñas (móviles) */
@media (max-width: 576px) {
    body {
        padding: 10px;
    }

    .search-container {
        flex-direction: column;
        align-items: center;
    }

    .search-bar input[type="text"] {
        width: 100%;
        margin-right: 0;
        margin-bottom: 10px;
    }

    .btn-container {
        position: static;
        text-align: center;
        margin-bottom: 15px;
    }

    table, th, td {
        font-size: 0.7em;
    }

    .btn {
        width: 200px;
        padding: 10px 15px;
        font-size: 0.8em;
        min-width: 100px;
    }

    @media (max-width: 768px) {
        .search-bar {
            flex-direction: column;
            margin-right: 50px;
          
        }
        .search-bar input[type="text"], .btn_buscar, .mostrar-todos, .add-user, .admin-emp, .btn_return {
            width: 100%;
            margin: 5px 0;
        }

}

 /* Estilos generales de la tabla */
 table {
    width: 100%;
    border-collapse: collapse;
    overflow-x: auto; /* Permitir desplazamiento horizontal */
}

th, td {
    padding: 12px;
    text-align: left;
    border: 1px solid #ddd;
}

th {
    background-color: #f2f2f2;
}

/* Estilos para dispositivos móviles */
@media (max-width: 600px) {
    table, thead, tbody, th, td, tr {
        display: block; /* Hacer que la tabla sea un bloque */
    }
    
    thead tr {
        position: absolute; /* Separar el encabezado del cuerpo de la tabla */
        top: -9999px; /* Sacar el encabezado de la vista */
        left: -9999px; /* Sacar el encabezado de la vista */
    }

    tr {
        margin-bottom: 15px; /* Espacio entre filas */
    }

    td {
        text-align: right; /* Alinear texto a la derecha */
        position: relative; /* Posicionamiento relativo */
        padding-left: 50%; /* Espacio a la izquierda */
    }

    td::before {
        position: absolute; /* Posicionamiento absoluto */
        left: 10px; /* Espacio a la izquierda */
        white-space: nowrap; /* Evita que el texto se envuelva */
        font-weight: bold; /* Negrita para los encabezados */
    }

    td:nth-child(1)::before { content: "ID"; }
    td:nth-child(2)::before { content: "Nombre de Usuario"; }
    td:nth-child(3)::before { content: "Correo Electrónico"; }
    td:nth-child(4)::before { content: "Nombre Completo"; }
    td:nth-child(5)::before { content: "Rol"; }
    td:nth-child(6)::before { content: "Empresa"; }
    td:nth-child(7)::before { content: "Archivos"; }
    td:nth-child(8)::before { content: "Acciones"; }

    /* Estilos para los botones y selectores */
.styled-select, .styled-select2, .btn {
    padding: 8px 12px; /* Espaciado interno */
    font-size: 14px; /* Tamaño de fuente */
    border-radius: 4px; /* Bordes redondeados */
    border: 1px solid #000000; /* Borde */
    background-color: #f2f2f2; /* Color de fondo */
    cursor: pointer; /* Cambia el cursor al pasar el ratón */
}

.btn {
    background-color: #f44336; /* Color de fondo rojo */
    color: white; /* Color del texto */
}

/* Estilo para botones de peligro */
.btn-danger {
    background-color: #f44336; /* Color de fondo rojo */
    color: white; /* Color del texto */
}

/* Cambiar el tamaño de los selectores */
.styled-select, .styled-select2 {
    width: 100%; /* Hacer que los selectores ocupen el ancho completo */
    max-width: 200px; /* Limitar el ancho máximo si es necesario */
}

/* Asegurarse de que los botones no sean demasiado grandes */
.btn {
    max-width: 120px; /* Limitar el ancho máximo de los botones */
}
}

}

@media (max-width: 768px) {
    .btn-container {
      position: static; /* Elimina la posición absoluta */
      display: flex;
      flex-wrap: wrap;
      justify-content: center;
      gap: 10px;
      margin-bottom: 15px;
    }
    
    .btn {
      margin: 5px;
      min-width: 100px;  /* Ajusta el ancho mínimo según necesites */
    }
  }