/**
 * LearnDash Stats Pro - Estilos
 * Diseño moderno y responsivo para las estadísticas
 */

/* === CONTENEDOR PRINCIPAL === */
.lds-user-stats-container,
.lds-ranking-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.lds-user-stats-container h2,
.lds-ranking-container h2 {
    font-size: 32px;
    margin-bottom: 30px;
    color: #2c3e50;
    text-align: center;
}

.lds-user-stats-container h3,
.lds-ranking-container h3 {
    font-size: 24px;
    margin-bottom: 20px;
    color: #34495e;
}

/* === TARJETAS DE ESTADÍSTICAS === */
.lds-stats-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.lds-stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 25px;
    color: white;
    display: flex;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.lds-stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.lds-stat-card:nth-child(2) {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.lds-stat-card:nth-child(3) {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.lds-stat-card:nth-child(4) {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.lds-stat-icon {
    font-size: 48px;
    margin-right: 20px;
}

.lds-stat-content h3 {
    margin: 0 0 5px 0;
    font-size: 36px;
    font-weight: 700;
    color: white;
}

.lds-stat-content p {
    margin: 0;
    font-size: 14px;
    opacity: 0.9;
}

/* === GRÁFICOS === */
.lds-chart-container {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 40px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.lds-chart-container canvas {
    max-height: 400px;
}

/* === TABLAS === */
.lds-course-stats,
.lds-recent-attempts {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.lds-stats-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.lds-stats-table thead {
    background: #f8f9fa;
}

.lds-stats-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
}

.lds-stats-table td {
    padding: 15px;
    border-bottom: 1px solid #dee2e6;
    color: #212529;
}

.lds-stats-table tbody tr:hover {
    background: #f8f9fa;
}

/* === BADGES === */
.lds-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.lds-badge-success {
    background: #d4edda;
    color: #155724;
}

.lds-badge-error {
    background: #f8d7da;
    color: #721c24;
}

/* === RANKING === */
.lds-ranking-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.lds-rank-item {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.lds-rank-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.lds-rank-item.lds-current-user {
    border: 2px solid #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
}

.lds-rank-position {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 20px;
}

.lds-medal {
    font-size: 40px;
}

.lds-position-number {
    font-size: 24px;
    font-weight: 700;
    color: #6c757d;
}

.lds-rank-avatar {
    margin-right: 20px;
}

.lds-rank-avatar img {
    border-radius: 50%;
    border: 3px solid #e9ecef;
}

.lds-rank-info {
    flex: 1;
}

.lds-rank-info h4 {
    margin: 0 0 5px 0;
    font-size: 20px;
    color: #2c3e50;
}

.lds-rank-stats {
    margin: 0;
    font-size: 14px;
    color: #6c757d;
}

.lds-rank-points {
    text-align: center;
    margin-left: 20px;
}

.lds-points-badge {
    display: block;
    font-size: 28px;
    font-weight: 700;
    color: #667eea;
}

.lds-rank-points small {
    font-size: 12px;
    color: #6c757d;
    text-transform: uppercase;
}

/* === RESPONSIVO === */
@media (max-width: 768px) {
    .lds-stats-summary {
        grid-template-columns: 1fr;
    }
    
    .lds-rank-item {
        flex-wrap: wrap;
        padding: 15px;
    }
    
    .lds-rank-position {
        width: 50px;
        height: 50px;
    }
    
    .lds-medal {
        font-size: 32px;
    }
    
    .lds-rank-info h4 {
        font-size: 16px;
    }
    
    .lds-rank-stats {
        font-size: 12px;
    }
    
    .lds-stats-table {
        font-size: 14px;
    }
    
    .lds-stats-table th,
    .lds-stats-table td {
        padding: 10px;
    }
}

@media (max-width: 480px) {
    .lds-user-stats-container,
    .lds-ranking-container {
        padding: 10px;
    }
    
    .lds-stat-card {
        padding: 15px;
    }
    
    .lds-stat-icon {
        font-size: 36px;
        margin-right: 15px;
    }
    
    .lds-stat-content h3 {
        font-size: 28px;
    }
    
    .lds-chart-container,
    .lds-course-stats,
    .lds-recent-attempts {
        padding: 15px;
    }
}

/* === ANIMACIONES === */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.lds-stat-card,
.lds-rank-item {
    animation: fadeIn 0.5s ease-out;
}

.lds-stat-card:nth-child(2) {
    animation-delay: 0.1s;
}

.lds-stat-card:nth-child(3) {
    animation-delay: 0.2s;
}

.lds-stat-card:nth-child(4) {
    animation-delay: 0.3s;
}

/* === RENDIMIENTO POR QUIZ === */
.lds-quiz-performance-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.lds-quiz-performance-container h2 {
    font-size: 32px;
    margin-bottom: 30px;
    color: #2c3e50;
    text-align: center;
}

/* Filtros */
.lds-quiz-filters {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
}

.lds-filter-btn {
    padding: 10px 20px;
    border: 2px solid #e9ecef;
    background: white;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.3s ease;
}

.lds-filter-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.lds-filter-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: white;
}

/* Grid de tarjetas de quiz */
.lds-quiz-performance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

/* Tarjeta individual de quiz */
.lds-quiz-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border-left: 5px solid #667eea;
    animation: fadeIn 0.5s ease-out;
}

.lds-quiz-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.12);
}

.lds-quiz-card.passed {
    border-left-color: #4CAF50;
}

.lds-quiz-card.failed {
    border-left-color: #f5576c;
}

/* Header de la tarjeta */
.lds-quiz-header {
    margin-bottom: 20px;
}

.lds-quiz-header h3 {
    font-size: 18px;
    color: #2c3e50;
    margin: 0 0 8px 0;
    line-height: 1.4;
}

.lds-course-tag {
    display: inline-block;
    padding: 4px 12px;
    background: #f8f9fa;
    border-radius: 15px;
    font-size: 12px;
    color: #6c757d;
    font-weight: 500;
}

/* Grid de estadísticas dentro de la tarjeta */
.lds-quiz-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.lds-stat-item {
    text-align: center;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 10px;
}

.lds-stat-label {
    display: block;
    font-size: 12px;
    color: #6c757d;
    margin-bottom: 5px;
    text-transform: uppercase;
    font-weight: 600;
}

.lds-stat-value {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: #2c3e50;
}

/* Barra de progreso */
.lds-quiz-progress {
    margin-bottom: 20px;
}

.lds-progress-bar {
    height: 8px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
}

.lds-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    transition: width 0.5s ease;
}

.lds-quiz-card.passed .lds-progress-fill {
    background: linear-gradient(90deg, #4CAF50 0%, #43e97b 100%);
}

/* Detalles del quiz */
.lds-quiz-details {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
}

.lds-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
    color: #495057;
}

.lds-detail-row:not(:last-child) {
    border-bottom: 1px solid #e9ecef;
}

.lds-detail-row.lds-improvement {
    background: rgba(76, 175, 80, 0.1);
    margin: 5px -15px;
    padding: 8px 15px;
    border-radius: 5px;
}

.lds-positive {
    color: #4CAF50;
}

/* Container del mini gráfico */
.lds-quiz-chart-container {
    height: 120px;
    margin-bottom: 15px;
    padding: 10px;
    background: white;
    border-radius: 10px;
}

.lds-mini-chart {
    max-height: 100px;
}

/* Acciones y badges */
.lds-quiz-actions {
    display: flex;
    justify-content: center;
}

.lds-action-badge {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.lds-action-badge.lds-passed {
    background: #d4edda;
    color: #155724;
}

.lds-action-badge.lds-not-passed {
    background: #f8d7da;
    color: #721c24;
}

/* Estado vacío */
.lds-empty-state {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.lds-empty-icon {
    font-size: 80px;
    margin-bottom: 20px;
}

.lds-empty-state p {
    font-size: 16px;
    color: #6c757d;
    margin: 10px 0;
}

.lds-empty-state p:first-of-type {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
}

/* Responsivo para quiz performance */
@media (max-width: 768px) {
    .lds-quiz-performance-grid {
        grid-template-columns: 1fr;
    }
    
    .lds-quiz-filters {
        flex-wrap: wrap;
    }
    
    .lds-filter-btn {
        padding: 8px 16px;
        font-size: 13px;
    }
    
    .lds-quiz-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .lds-stat-value {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .lds-quiz-card {
        padding: 20px 15px;
    }
    
    .lds-quiz-header h3 {
        font-size: 16px;
    }
}
