/**
 * Estilos personalizados para Alumigonza
 */

/* Animaciones */
@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fade-out {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

.animate-fade-in {
    animation: fade-in 0.3s ease-out;
}

.animate-fade-out {
    animation: fade-out 0.3s ease-out;
}

/* Transiciones suaves */
.transition-all {
    transition: all 0.3s ease;
}

/* Cards */
.card-stat {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-stat:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Botones */
.btn-primary,
.btn-export {
    transition: all 0.2s ease;
}

.btn-primary:hover,
.btn-export:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.btn-primary:active,
.btn-export:active {
    transform: translateY(0);
}

/* Tablas */
table {
    border-collapse: separate;
    border-spacing: 0;
}

tbody tr {
    transition: background-color 0.2s ease;
}

tbody tr:hover {
    background-color: #f9fafb;
}

/* Tabs */
.nav-tab {
    position: relative;
    transition: all 0.2s ease;
}

.nav-tab::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: transparent;
    transition: background 0.2s ease;
}

/* Inputs */
.input-date,
input[type="text"],
input[type="search"] {
    transition: all 0.2s ease;
}

.input-date:focus,
input[type="text"]:focus,
input[type="search"]:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Estados de conciliación */
.estado-cuadrado {
    color: #10b981;
    background-color: #d1fae5;
}

.estado-advertencia {
    color: #f59e0b;
    background-color: #fef3c7;
}

.estado-pendiente {
    color: #ef4444;
    background-color: #fee2e2;
}

/* Progress bars */
.progress-bar {
    height: 8px;
    border-radius: 9999px;
    background-color: #e5e7eb;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    transition: width 0.3s ease;
    border-radius: 9999px;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
}

/* Scrollbar personalizado */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

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

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 5px;
}

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

/* Responsive */
@media (max-width: 768px) {
    .nav-tab {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
    
    .card-stat {
        padding: 1rem;
    }
    
    table {
        font-size: 0.875rem;
    }
    
    th, td {
        padding: 0.75rem 0.5rem !important;
    }
}

/* Loading spinner */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.fa-spin {
    animation: spin 1s linear infinite;
}

/* Tooltips */
[data-tooltip] {
    position: relative;
    cursor: help;
}

[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 0.75rem;
    background: #1f2937;
    color: white;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 0.5rem;
}

/* Modales */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.modal-content {
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-width: 90%;
    max-height: 90vh;
    overflow: auto;
}

/* Comparación de elementos */
.elemento-diferencia {
    background-color: #fef3c7;
    border-left: 4px solid #f59e0b;
}

.elemento-correcto {
    background-color: #d1fae5;
    border-left: 4px solid #10b981;
}

.elemento-faltante {
    background-color: #fee2e2;
    border-left: 4px solid #ef4444;
}

/* Print styles */
@media print {
    header, nav, footer, .btn-primary, .btn-export {
        display: none;
    }
    
    .seccion {
        display: block !important;
    }
    
    table {
        page-break-inside: auto;
    }
    
    tr {
        page-break-inside: avoid;
        page-break-after: auto;
    }
}
