/**
 * Public Styles - Control de Asistencias y Ausencias LFT
 * Estilos para el frontend (empleados y autorizadores)
 */

/* ============================================
   RESET Y BASE
   ============================================ */
.asistencia-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ============================================
   TABLA DEL AUTORIZADOR
   ============================================ */
.tabla-autorizador {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.tabla-autorizador th {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: white;
    padding: 14px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    border: none;
}

.tabla-autorizador td {
    padding: 12px;
    border-bottom: 1px solid #eaeaea;
    vertical-align: middle;
    font-size: 14px;
}

.tabla-autorizador tr:hover {
    background-color: #f8f9fa;
}

.tabla-autorizador tr:last-child td {
    border-bottom: none;
}

/* ============================================
   FILTROS
   ============================================ */
.filtros-container {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    border: 1px solid #eaeaea;
}

.filtros-titulo {
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
    margin-bottom: 20px;
    font-size: 1.3rem;
    font-weight: 600;
}

/* ============================================
   BOTONES DE EVIDENCIA
   ============================================ */
.evidencia-btn {
    background: linear-gradient(135deg, #28a745, #20c997);
    border: none;
    color: white;
    padding: 6px 12px;
    border-radius: 5px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

.evidencia-btn:hover {
    background: linear-gradient(135deg, #20c997, #17a2b8);
    color: white;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(40, 167, 69, 0.3);
}

/* ============================================
   PAGINACIÓN
   ============================================ */
.pagination-container {
    margin-top: 30px;
    text-align: center;
}

.pagination {
    display: inline-flex;
    gap: 5px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.page-item {
    display: inline-block;
}

.page-link {
    display: block;
    padding: 8px 12px;
    color: #3498db;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    text-decoration: none;
    transition: all 0.3s;
}

.page-link:hover {
    background: #e9ecef;
    border-color: #dee2e6;
    color: #2980b9;
}

.page-item.active .page-link {
    background-color: #3498db;
    border-color: #3498db;
    color: white;
}

.page-item.disabled .page-link {
    color: #6c757d;
    pointer-events: none;
    background-color: #fff;
    border-color: #dee2e6;
}

/* ============================================
   FORMULARIOS
   ============================================ */
.form-control, .form-select {
    border: 2px solid #eaeaea;
    border-radius: 8px;
    padding: 10px 15px;
    transition: all 0.3s ease;
    width: 100%;
    font-size: 14px;
}

.form-control:focus, .form-select:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.form-label {
    font-weight: 600;
    margin-bottom: 8px;
    display: block;
    color: #2c3e50;
}

.input-group {
    display: flex;
    align-items: stretch;
}

.input-group-text {
    display: flex;
    align-items: center;
    padding: 0 12px;
    background: #f8f9fa;
    border: 2px solid #eaeaea;
    border-radius: 8px 0 0 8px;
    color: #6c757d;
}

.input-group .form-control {
    border-radius: 0 8px 8px 0;
    border-left: none;
}

/* ============================================
   BOTONES PRINCIPALES
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    font-weight: 500;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2980b9, #1c5a7a);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(41, 128, 185, 0.3);
}

.btn-success {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
}

.btn-success:hover {
    background: linear-gradient(135deg, #20c997, #17a2b8);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #c82333, #bd2130);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(220, 53, 69, 0.3);
}

.btn-secondary {
    background: linear-gradient(135deg, #6c757d, #5a6268);
    color: white;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #5a6268, #4e555b);
    transform: translateY(-2px);
}

.btn-sm {
    padding: 5px 12px;
    font-size: 0.85rem;
}

.btn-lg {
    padding: 12px 30px;
    font-size: 1.1rem;
}

/* ============================================
   FORMULARIO DE SOLICITUD
   ============================================ */
.formulario-solicitud-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.formulario-solicitud-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

@media (min-width: 992px) {
    .formulario-solicitud-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.formulario-section {
    background: #fff;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border: 1px solid #eaeaea;
}

.formulario-section h3 {
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
    margin-bottom: 20px;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-cargar-archivo {
    width: 100%;
    padding: 15px;
    border: 2px dashed #3498db;
    background: #f8fafc;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #3498db;
    font-weight: 500;
    text-align: center;
}

.btn-cargar-archivo:hover {
    background: #ebf5ff;
    border-color: #2980b9;
}

.btn-cargar-archivo i {
    font-size: 24px;
    margin-bottom: 8px;
}

.archivo-info {
    margin-top: 15px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #28a745;
}

.archivo-info.error {
    border-left-color: #dc3545;
    background: #fff5f5;
}

.archivo-nombre {
    font-weight: 600;
    color: #2c3e50;
    word-break: break-all;
}

.archivo-tamano {
    color: #6c757d;
    font-size: 0.9em;
}

.exclusion-dias {
    background: #f8fafc;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #eaeaea;
    margin-top: 15px;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.form-check-input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.form-check-label {
    color: #495057;
    font-weight: 500;
    cursor: pointer;
}

/* ============================================
   CARD DE SALDO (shortcode mi_saldo_vacaciones)
   ============================================ */
.asistencia-saldo-container {
    margin: 20px 0;
}

.asistencia-saldo-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    overflow: hidden;
}

.asistencia-saldo-header {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.asistencia-saldo-header i {
    font-size: 1.8rem;
}

.asistencia-saldo-header h3 {
    margin: 0;
    font-size: 1.3rem;
}

.asistencia-saldo-body {
    padding: 20px;
}

.asistencia-saldo-actual {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 20px;
}

.saldo-label {
    font-size: 1rem;
    color: #6c757d;
    display: block;
    margin-bottom: 10px;
}

.saldo-valor {
    font-size: 2rem;
    font-weight: bold;
}

.saldo-valor.positivo {
    color: #28a745;
}

.saldo-valor.cero {
    color: #6c757d;
}

.saldo-valor.negativo {
    color: #dc3545;
}

.asistencia-saldo-detalle {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eaeaea;
}

.asistencia-saldo-detalle p {
    margin: 8px 0;
}

.asistencia-saldo-alerta {
    margin-top: 15px;
    padding: 10px;
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    border-radius: 4px;
    color: #856404;
}

/* ============================================
   CARDS PARA MÓVIL (Solicitudes)
   ============================================ */
.solicitudes-cards {
    display: none;
}

.solicitud-card {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    margin-bottom: 15px;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.solicitud-card-header {
    background: #f8f9fa;
    padding: 12px 15px;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.solicitud-card-id {
    font-weight: bold;
    color: #000;
    font-size: 16px;
}

.solicitud-card-badge {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 12px;
}

.badge.bg-warning {
    background: #ffc107;
    color: #000;
}

.badge.bg-success {
    background: #28a745;
    color: #fff;
}

.badge.bg-danger {
    background: #dc3545;
    color: #fff;
}

.badge.bg-primary {
    background: #3498db;
    color: #fff;
}

.solicitud-card-body {
    padding: 15px;
}

.solicitud-card-field {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f0f0;
}

.solicitud-card-label {
    font-weight: 600;
    color: #495057;
    font-size: 14px;
}

.solicitud-card-value {
    color: #000;
    text-align: right;
    font-size: 14px;
}

.solicitud-card-actions {
    padding: 15px;
    border-top: 1px solid #dee2e6;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.solicitud-card-motivo {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 4px;
    margin-top: 10px;
    font-size: 13px;
}

/* ============================================
   MODALES
   ============================================ */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    padding-top: 80px !important;
}

.modal-dialog {
    max-width: 600px;
    margin: 80px auto 0;
    position: relative;
}

.modal-lg {
    max-width: 800px;
}

.modal-content {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    z-index: 99999;
}

.modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header.bg-primary {
    background: #3498db;
}

.modal-header.bg-danger {
    background: #dc3545;
}

.modal-header.bg-warning {
    background: #ffc107;
}

.modal-header .text-white {
    color: #fff;
}

.modal-title {
    margin: 0;
    font-size: 1.2rem;
}

.btn-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
}

.btn-close-white {
    color: #fff;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #dee2e6;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 99998;
}

/* ============================================
   ALERTAS
   ============================================ */
.alert {
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid;
}

.alert-success {
    background: #d4edda;
    border-left-color: #28a745;
    color: #155724;
}

.alert-danger {
    background: #f8d7da;
    border-left-color: #dc3545;
    color: #721c24;
}

.alert-warning {
    background: #fff3cd;
    border-left-color: #ffc107;
    color: #856404;
}

.alert-info {
    background: #d1ecf1;
    border-left-color: #17a2b8;
    color: #0c5460;
}

.alert-dismissible {
    position: relative;
    padding-right: 40px;
}

.alert-dismissible .btn-close {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
}

/* ============================================
   UTILIDADES
   ============================================ */
.container {
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
    margin-right: auto;
    margin-left: auto;
}

.container-fluid {
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
    margin-right: auto;
    margin-left: auto;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -15px;
    margin-left: -15px;
}

.col-12 {
    flex: 0 0 100%;
    max-width: 100%;
    padding-right: 15px;
    padding-left: 15px;
}

.text-center {
    text-align: center;
}

.text-muted {
    color: #6c757d;
}

.d-none {
    display: none;
}

.d-flex {
    display: flex;
}

.gap-2 {
    gap: 8px;
}

.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 24px; }
.m-0 { margin: 0; }
.p-0 { padding: 0; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .table-responsive {
        display: none;
    }
    
    .solicitudes-cards {
        display: block;
    }
    
    .filtros-container {
        padding: 15px;
    }
    
    .row {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .formulario-section {
        padding: 20px;
    }
    
    .asistencia-saldo-actual {
        padding: 15px;
    }
    
    .saldo-valor {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .solicitud-card-field {
        flex-direction: column;
        text-align: left;
    }
    
    .solicitud-card-value {
        text-align: left;
        margin-top: 2px;
    }
    
    .solicitud-card-actions {
        flex-direction: column;
    }
    
    .solicitud-card-actions .btn {
        width: 100%;
        margin-bottom: 5px;
    }
    
    .modal-dialog {
        margin: 80px 15px 0;
        max-width: calc(100% - 30px);
    }
    
    .filtros-container .row {
        gap: 10px;
    }
}

/* ============================================
   ANIMACIONES
   ============================================ */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.alert, .modal-content {
    animation: fadeIn 0.3s ease;
}

.btn {
    position: relative;
    overflow: hidden;
}

.btn:after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

.btn:active:after {
    width: 100%;
    height: 100%;
    padding-top: 100%;
}