/* ===================== RESET GENERAL ===================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===================== BODY Y LAYOUT GENERAL ===================== */
html, body {
    height: 100%;
    width: 100%;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f6fa;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
    color: #2c3e50;
}

/* ===================== NAVBAR ===================== */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #f8f8f8;
    padding: 12px 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    border-bottom: 1px solid #ddd;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}
.navbar:hover {
    background-color: #fafafa;
    box-shadow: 0 6px 14px rgba(0,0,0,0.18);
}

.logo {
    height: 50px;
    width: auto;
    cursor: pointer;
}

.navbar ul {
    display: flex;
    list-style: none;
    gap: 20px;
    flex-wrap: wrap;
}

.navbar ul li a {
    color: #2c3e50;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease, transform 0.2s ease;
}

.navbar ul li a:hover {
    color: #ffcc00;
    transform: scale(1.05);
}

/* ===================== FOOTER GLOBAL ===================== */
footer {
    background-color: #2c3e50;
    color: #fff;
    padding: 15px 10px;
    text-align: center;
    font-size: 14px;
    box-shadow: 0 -3px 8px rgba(0, 0, 0, 0.2);
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
}

/* ===================== MAIN (espaciado para que no se solape) ===================== */
main {
    flex: 1;
    padding-top: 80px;
    padding-bottom: 60px;
}

/* ===================== LOGIN PAGE ===================== */
.login-container {
    display: flex;
    width: 100%;
    height: calc(100vh - 70px);
    background-color: #fff;
    margin-top: 60px;
    margin-bottom: 50px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    border-radius: 12px;
    overflow: hidden;
}

.login-image {
    width: 50%;
    height: 100%;
}
.login-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.login-image img:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

.login-form {
    width: 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px;
    background-color: #fff;
}

.login-form h2 {
    margin-bottom: 25px;
    color: #2c3e50;
    text-align: center;
    font-size: 28px;
}

.login-form form {
    display: flex;
    flex-direction: column;
    width: 80%;
    max-width: 350px;
}

.login-form label {
    margin-bottom: 6px;
    font-weight: bold;
    color: #333;
}

.login-form input {
    margin-bottom: 15px;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s ease, box-shadow 0.3s ease;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}
.login-form input:focus {
    border-color: #2c3e50;
    outline: none;
    box-shadow: 0 0 5px rgba(44,62,80,0.4);
}

.login-form button {
    padding: 12px;
    background-color: #2c3e50;
    color: #fff;
    border: none;
    cursor: pointer;
    border-radius: 8px;
    font-weight: bold;
    font-size: 16px;
    transition: all 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
}
.login-form button:hover {
    background-color: #1a252f;
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.login-form p {
    margin-top: 15px;
    text-align: center;
    font-size: 14px;
}
.login-form p a {
    color: #2c3e50;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}
.login-form p a:hover {
    color: #ffcc00;
}


/* ===================== FORMULARIOS FLEXIBLES ===================== */
.form-container {
    background-color: #ffffff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
    width: 100%;
    max-width: 420px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: auto;
    margin-top: 60px;
}

.form-container h2 {
    margin-bottom: 20px;
    color: #2c3e50;
    text-align: center;
    font-size: 28px;
}

.form-container form {
    display: flex;
    flex-direction: column;
    width: 90%;
    max-width: 350px;
}

.form-container label {
    margin-bottom: 6px;
    font-weight: bold;
    color: #333;
}

.form-container input {
    margin-bottom: 15px;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s ease, box-shadow 0.3s ease;
}
.form-container input:focus {
    border-color: #2c3e50;
    outline: none;
    box-shadow: 0 0 5px rgba(44,62,80,0.3);
}

.form-container button {
    padding: 12px;
    background-color: #2c3e50;
    color: #fff;
    border: none;
    cursor: pointer;
    border-radius: 8px;
    font-weight: bold;
    font-size: 16px;
    transition: all 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    margin-top: 10px;
}
.form-container button:hover {
    background-color: #1a252f;
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* Estilo para el enlace "Regresar al login" */
.form-container .return-link {
    display: inline-block;       /* Se comporta como botón */
    padding: 12px;
    background-color: #2c3e50;
    color: #fff;
    border-radius: 8px;
    font-weight: bold;
    font-size: 16px;
    text-align: center;
    text-decoration: none;       /* Quita subrayado */
    margin-top: 10px;
    transition: all 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.form-container .return-link:hover {
    background-color: #1a252f;
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}


/* ===================== HOME PAGE ===================== */
.home-container {
    text-align: center;
    padding: 40px 20px;
    max-width: 1200px;
    margin: auto;
}

.welcome-section {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100vh;
}
.welcome-title {
    font-size: 32px;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 10px;
}

/* OCULTAR BOTÓN NUEVO TRABAJADOR EN HOME */
#btnNuevoTrabajador {
    display: none;
}

/* ===================== USER ROLE ===================== */
.user-role {
    font-size: 16px;
    font-weight: bold;
    padding: 8px 20px;
    border-radius: 20px;
    display: inline-block;
    margin-top: 10px;
    color: #fff;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.user-role[data-role="Usuario"] {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
}

.user-role[data-role="Invitado"] {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: #fff;
}

.user-role:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 18px rgba(0,0,0,0.5);
}
/* ===================== MODALS ===================== */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    justify-content: center;
    align-items: center;
}

.close {
    position: absolute;
    top: 12px;
    right: 18px;
    color: #333;
    font-size: 26px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}
.close:hover {
    color: red;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

/* ===================== MODAL FICHA ===================== */
#modalFicha .modal-content {
    background: #ffffff;
    padding: 30px;
    border-radius: 12px;
    width: 400px;
    max-width: 90%;
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
    animation: fadeIn 0.3s ease-in-out;
    position: relative;
    text-align: left;
}
#modalFicha h2 {
    margin-bottom: 20px;
    font-size: 22px;
    color: #2c3e50;
    text-align: center;
}
#modalFicha p {
    margin: 10px 0;
    font-size: 16px;
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid #ddd;
    padding-bottom: 5px;
}
#modalFicha strong {
    color: #34495e;
}
#modalFicha .pdf-container {
    text-align: center;
    margin-top: 20px;
}

/* ===================== MODAL ACTUALIZAR ===================== */
#modalActualizar .modal-content {
    background: #f9f9f9;
    padding: 30px 40px;
    border-radius: 14px;
    width: 550px;
    max-width: 95%;
    box-shadow: 0 10px 25px rgba(0,0,0,0.35);
    animation: fadeIn 0.3s ease-in-out;
    position: relative;
}
#modalActualizar h2 {
    margin-bottom: 25px;
    font-size: 24px;
    font-weight: bold;
    color: #2c3e50;
    text-align: center;
}
#modalActualizar form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
#modalActualizar label {
    font-size: 14px;
    font-weight: bold;
    color: #555;
}
#modalActualizar input,
#modalActualizar select {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    width: 100%;
}
#modalActualizar .btn-submit {
    background: #007bff;
    color: #fff;
    padding: 10px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 15px;
    font-size: 15px;
    transition: all 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
}
#modalActualizar .btn-submit:hover {
    background: #0056b3;
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 5px 15px rgba(0,91,187,0.3);
}

/* ===================== MODAL CREAR TRABAJADOR ===================== */
#modalCrear .modal-content {
    background: #ffffff;
    padding: 35px 45px;
    border-radius: 16px;
    width: 600px;
    max-width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 12px 28px rgba(0,0,0,0.35);
    animation: fadeIn 0.3s ease-in-out;
    position: relative;
}
#modalCrear h2 {
    margin-bottom: 25px;
    font-size: 24px;
    font-weight: bold;
    color: #2c3e50;
    text-align: center;
}
#modalCrear .form-agregar {
    display: flex;
    flex-direction: column;
    gap: 18px;
}
#modalCrear .row-form {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
}
#modalCrear .form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
}
#modalCrear .form-group.full-width {
    flex: 100%;
}
#modalCrear label {
    font-size: 14px;
    font-weight: bold;
    color: #555;
    margin-bottom: 6px;
}
#modalCrear input,
#modalCrear select {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    width: 100%;
}
#modalCrear .btn-submit {
    background: #28a745;
    color: #fff;
    padding: 12px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 10px;
    font-size: 15px;
    font-weight: bold;
    transition: all 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
}
#modalCrear .btn-submit:hover {
    background: #218838;
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 5px 15px rgba(33,131,56,0.3);
}
#modalCrear::-webkit-scrollbar {
    width: 8px;
}
#modalCrear::-webkit-scrollbar-thumb {
    background: #bbb;
    border-radius: 4px;
}

/* ===================== FORMULARIO AGREGAR TRABAJADOR ===================== */
.form-agregar {
    background: #fff;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    max-width: 750px;
    margin: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    transition: all 0.3s ease-in-out;
}
.row-form {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}
.form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
}
.form-group label {
    font-weight: bold;
    margin-bottom: 5px;
    color: #2c3e50;
}
.form-group input,
.form-group select {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s ease, box-shadow 0.3s ease;
}
.form-group input:focus,
.form-group select:focus {
    border-color: #007bff;
    outline: none;
    box-shadow: 0 0 5px rgba(0,123,255,0.3);
}
.form-group.full-width {
    flex: 100%;
}
.btn-submit {
    padding: 12px;
    background-color: #007bff;
    color: #fff;
    border: none;
    font-size: 16px;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    width: 100%;
    margin-top: 10px;
}
.btn-submit:hover {
    background-color: #0056b3;
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 5px 15px rgba(0,91,187,0.3);
}

/* ===================== TABLA DE TRABAJADORES ===================== */

/* Estilo del título de la tabla */
.titulo-tabla {
    display: block;
    text-align: center;
    font-size: 28px;
    font-weight: 700;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #2c3e50;
    margin: 25px auto 15px auto;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Contenedor centrado de la tabla */
.tabla-container {
    display: flex;
    justify-content: center; 
    margin: 20px auto;
    padding: 15px;
    max-width: 1000px; /* ancho más estándar */
    width: 100%;
    overflow-x: auto; /* evita que se descuadre en pantallas pequeñas */
}

/* Tabla */
.tabla-trabajadores {
    width: 100%;
    border-collapse: collapse;
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    font-size: 14px; /* más legible */
    box-shadow: 0px 2px 6px rgba(0,0,0,0.1);
}

/* Encabezado */
.tabla-trabajadores thead {
    background-color: #2c3e50;
    color: #fff;
    font-size: 15px;
    font-weight: bold;
}

/* Celdas */
.tabla-trabajadores th, 
.tabla-trabajadores td {
    padding: 10px 12px;
    text-align: center;
    border-bottom: 1px solid #ddd;
}

/* Filas alternadas */
.tabla-trabajadores tr:nth-child(even) {
    background-color: #f9fafb;
}

/* Hover sobre filas */
.tabla-trabajadores tr:hover {
    background-color: #eef2f6;
    transition: background 0.2s ease-in-out;
}

/* Texto cuando no hay datos */
.sin-datos {
    text-align: center;
    padding: 15px;
    font-size: 14px;
    color: #888;
}

/* ===================== RESPONSIVE FINAL ===================== */
@media (max-width: 1024px) {
    .tabla-trabajadores { font-size: 13px; }
    .form-container, .login-form { width: 90%; padding: 20px; }
    .home-container { padding: 30px 10px; }
    .modal .modal-content { width: 90%; padding: 20px; }
}

@media (max-width: 768px) {
    .navbar { flex-direction: column; align-items: flex-start; }
    .navbar-right { margin-top: 10px; }
    .login-image { display: none; }
    .login-form, .form-container { width: 95%; padding: 15px; }
    .tabla-trabajadores th, .tabla-trabajadores td { padding: 6px; font-size: 12px; }
    #btnNuevoTrabajador { display: block; width: 90%; margin: 10px auto; font-size: 14px; padding: 10px; }
    .modal .modal-content { width: 95%; max-height: 85vh; overflow-y: auto; }
}

@media (max-width: 480px) {
    .login-form h2, .form-container h2 { font-size: 20px; }
    .login-form input, .form-container input,
    .login-form button, .form-container button,
    #btnNuevoTrabajador { font-size: 13px; padding: 8px; }
    .tabla-trabajadores th, .tabla-trabajadores td { font-size: 10px; padding: 5px; }
    .home-container { padding: 20px 5px; }
    .modal .modal-content { padding: 15px; width: 95%; max-height: 80vh; }
}

/* ===================== BOTÓN NUEVO TRABAJADOR ESTÉTICO ===================== */
/* ===================== BOTÓN NUEVO TRABAJADOR - MINIMALISTA ===================== */
/* ===================== BOTÓN NUEVO TRABAJADOR TRANSPARENTE ===================== */
@media (max-width: 768px) {
    #nuevo-trabajador-btn {
        position: fixed;       /* Se mantiene flotando */
        bottom: 70px;          /* Separado del footer */
        right: 15px;           /* Separado del borde derecho */
        z-index: 9999;         /* Encima de navbar y contenido */
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;              /* Espacio entre + y texto */
        padding: 8px 14px;
        font-size: 14px;
        font-weight: 600;
        color: #2c3e50;        /* Color del texto */
        background: transparent; /* Sin fondo */
        border-radius: 8px;    /* Esquinas redondeadas */
        cursor: pointer;
        transition: all 0.2s ease;
    }
}


/* ===================== BOTONES GENERALES ===================== */
button,
.login-form button,
.form-container button,
.btn-submit,
.btn-tabla,
#modalActualizar .btn-submit,
#modalCrear .btn-submit {
    padding: 12px 18px;
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: #fff;
    border: none;
    cursor: pointer;
    border-radius: 10px;
    font-weight: bold;
    font-size: 16px;
    transition: all 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.25);
}
button:hover,
.login-form button:hover,
.form-container button:hover,
.btn-submit:hover,
.btn-tabla:hover,
#modalActualizar .btn-submit:hover,
#modalCrear .btn-submit:hover {
    background: linear-gradient(135deg, #1a252f, #2c3e50);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 15px rgba(0,0,0,0.35);
}
