/* Estilos para la vista de índice de solicitudes */

/* Estilos mejorados para badges de estado - TAMAÑO ARMONIOSO */
.badge-pill {
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding: 4px 12px !important;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

.badge-pill i {
    font-size: 0.7rem;
    margin-right: 4px !important;
}

/* Estados con colores únicos y diferenciados de los días */
.badge-purple {
    background: linear-gradient(135deg, #6f42c1, #5a32a3);
    color: #fff;
    box-shadow: 0 1px 3px rgba(111, 66, 193, 0.3);
}

.badge-blue {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: #fff;
    box-shadow: 0 1px 3px rgba(52, 152, 219, 0.3);
}

.badge-green {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: #fff;
    box-shadow: 0 1px 3px rgba(46, 204, 113, 0.3);
}

.badge-gray {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    color: #fff;
    box-shadow: 0 1px 3px rgba(149, 165, 166, 0.3);
}

/* Mantener colores originales para días restantes (amarillo, naranja, rojo) */
.badge-warning {
    background: linear-gradient(135deg, #ffc107, #e6ac00);
    color: #fff;
    box-shadow: 0 1px 3px rgba(255, 193, 7, 0.3);
}

.badge-info {
    background: linear-gradient(135deg, #17a2b8, #138496);
    color: #fff;
    box-shadow: 0 1px 3px rgba(23, 162, 184, 0.3);
}

.badge-success {
    background: linear-gradient(135deg, #28a745, #1e7e34);
    color: #fff;
    box-shadow: 0 1px 3px rgba(40, 167, 69, 0.3);
}

.badge-secondary {
    background: linear-gradient(135deg, #6c757d, #545b62);
    color: #fff;
    box-shadow: 0 1px 3px rgba(108, 117, 125, 0.3);
}

/* Hover effects para badges - MÁS SUTIL */
.badge-pill:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* Mejoras para la tabla */
.table-hover tbody tr:hover {
    background-color: rgba(0, 123, 255, 0.05);
    transition: background-color 0.3s ease;
}

/* Estilos para filas de solicitudes cerradas */
.table tbody tr.solicitud-cerrada {
    background-color: rgba(248, 249, 250, 0.8);
    opacity: 0.85;
}

.table tbody tr.solicitud-cerrada:hover {
    background-color: rgba(248, 249, 250, 1);
    opacity: 1;
}

/* Estilos para días restantes */
.badge.bg-danger {
    background: linear-gradient(135deg, #dc3545, #bd2130) !important;
    animation: pulse-danger 2s infinite;
}

.badge.bg-warning {
    background: linear-gradient(135deg, #ffc107, #e6ac00) !important;
}

.badge.bg-success {
    background: linear-gradient(135deg, #28a745, #1e7e34) !important;
}

/* Estilos específicos para solicitudes vencidas */
.badge-pill:has(i.fa-exclamation-triangle) {
    animation: pulse-danger 2s infinite;
}

/* Badge para solicitudes finalizadas */
.badge:has(i.fa-check-circle) {
    background: linear-gradient(135deg, #6c757d, #545b62) !important;
    color: #fff;
}

/* Badge para solicitudes vencidas */
.badge:has(i.fa-exclamation-triangle) {
    background: linear-gradient(135deg, #dc3545, #bd2130) !important;
    color: #fff;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.4);
}

/* Mejoras generales para badges de tiempo */
.badge:has(i.fa-clock) {
    background: linear-gradient(135deg, #28a745, #1e7e34) !important;
    color: #fff;
}

/* Estilos para botones de seguridad deshabilitados */
.btn.disabled {
    cursor: not-allowed !important;
    opacity: 0.6;
    pointer-events: none;
}

.btn-outline-secondary.disabled {
    border-color: #dee2e6;
    color: #6c757d;
}

/* Alertas informativas en modales */
.modal-footer .alert {
    margin-bottom: 0;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    border-radius: 6px;
    max-width: 300px;
}

.modal-footer .alert-info {
    background-color: rgba(23, 162, 184, 0.1);
    border-color: rgba(23, 162, 184, 0.2);
    color: #0c5460;
}

/* Tooltips mejorados para seguridad */
.tooltip-inner {
    max-width: 250px;
    font-size: 0.8rem;
}

.timeline {
    position: relative;
    padding-left: 30px;
}

.timeline-item {
    position: relative;
}

.timeline-marker {
    position: absolute;
    left: -35px;
    top: 5px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.timeline-item:not(:last-child)::before {
    content: '';
    position: absolute;
    left: -31px;
    top: 15px;
    width: 2px;
    height: calc(100% + 15px);
    background-color: #e9ecef;
}

.evidencia-item {
    transition: all 0.2s ease;
}

.evidencia-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.evidencia-name {
    line-height: 1.2;
    word-break: break-word;
}

.evidencias-list {
    max-height: 400px;
    overflow-y: auto;
}

.evidencias-list::-webkit-scrollbar {
    width: 4px;
}

.evidencias-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.evidencias-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.evidencias-list::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.modal-xl {
    max-width: 1200px;
}

.card-header {
    border-bottom: 1px solid rgba(0,0,0,0.125);
}

.badge {
    font-size: 0.75em;
}

.border-left {
    border-left: 3px solid !important;
}

/* SOLUCIÓN MEJORADA PARA Z-INDEX DE MODALES */
.modal-backdrop {
    z-index: 1040 !important; /* Bootstrap estándar */
    background-color: rgba(0, 0, 0, 0.4) !important;
}

.modal {
    z-index: 1050 !important; /* Bootstrap estándar */
}

.modal-dialog {
    z-index: 1050 !important;
    position: relative;
}

.modal-content {
    z-index: 1050 !important;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5) !important;
    border: none;
    border-radius: 12px;
}

/* Forzar que todos los modales estén por encima pero sin interferir con sidebar */
.modal.show {
    z-index: 1050 !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.modal.show .modal-dialog {
    z-index: 1050 !important;
    position: relative;
    margin: auto;
}

.modal.show .modal-content {
    z-index: 1050 !important;
    position: relative;
}

/* Z-index apropiado para AdminLTE */
.wrapper {
    z-index: auto;
    position: relative;
}

.content-wrapper {
    z-index: auto;
    position: relative;
}

.main-sidebar {
    z-index: 1035 !important; /* Por encima del contenido, por debajo de modales */
}

.main-header {
    z-index: 1030 !important; /* AdminLTE estándar */
}

/* Modal de vista previa de imagen */
.image-preview-modal {
    z-index: 1055 !important; /* Ligeramente por encima de modales normales */
}

.image-preview-modal .modal-dialog {
    z-index: 1055 !important;
}

.image-preview-modal .modal-content {
    z-index: 1055 !important;
}

/* Tooltips por encima de todo */
.tooltip {
    z-index: 2000 !important;
}

/* Dropdowns y selects */
.dropdown-menu {
    z-index: 1500 !important;
}

/* Loading overlays */
.loading-overlay {
    z-index: 1200 !important;
}

/* Navbar AdminLTE - ya definido arriba */

/* Animación para el contador de caracteres */
.text-warning {
    animation: pulse-warning 1s ease-in-out infinite alternate;
}

@keyframes pulse-warning {
    from { opacity: 0.7; }
    to { opacity: 1; }
}

@keyframes pulse-danger {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

/* Estilos para header y footer del modal */
.modal-header {
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 10002 !important;
    position: relative;
}

.modal-footer {
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    z-index: 10002 !important;
    position: relative;
}

.modal-body {
    z-index: 10002 !important;
    position: relative;
    max-height: 80vh;
    overflow-y: auto;
}

/* SOLUCIÓN DEFINITIVA PARA SWEETALERT */
.swal2-container {
    z-index: 99999 !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
}

.swal2-popup {
    z-index: 100000 !important;
    position: relative !important;
}

.cerrar-solicitud-modal .swal2-popup {
    border-radius: 12px;
    padding: 1.5rem;
    z-index: 100000 !important;
    position: relative !important;
}

.cerrar-solicitud-modal .swal2-title {
    color: var(--clr-primary-text);
    font-size: 1.4rem;
    margin-bottom: 1rem;
}

.cerrar-solicitud-modal .swal2-html-container {
    margin: 0;
    padding: 0;
}

.cerrar-solicitud-modal textarea.form-control {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    transition: border-color 0.3s ease;
    font-size: 0.9rem;
    resize: vertical;
    min-height: 100px;
}

.cerrar-solicitud-modal textarea.form-control:focus {
    border-color: var(--clr-primary-button);
    box-shadow: 0 0 0 0.2rem rgba(26, 55, 102, 0.15);
    outline: none;
}

.cerrar-solicitud-modal .swal2-actions {
    margin-top: 1.5rem;
    gap: 0.5rem;
}

.cerrar-solicitud-modal .swal2-confirm {
    border-radius: 8px;
    padding: 0.6rem 1.5rem;
    font-weight: 500;
}

.cerrar-solicitud-modal .swal2-cancel {
    border-radius: 8px;
    padding: 0.6rem 1.5rem;
    font-weight: 500;
}
