/* LearnDash Reports Plugin Styles */

.ld-reports-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Courses Slider Styles */
.ld-reports-courses-slider h3 {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
    text-align: center;
}

.courses-wrapper {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding: 10px 0;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.courses-wrapper::-webkit-scrollbar {
    height: 8px;
}

.courses-wrapper::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.courses-wrapper::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

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

/* Course Card Styles */
.course-card {
    min-width: 280px;
    max-width: 320px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
}

.course-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: #007cba;
}

.course-card:active {
    transform: translateY(-2px);
}

.course-image {
    height: 160px;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.course-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.course-placeholder {
    font-size: 48px;
    color: rgba(255, 255, 255, 0.8);
}

.course-info {
    padding: 20px;
}

.course-info h4 {
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.course-progress {
    display: flex;
    align-items: center;
    gap: 10px;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #20c997);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 14px;
    font-weight: 600;
    color: #666;
    min-width: 40px;
    text-align: right;
}

/* Chart Container Styles */
.ld-reports-chart-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 30px;
    margin-top: 20px;
}

.chart-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.back-to-courses {
    background: #007cba;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.back-to-courses:hover {
    background: #005a87;
    transform: translateY(-1px);
}

.back-to-courses:active {
    transform: translateY(0);
}

#chart-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin: 0;
    cursor: pointer;
    transition: color 0.3s ease;
}

#chart-title:hover {
    color: #007cba;
}

.chart-wrapper {
    position: relative;
    height: 400px;
    margin-top: 20px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .ld-reports-container {
        padding: 15px;
    }
    
    .courses-wrapper {
        gap: 15px;
    }
    
    .course-card {
        min-width: 250px;
        max-width: 280px;
    }
    
    .course-info {
        padding: 15px;
    }
    
    .course-info h4 {
        font-size: 16px;
    }
    
    .ld-reports-chart-container {
        padding: 20px;
    }
    
    .chart-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .chart-wrapper {
        height: 300px;
    }
    
    #chart-title {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .ld-reports-container {
        padding: 10px;
    }
    
    .course-card {
        min-width: 220px;
        max-width: 250px;
    }
    
    .course-image {
        height: 120px;
    }
    
    .course-info {
        padding: 12px;
    }
    
    .course-info h4 {
        font-size: 15px;
        margin-bottom: 10px;
    }
    
    .ld-reports-chart-container {
        padding: 15px;
    }
    
    .chart-wrapper {
        height: 250px;
    }
}

/* Loading States */
.ld-reports-container.loading {
    opacity: 0.7;
    pointer-events: none;
}

.ld-reports-container.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Chart.js Customizations */
canvas#reports-chart {
    border-radius: 8px;
    background: #fafafa;
}

/* Accessibility */
.course-card:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

.back-to-courses:focus {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .ld-reports-container {
        max-width: none;
        padding: 0;
    }
    
    .back-to-courses {
        display: none;
    }
    
    .course-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .ld-reports-chart-container {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
