/* General Styles */
:root {
    --bs-success-rgb: 71, 222, 152 !important;
}

html,
body {
    height: 100%;
    width: 100%;
}

main {
    height: 100%;
    display: flex;
    flex-flow: column;
}

#page-container {
    flex: 1 1 auto;
    overflow: auto;
}

#topNavBar {
    flex: 0 1 auto;
}

/* Estilos para imágenes en miniatura */
.thumbnail-img {
    width: 50px;
    height: 50px;
    margin: 2px;
}

/* Truncar texto en una línea */
.truncate-1 {
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
}

/* Truncar texto en tres líneas */
.truncate-3 {
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

/* Estilos para modales */
.modal-dialog.large {
    width: 80% !important;
    max-width: unset;
}

.modal-dialog.mid-large {
    width: 50% !important;
    max-width: unset;
}

@media (max-width: 720px) {
    .modal-dialog.large {
        width: 100% !important;
        max-width: unset;
    }

    .modal-dialog.mid-large {
        width: 100% !important;
        max-width: unset;
    }
}

/* Estilos para scrollbars */
::-webkit-scrollbar {
    width: 5px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Botón de eliminación de imágenes */
.img-del-btn {
    right: 2px;
    top: -3px;
}

.img-del-btn>.btn {
    font-size: 10px;
    padding: 0px 2px !important;
}

/* Ajustes para Select2 */
span.select2-container.select2-container--default.select2-container--open {
    z-index: 9999;
}

/* Ajustes para pantallas pequeñas */
@media (max-width: 767.98px) {
    .col-device {
        display: none;
    }

    #topNavBar > div > div {
        margin-top: 10px;
    }

    .swal2-container {
        padding: 0 !important;
    }

    .swal2-popup {
        max-width: 95vw !important;
        box-sizing: border-box;
        overflow-x: hidden !important;
        word-wrap: break-word;
    }

    .swal2-html-container {
        max-width: 100%;
        overflow-x: hidden !important;
        box-sizing: border-box;
    }

    .dropdown-menu {
        font-size: 14px;
    }
}

/* Estilos específicos para el menú de navegación */
#topNavBar .btn {
    background-color: transparent !important;
    box-shadow: none !important;
}

/* Limita el ancho y trunca el nombre del usuario en el navbar */
#topNavBar .btn-group .btn {
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
    vertical-align: middle;
}

/* Ajustar el tamaño del botón desplegable */
.btn-group .btn {
    padding: 0.5rem 1rem;
    font-size: 1rem;
}

/* Botones de fichaje */
.att_btn {
    border: none !important;
    border-radius: 20px !important;
    padding: 15px 20px !important;
    font-size: 22px !important;
    font-weight: bold !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* Sombra para darle profundidad */
    transition: background-color 0.3s ease, transform 0.2s ease; /* Animación */
}

/* Botón de Entrada */
.att_btn.entrada {
    background-color: #007bff !important; /* Azul */
    color: #fff !important; /* Texto blanco */
}

.att_btn.entrada:hover {
    background-color: #0056b3 !important; /* Azul más oscuro */
    transform: translateY(-2px); /* Efecto de elevación */
}

.att_btn.entrada:active {
    background-color: #004085 !important; /* Azul aún más oscuro */
    transform: translateY(0); /* Sin elevación */
}

/* Botón de Salida */
.att_btn.salida {
    background-color: #dc3545 !important; /* Rojo */
    color: #fff !important; /* Texto blanco */
}

.att_btn.salida:hover {
    background-color: #b02a37 !important; /* Rojo más oscuro */
    transform: translateY(-2px); /* Efecto de elevación */
}

.att_btn.salida:active {
    background-color: #842029 !important; /* Rojo aún más oscuro */
    transform: translateY(0); /* Sin elevación */
}

/* Botón de Salida a descanso */
.att_btn.descanso {
    background-color: #ffc107 !important; /* Amarillo */
    color: #000 !important; /* Texto negro */
}

.att_btn.descanso:hover {
    background-color: #e0a800 !important; /* Amarillo más oscuro */
    transform: translateY(-2px); /* Efecto de elevación */
}

.att_btn.descanso:active {
    background-color: #c69500 !important; /* Amarillo aún más oscuro */
    transform: translateY(0); /* Sin elevación */
}

/* Botón de Vuelta del descanso */
.att_btn.vuelta {
    background-color: #28a745 !important; /* Verde */
    color: #fff !important; /* Texto blanco */
}

.att_btn.vuelta:hover {
    background-color: #218838 !important; /* Verde más oscuro */
    transform: translateY(-2px); /* Efecto de elevación */
}

.att_btn.vuelta:active {
    background-color: #1e7e34 !important; 
    transform: translateY(0);
}

/* Estilos para la tabla de acumulados de horas para el admin */
#tablaEstadisticas th, #tablaEstadisticas td {
    vertical-align: middle !important;
    text-align: center;
}
#tablaEstadisticas th {
    background: #e3f0ff !important;
    color: #1a237e;
    font-size: 1.08rem;
    font-weight: 600;
    border-bottom: 2px solid #90caf9 !important;
}
#tablaEstadisticas tbody tr:hover {
    background: #f1f8ff;
}
#tablaEstadisticas .text-start {
    text-align: left !important;
}
.badge-horas {
    display: inline-block;
    min-width: 60px;
    font-size: 1.05rem;
    font-weight: 500;
    padding: 0.6em 1.1em;
    border-radius: 0.6em;
    letter-spacing: 0.5px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    text-align: center;
}
.badge-semana {
    background: #4ade80;
    color: #065f46;
}
.badge-mes {
    background: #06b6d4;
    color: #fff;
}
.badge-anio {
    background: #fbbf24;
    color: #7c4700;
}

/* Estilos para tipos de corrección en historial */
.tipo-eliminado {
    background: #ffeaea !important;
    color: #c62828 !important;
    font-weight: bold;
}
.tipo-creado {
    background: #eaffea !important;
    color: #388e3c !important;
    font-weight: bold;
}
.tipo-editado {
    background: #fffbe6 !important;
    color: #b28704 !important;
    font-weight: bold;
}

/* Mejorar el aspecto de la lista en móvil */
.fc .fc-list-table td, .fc .fc-list-table th {
    font-size: 1rem;
    padding: 0.75em 0.5em;
}
.fc .fc-list-event {
    border-radius: 8px;
    margin-bottom: 6px;
}
.fc .fc-toolbar-title {
    font-size: 1.2rem;
    text-transform: uppercase;
}

/* Evita el scroll lateral de la tabla de horas en móvil */
@media (max-width: 575.98px) {
    #tablaEstadisticas {
        max-width: 100% !important;
        width: 100% !important;
        min-width: 0 !important;
    }
    #tablaEstadisticas th, #tablaEstadisticas td {
        padding-left: 0.3em;
        padding-right: 0.3em;
        font-size: 0.97rem;
    }
    .table-responsive {
        overflow-x: visible !important;
    }
}

/* Estilos para el calendario de asistencia */
#calendarioAsistencia {
    width: 100%;
    min-width: 0;
    max-width: 100%;
}
.fc {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
}

/* Estilos generales para el formulario */
.swal2-container .form-group {
    text-align: left;
    margin-bottom: 1rem;
}

.swal2-container .form-label {
    font-weight: bold;
    margin-bottom: 0.5rem;
    display: block;
}

.swal2-container .form-control,
.swal2-container .form-select {
    width: 100%;
    padding: 0.5rem;
    font-size: 1rem;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.swal2-container .form-control:focus,
.swal2-container .form-select:focus {
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Ajustes para dispositivos móviles */
@media (max-width: 576px) {
    .swal2-container .form-group {
        margin-bottom: 0.75rem;
    }

    .swal2-container .form-label {
        font-size: 0.9rem;
    }

    .swal2-container .form-control,
    .swal2-container .form-select {
        font-size: 0.9rem;
        padding: 0.4rem;
    }
}