/* Estilos específicos para reportes - Mejoras adicionales */

/* Animaciones para las tarjetas de resumen */
.summary-card {
    animation: slideInUp 0.6s ease-out;
}

.summary-card:nth-child(1) { animation-delay: 0.1s; }
.summary-card:nth-child(2) { animation-delay: 0.2s; }
.summary-card:nth-child(3) { animation-delay: 0.3s; }
.summary-card:nth-child(4) { animation-delay: 0.4s; }

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Efectos hover mejorados para las tarjetas */
.summary-card:hover .card-icon {
    transform: scale(1.1) rotate(5deg);
    transition: transform 0.3s ease;
}

.summary-card:hover .card-content h4 {
    color: #1976D2;
    transition: color 0.3s ease;
}

/* Mejoras para la tabla de ranking */
.ranking-table tbody tr {
    transition: all 0.3s ease;
}

.ranking-table tbody tr:hover {
    background: linear-gradient(135deg, rgba(103, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    transform: scale(1.02);
}

/* Estilo para el botón de exportación cuando está procesando */
.btn.loading {
    position: relative;
    pointer-events: none;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    margin: auto;
    border: 2px solid transparent;
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Mejoras para alertas */
.alert {
    animation: fadeInLeft 0.5s ease-out;
    border-left: 4px solid;
}

.alert-warning { border-left-color: #ff9800; }
.alert-danger { border-left-color: #f44336; }
.alert-success { border-left-color: #4caf50; }

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Tooltips para mejor UX */
.tooltip {
    position: relative;
    cursor: pointer;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.tooltip:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Mejoras para dispositivos móviles */
@media (max-width: 768px) {
    .chart-container canvas {
        max-width: 200px;
        max-height: 150px;
    }
    
    .summary-grid {
        gap: 0.75rem;
    }
    
    .summary-card {
        padding: 1rem;
    }
    
    .card-content h4 {
        font-size: 1.5rem;
    }
    
    .report-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .report-actions .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
}

/* Estado de carga para el contenido de reportes */
.reports-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 300px;
    flex-direction: column;
    gap: 1rem;
}

.reports-loading .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.reports-loading p {
    color: #5a6c7d;
    font-size: 1rem;
}

/* Print styles para PDF */
@media print {
    .report-actions {
        display: none !important;
    }
    
    .summary-card,
    .report-section {
        break-inside: avoid;
        margin-bottom: 1rem;
    }
    
    .reports-grid {
        display: block;
    }
    
    .chart-container canvas {
        max-width: 300px;
        max-height: 250px;
    }
}

/* Mejoras de accesibilidad */
.summary-card:focus,
.btn:focus {
    outline: 2px solid #2196F3;
    outline-offset: 2px;
}

/* Transiciones suaves para cambios de estado */
* {
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}