/* ============================================
   MEJORAS ESTÉTICAS Y ANIMACIONES
   ============================================ */

/* Animaciones de entrada */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Loading skeleton */
@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.skeleton {
    background: linear-gradient(90deg, 
        var(--bg-tertiary) 25%, 
        var(--bg-secondary) 50%, 
        var(--bg-tertiary) 75%
    );
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 8px;
}

/* Aplicar animaciones a elementos */
.fade-in {
    animation: fadeIn 0.5s ease-out;
}

.slide-in {
    animation: slideIn 0.4s ease-out;
}

.scale-in {
    animation: scaleIn 0.3s ease-out;
}

/* Cards mejoradas */
.card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

/* Glassmorphism para modales */
.modal {
    backdrop-filter: blur(8px);
    background: rgba(0, 0, 0, 0.5);
}

.modal-content {
    animation: scaleIn 0.3s ease-out;
}

/* Botones mejorados */
.btn {
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn:active {
    transform: translateY(0);
}

/* Tablas mejoradas */
.dataTable tbody tr {
    transition: all 0.2s ease;
}

.dataTable tbody tr:hover {
    background: linear-gradient(90deg, 
        var(--bg-tertiary) 0%, 
        rgba(212, 175, 55, 0.1) 50%, 
        var(--bg-tertiary) 100%
    );
    transform: scale(1.01);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Zebra striping sutil */
.dataTable tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

/* Inputs mejorados */
.form-control {
    transition: all 0.3s ease;
}

.form-control:focus {
    transform: scale(1.02);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2);
}

/* Badges con gradiente */
.badge {
    background: linear-gradient(135deg, var(--badge-color-1), var(--badge-color-2));
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.badge-success {
    --badge-color-1: #10b981;
    --badge-color-2: #059669;
}

.badge-warning {
    --badge-color-1: #f59e0b;
    --badge-color-2: #d97706;
}

.badge-info {
    --badge-color-1: #3b82f6;
    --badge-color-2: #2563eb;
}

.badge-danger {
    --badge-color-1: #ef4444;
    --badge-color-2: #dc2626;
}

/* Loading spinner global */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.2s ease-out;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(212, 175, 55, 0.2);
    border-top-color: var(--secondary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Mensajes de éxito/error mejorados */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 10001;
    animation: slideIn 0.3s ease-out;
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 300px;
}

.toast-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.toast-error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.toast-info {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

/* Gráficos del dashboard */
.chart-container {
    position: relative;
    animation: fadeIn 0.6s ease-out;
}

/* Stats cards con gradiente */
.stat-card {
    background: linear-gradient(135deg, 
        var(--bg-secondary) 0%, 
        var(--bg-tertiary) 100%
    );
    border-left: 4px solid var(--secondary);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 8px 16px rgba(212, 175, 55, 0.2);
    border-left-width: 6px;
}

/* Iconos con pulso */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.icon-pulse {
    animation: pulse 2s infinite;
}

/* Scroll suave */
html {
    scroll-behavior: smooth;
}

/* Scrollbar personalizada */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

::-webkit-scrollbar-thumb {
    background: var(--secondary);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #d4af37;
}

/* Validación de formularios */
.form-control.is-invalid {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

.form-control.is-valid {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.invalid-feedback {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: none;
}

.form-control.is-invalid ~ .invalid-feedback {
    display: block;
    animation: slideIn 0.2s ease-out;
}

/* Floating labels */
.form-floating {
    position: relative;
}

.form-floating label {
    position: absolute;
    top: 50%;
    left: 1rem;
    transform: translateY(-50%);
    transition: all 0.2s ease;
    pointer-events: none;
    color: var(--text-muted);
}

.form-floating input:focus ~ label,
.form-floating input:not(:placeholder-shown) ~ label {
    top: 0;
    font-size: 0.75rem;
    background: var(--bg-secondary);
    padding: 0 0.5rem;
    color: var(--secondary);
}

/* Breadcrumbs */
.breadcrumb {
    display: flex;
    gap: 0.5rem;
    padding: 1rem 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.breadcrumb-item:not(:last-child)::after {
    content: '/';
    margin-left: 0.5rem;
    color: var(--text-muted);
}

.breadcrumb-item.active {
    color: var(--secondary);
    font-weight: 500;
}

/* Responsive mejoras */
@media (max-width: 768px) {
    .card:hover {
        transform: none;
    }
    
    .stat-card:hover {
        transform: none;
    }
}
