/**
 * Public styles for Reign TutorLMS Addon
 * 
 * Provides theme compatibility styling for TutorLMS
 */

/* Profile Tab Icons */
.youzify div.item-list-tabs li a#courses::before,
.youzify-group-navmenu li a#courses::before,
.youzify-group-navmenu li a#nav-courses::before {
    content: "\f19d"; /* Graduation cap icon */
}

.youzify-tabs-list-gradient a#courses::before {
    background: #ca6578;
    background: linear-gradient(to left, #ca6578, #f7792d);
    background: -webkit-linear-gradient(right, #ca6578, #f7792d);
}

/* Course Grid Layout in Profile Context */
.bp-user .tutor-courses,
.buddypress .bp-user .tutor-courses,
.peepso .tutor-courses,
.author .tutor-courses,
.ps-profile .tutor-courses,
#ps-profile .tutor-courses,
.ps-page-profile .tutor-courses {
    /* Ensure proper spacing in profile contexts */
}

/* Force 2 columns in profile contexts */
.bp-user .tutor-course-col-3,
.buddypress .bp-user .tutor-course-col-3,
.peepso .tutor-course-col-3,
.author .tutor-course-col-3,
.bp-user .tutor-col-3,
.buddypress .bp-user .tutor-col-3,
.peepso .tutor-col-3,
.author .tutor-col-3,
.ps-profile .tutor-course-col-3,
#ps-profile .tutor-course-col-3,
.ps-page-profile .tutor-course-col-3,
.ps-profile .tutor-col-3,
#ps-profile .tutor-col-3,
.ps-page-profile .tutor-col-3 {
    width: 50% !important;
    max-width: 50% !important;
    -ms-flex: 0 0 50% !important;
        flex: 0 0 50% !important;
}

.bp-user .tutor-course-col-4,
.buddypress .bp-user .tutor-course-col-4,
.peepso .tutor-course-col-4,
.author .tutor-course-col-4,
.bp-user .tutor-col-4,
.buddypress .bp-user .tutor-col-4,
.peepso .tutor-col-4,
.author .tutor-col-4,
.ps-profile .tutor-course-col-4,
#ps-profile .tutor-course-col-4,
.ps-page-profile .tutor-course-col-4,
.ps-profile .tutor-col-4,
#ps-profile .tutor-col-4,
.ps-page-profile .tutor-col-4 {
    width: 50% !important;
    max-width: 50% !important;
    -ms-flex: 0 0 50% !important;
        flex: 0 0 50% !important;
}

/* Also handle TutorLMS v2+ grid system */
.bp-user .tutor-courses-loop-wrap .tutor-col-lg-4,
.buddypress .bp-user .tutor-courses-loop-wrap .tutor-col-lg-4,
.peepso .tutor-courses-loop-wrap .tutor-col-lg-4,
.author .tutor-courses-loop-wrap .tutor-col-lg-4,
.ps-profile .tutor-courses-loop-wrap .tutor-col-lg-4,
#ps-profile .tutor-courses-loop-wrap .tutor-col-lg-4,
.ps-page-profile .tutor-courses-loop-wrap .tutor-col-lg-4 {
    width: 50% !important;
    max-width: 50% !important;
    -ms-flex: 0 0 50% !important;
        flex: 0 0 50% !important;
}

.bp-user .tutor-courses-loop-wrap .tutor-col-lg-3,
.buddypress .bp-user .tutor-courses-loop-wrap .tutor-col-lg-3,
.peepso .tutor-courses-loop-wrap .tutor-col-lg-3,
.author .tutor-courses-loop-wrap .tutor-col-lg-3,
.ps-profile .tutor-courses-loop-wrap .tutor-col-lg-3,
#ps-profile .tutor-courses-loop-wrap .tutor-col-lg-3,
.ps-page-profile .tutor-courses-loop-wrap .tutor-col-lg-3 {
    width: 50% !important;
    max-width: 50% !important;
    -ms-flex: 0 0 50% !important;
        flex: 0 0 50% !important;
}

/* Responsive adjustments for profile contexts */
@media (max-width: 768px) {
    .bp-user .tutor-course-col-2,
    .bp-user .tutor-course-col-3,
    .bp-user .tutor-course-col-4,
    .buddypress .bp-user .tutor-course-col-2,
    .buddypress .bp-user .tutor-course-col-3,
    .buddypress .bp-user .tutor-course-col-4,
    .peepso .tutor-course-col-2,
    .peepso .tutor-course-col-3,
    .peepso .tutor-course-col-4,
    .author .tutor-course-col-2,
    .author .tutor-course-col-3,
    .author .tutor-course-col-4 {
        width: 100%;
        max-width: 100%;
        -ms-flex: 0 0 100%;
            flex: 0 0 100%;
    }
}

/* Course card spacing in profiles */
.bp-user .tutor-course,
.buddypress .bp-user .tutor-course,
.peepso .tutor-course,
.author .tutor-course {
    margin-bottom: 20px;
}

/* Improve course card layout in narrow profile containers */
.bp-user .tutor-course-header,
.buddypress .bp-user .tutor-course-header,
.peepso .tutor-course-header,
.author .tutor-course-header {
    min-height: 180px;
}

.bp-user .tutor-course-body,
.buddypress .bp-user .tutor-course-body,
.peepso .tutor-course-body,
.author .tutor-course-body {
    padding: 15px;
}

/* Adjust font sizes in profile context for better readability */
.bp-user .tutor-course-header h3,
.buddypress .bp-user .tutor-course-header h3,
.peepso .tutor-course-header h3,
.author .tutor-course-header h3 {
    font-size: 16px;
    line-height: 1.4;
}

/* Course count display */
.reign-courses-count {
    margin-bottom: 20px;
    padding: 10px 15px;
    background: #f5f5f5;
    border-left: 3px solid #0073aa;
    font-weight: 600;
}

/* Progress bar styling */
.reign-course-progress-wrapper {
    margin-top: 10px;
}

.reign-progress-bar {
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 5px;
}

.reign-progress-fill {
    height: 100%;
    background: #4CAF50;
    transition: width 0.3s ease;
}

.reign-progress-bar.completed .reign-progress-fill {
    background: #4CAF50;
}

.reign-progress-bar.in-progress .reign-progress-fill {
    background: #2196F3;
}

.reign-progress-bar.not-started .reign-progress-fill {
    background: #ccc;
}

.reign-progress-text {
    font-size: 12px;
    color: #666;
}

/* Fallback: Force 2 columns when in any profile tab/section */
[class*="profile"] .tutor-course-col-3,
[class*="profile"] .tutor-course-col-4,
[class*="profile"] .tutor-col-3,
[class*="profile"] .tutor-col-4,
[id*="profile"] .tutor-course-col-3,
[id*="profile"] .tutor-course-col-4,
[id*="profile"] .tutor-col-3,
[id*="profile"] .tutor-col-4 {
    width: 50% !important;
    max-width: 50% !important;
    -ms-flex: 0 0 50% !important;
        flex: 0 0 50% !important;
}

/* Specific selector for TutorLMS courses tab in profiles */
.ps-profile__widget .tutor-course-col-3,
.ps-profile__widget .tutor-course-col-4,
.ps-profile__widget .tutor-col-3,
.ps-profile__widget .tutor-col-4 {
    width: 50% !important;
    max-width: 50% !important;
    -ms-flex: 0 0 50% !important;
        flex: 0 0 50% !important;
}