/**
 * Custom styles for Rieks Training Platform
 * Adds circular course images and other custom styling
 */

/* Make all course thumbnail images circular and consistent size */
.ed_mostrecomeded_course .ed_item_img {
    width: 270px;
    height: 270px;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
}

.ed_mostrecomeded_course .ed_item_img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* Ensure consistent sizing on mobile */
@media (max-width: 768px) {
    .ed_mostrecomeded_course .ed_item_img {
        width: 200px;
        height: 200px;
    }
}

/* Circular instructor photos */
.course_faculty img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

/* Course detail page - keep large image rectangular */
.ed_course_single_image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

/* Dashboard course cards - circular images */
.ed_inner_dashboard_info .ed_item_img {
    width: 270px;
    height: 270px;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
}

.ed_inner_dashboard_info .ed_item_img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* Completion history table images - small circular */
.table img {
    border-radius: 4px;
}

/* Hover effect for course images */
.ed_mostrecomeded_course .ed_item_img:hover img {
    transform: scale(1.05);
    transition: transform 0.3s ease;
}

/* Enhanced Breadcrumb Styling */
.breadcrumb {
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    flex-wrap: wrap !important;
}

.breadcrumb li {
    display: inline-flex;
    align-items: center;
    font-size: 14px;
}

.breadcrumb li a {
    color: #fff;
    text-decoration: none;
    transition: color 0.3s ease;
    padding: 5px 8px;
    border-radius: 4px;
}

.breadcrumb li a:hover {
    color: #ff9800;
    background: rgba(255, 255, 255, 0.1);
}

.breadcrumb li:last-child {
    color: #ff9800;
    font-weight: 500;
}

.breadcrumb li i.fa-chevron-left {
    margin: 0 8px;
    font-size: 10px;
    opacity: 0.7;
}

@media (max-width: 768px) {
    .breadcrumb {
        font-size: 12px;
    }
    .breadcrumb li i.fa-chevron-left {
        margin: 0 4px;
    }
}

/* Course Search Styling */
.course-search-container {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.course-search-input {
    width: 100%;
    padding: 12px 20px;
    font-size: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    outline: none;
    transition: border-color 0.3s ease;
}

.course-search-input:focus {
    border-color: #ff9800;
}

.course-search-btn {
    padding: 12px 30px;
    font-size: 16px;
    background: #ff9800;
    color: #fff;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: background 0.3s ease;
    margin-left: 10px;
}

.course-search-btn:hover {
    background: #e68900;
}

.search-results-count {
    margin-top: 15px;
    color: #666;
    font-size: 14px;
}

/* No results message */
.no-results {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.no-results i {
    font-size: 48px;
    color: #ddd;
    margin-bottom: 15px;
}

/* Course Category Badge */
.course-category-badge {
    display: inline-block;
    background: #4CAF50;
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 8px 0;
}

.course-category-badge.uncategorized {
    background: #999;
}

/* Course Rating Stars */
.course-rating {
    color: #ff9800;
    font-size: 14px;
    margin: 10px 0;
}

.course-rating i.fa-star {
    margin-right: 2px;
}

.course-rating .rating-count {
    color: #999;
    font-size: 12px;
    margin-left: 5px;
}

/* Review Section Styling */
.course-reviews {
    margin-top: 30px;
}

.review-item {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 15px;
    border-left: 4px solid #ff9800;
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.review-author {
    font-weight: bold;
    color: #333;
}

.review-date {
    color: #999;
    font-size: 12px;
}

.review-rating {
    color: #ff9800;
    font-size: 14px;
}

.review-text {
    color: #666;
    line-height: 1.6;
}

/* Review Form */
.review-form {
    background: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin-top: 20px;
}

.review-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    min-height: 100px;
    font-family: Arial, sans-serif;
    resize: vertical;
}

.rating-input {
    margin: 15px 0;
}

.rating-input label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

/* New Star Rating Input (Better UX) */
.star-rating-new {
    display: inline-flex;
    gap: 5px;
    font-size: 32px;
}

.star-rating-new input[type="radio"] {
    display: none;
}

.star-rating-new label {
    cursor: pointer;
    color: #ddd;
    transition: all 0.2s ease;
}

.star-rating-new label:hover {
    color: #ff9800;
    transform: scale(1.1);
}

/* Color stars up to and including the selected one */
.star-rating-new input:checked ~ label,
.star-rating-new label:hover,
.star-rating-new label:has(~ input:checked) {
    color: #ff9800;
}

/* For browsers that don't support :has(), use JavaScript alternative */
.star-rating-new input#star1:checked ~ label,
.star-rating-new input#star2:checked ~ label:nth-of-type(n+2),
.star-rating-new input#star3:checked ~ label:nth-of-type(n+3),
.star-rating-new input#star4:checked ~ label:nth-of-type(n+4),
.star-rating-new input#star5:checked ~ label:nth-of-type(n+5) {
    color: #ff9800;
}

/* Highlight all stars from 1 to selected */
.star-rating-new:has(#star1:checked) label:nth-of-type(-n+1),
.star-rating-new:has(#star2:checked) label:nth-of-type(-n+2),
.star-rating-new:has(#star3:checked) label:nth-of-type(-n+3),
.star-rating-new:has(#star4:checked) label:nth-of-type(-n+4),
.star-rating-new:has(#star5:checked) label:nth-of-type(-n+5) {
    color: #ff9800;
}

/* Old star rating (keep for backward compatibility) */
.star-rating {
    display: inline-flex;
    flex-direction: row-reverse;
    font-size: 24px;
}

.star-rating input[type="radio"] {
    display: none;
}

.star-rating label {
    color: #ddd;
    cursor: pointer;
    padding: 0 5px;
    transition: color 0.2s ease;
}

.star-rating label:hover,
.star-rating label:hover ~ label,
.star-rating input:checked ~ label {
    color: #ff9800;
}

/* Toast Notification System */
.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-left: 4px solid #333;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.toast-show {
    opacity: 1 !important;
    transform: translateX(0) !important;
}

.toast-exit {
    opacity: 0;
    transform: translateX(400px);
}

.toast-success { border-left-color: #28a745; }
.toast-error { border-left-color: #dc3545; }
.toast-warning { border-left-color: #ffc107; }
.toast-info { border-left-color: #17a2b8; }

.toast-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.toast-success .toast-icon { color: #28a745; }
.toast-error .toast-icon { color: #dc3545; }
.toast-warning .toast-icon { color: #ffc107; }
.toast-info .toast-icon { color: #17a2b8; }

.toast-message {
    flex: 1;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
}

.toast-close {
    background: none;
    border: none;
    font-size: 18px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.toast-close:hover {
    background: #f0f0f0;
    color: #333;
}

/* Loading Spinner */
.spinner-border {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    vertical-align: text-bottom;
    border: 0.15em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spinner-border 0.75s linear infinite;
}

.spinner-border-sm {
    width: 0.8rem;
    height: 0.8rem;
    border-width: 0.1em;
}

@keyframes spinner-border {
    to { transform: rotate(360deg); }
}

.ml-2 {
    margin-left: 0.5rem;
}

/* Mobile Responsiveness Improvements */
@media (max-width: 768px) {
    .toast-container {
        top: 60px;
        right: 10px;
        left: 10px;
        max-width: none;
    }

    .toast {
        font-size: 13px;
        padding: 12px 16px;
    }

    .toast-icon {
        font-size: 20px;
    }

    /* Mobile: Stack search and button vertically */
    .course-search-container .col-lg-9,
    .course-search-container .col-lg-3 {
        margin-top: 0 !important;
    }

    .course-search-btn {
        width: 100%;
        margin-left: 0;
        margin-top: 10px;
    }

    /* Mobile: Full width course cards */
    .ed_mostrecomeded_course {
        margin-bottom: 20px;
    }

    /* Mobile: Smaller category badges */
    .course-category-badge {
        font-size: 10px;
        padding: 3px 10px;
    }

    /* Mobile: Adjust rating display */
    .course-rating {
        font-size: 12px;
    }

    /* Mobile: Adjust breadcrumbs */
    .ed_pagetitle {
        padding: 40px 0 20px;
    }

    .page_title h2 {
        font-size: 24px;
    }
}

/* Course Detail Tabs */
.course-tabs {
    margin-top: 30px;
}

.course-tabs .nav-tabs {
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 30px;
    display: flex;
    gap: 0;
}

.course-tabs .nav-tabs li {
    margin-bottom: 0;
    flex: 1;
}

.course-tabs .nav-tabs a {
    display: block;
    padding: 15px 20px;
    text-align: center;
    text-decoration: none;
    color: #666;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 14px;
    letter-spacing: 0.5px;
    border: none;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    background: #f9f9f9;
}

.course-tabs .nav-tabs a:hover {
    color: #ff9800;
    background: #fff;
}

.course-tabs .nav-tabs a.active {
    color: #ff9800;
    border-bottom-color: #ff9800;
    background: #fff;
}

.course-tabs .tab-content {
    min-height: 300px;
}

.course-tabs .tab-pane {
    display: none;
}

.course-tabs .tab-pane.active {
    display: block;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Tab Content Styling */
.tab-overview-content {
    line-height: 1.8;
}

.tab-overview-content h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 24px;
}

.tab-overview-content p {
    color: #666;
    margin-bottom: 15px;
}

/* Curriculum Tab */
.curriculum-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.curriculum-list > li {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 15px;
    overflow: hidden;
}

.curriculum-chapter {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    background: #f9f9f9;
    font-weight: 600;
    color: #333;
    font-size: 16px;
}

.curriculum-chapter i {
    color: #ff9800;
    margin-right: 10px;
}

.curriculum-lessons {
    list-style: none;
    padding: 0;
    margin: 0;
}

.curriculum-lessons li {
    padding: 12px 20px 12px 50px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

.curriculum-lessons li:hover {
    background: #f9f9f9;
}

.curriculum-lessons li a {
    color: #666;
    text-decoration: none;
    flex: 1;
}

.curriculum-lessons li a:hover {
    color: #ff9800;
}

.lesson-status {
    font-size: 12px;
    padding: 4px 12px;
    border-radius: 12px;
    font-weight: 600;
}

.lesson-status.locked {
    background: #f8d7da;
    color: #721c24;
}

.lesson-status.active {
    background: #fff3cd;
    color: #856404;
}

.lesson-status.completed {
    background: #d4edda;
    color: #155724;
}

.lesson-status.completed i {
    color: #28a745;
}

@media (max-width: 768px) {
    .course-tabs .nav-tabs {
        flex-direction: column;
    }

    .course-tabs .nav-tabs a {
        font-size: 13px;
        padding: 12px 15px;
    }

    .curriculum-chapter {
        font-size: 14px;
        padding: 15px;
    }

    .curriculum-lessons li {
        padding: 10px 15px 10px 30px;
        font-size: 14px;
    }
}

/* Homepage H1 Styling */
.ed_heading_top h1 {
    font-size: 36px;
    color: #333;
    font-weight: 700;
    margin-bottom: 15px;
    text-align: center;
    line-height: 1.3;
}

.ed_heading_top h2 {
    font-size: 24px;
    color: #666;
    font-weight: 400;
    margin-top: 20px;
    margin-bottom: 10px;
    text-align: center;
}

@media (max-width: 768px) {
    .ed_heading_top h1 {
        font-size: 28px;
    }

    .ed_heading_top h2 {
        font-size: 20px;
    }
}

/* Page Title H1 Styling */
.page_title h1 {
    font-size: 42px;
    color: #fff;
    font-weight: 700;
    margin: 0;
    text-transform: capitalize;
}

@media (max-width: 768px) {
    .page_title h1 {
        font-size: 28px;
    }
}
