/* eLearning Courses Manager - Frontend Styles */
/* Version: 1.0.4 */

.elearning-courses-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Filter Menu */
.filter-menu {
    display: flex;
    justify-content: center;
    gap: 10px;
    background: #fff;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 12px 25px;
    background: #ecf0f1;
    border: none;
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn.active {
    background: #D6840E;
    color: #fff;
}

.filter-btn:hover:not(.active) {
    background: #d5dbdd;
}

/* Courses Wrapper */
.courses-wrapper {
    display: flex;
    gap: 25px;
}

/* Filter Sidebar */
.filter-sidebar {
    flex: 0 0 260px;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    padding: 20px;
    height: fit-content;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.filter-sidebar h3 {
    margin-bottom: 20px;
    color: #333;
    font-size: 1.2rem;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.filter-dropdown {
    margin-bottom: 20px;
    width: 100%;
}

.filter-dropdown label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
    font-size: 14px;
}

.filter-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    font-size: 14px;
    color: #333;
    cursor: pointer;
}

.filter-select:focus {
    outline: none;
    border-color: #D6840E;
}

/* Clear Filters Button */
.clear-filters-btn {
    width: 100%;
    padding: 10px 12px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    color: #555;
    cursor: pointer;
    margin-top: 10px;
    transition: all 0.2s ease;
}

.clear-filters-btn:hover {
    background: #e9ecef;
    border-color: #D6840E;
    color: #D6840E;
}

/* Courses Container */
.courses-container {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 25px;
}

/* Course Card */
.course-card {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
}

.course-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.course-image {
    height: 170px;
    background-size: cover;
    background-position: center;
    position: relative;
    flex-shrink: 0; /* Prevent image from stretching */
}

.course-title-overlay {
    position: absolute;
    bottom: 0;
    width: 100%;
    background: rgba(0,0,0,0.6);
    color: #fff;
    padding: 10px 12px;
    font-weight: 600;
    font-size: 15px;
    line-height: 1.3;
}

.course-price {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #D6840E;
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 12px;
    z-index: 2;
}

.course-type, .course-category {
    color: #D6840E;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.course-body {
    padding: 15px;
    flex-grow: 1;
}

.course-meta {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: #555;
    margin-bottom: 8px;
}

.course-meta i {
    color: #f7941d;
    margin-right: 8px;
    width: 16px;
    text-align: center;
}

.course-excerpt {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
}

.course-footer {
    padding: 15px;
    text-align: center;
    position: relative;
    border-top: 1px solid #eee;
    margin-top: auto;
    flex-shrink: 0; /* Keep footer at bottom */
}

/* View Button */
.view-btn {
    background: none;
    border: none;
    color: #000000;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 13px;
    cursor: pointer;
    padding-top: 10px;
    position: relative;
    width: 100%;
    transition: color 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.view-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 5%;
    width: 90%;
    height: 2px;
    background-color: #D6840E;
}

.view-btn:hover {
    color: #D6840E;
}

.no-courses {
    display: none;
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: #777;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 40px;
    padding: 20px 0;
}

.pagination-btn {
    padding: 8px 16px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    color: #555;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pagination-btn:hover:not(:disabled) {
    background: #f8f9fa;
    border-color: #D6840E;
    color: #D6840E;
}

.pagination-btn.active {
    background: #D6840E;
    color: #fff;
    border-color: #D6840E;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-info {
    font-size: 14px;
    color: #777;
    margin: 0 15px;
}

/* Related Courses - UPDATED TO PREVENT STRETCHING */
.related-courses-container {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
    padding-left: 10px;
    padding-right: 10px;
}

.related-courses-container h3 {
    display: none; /* Hide the title */
}

.related-courses-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr)); /* Use minmax(0, 1fr) to prevent stretching */
    gap: 20px;
}

.related-course .course-card {
    height: 100%; /* Fill the grid cell */
}

.related-course .course-image {
    height: 150px; /* Slightly smaller image for related courses */
}

.related-course .course-body {
    padding: 12px 15px;
}

.related-course .course-footer {
    padding: 12px 15px;
}

/* Responsive adjustments for related courses */
@media (max-width: 1200px) {
    .related-courses-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)); /* 3 columns on medium screens */
    }
}

@media (max-width: 992px) {
    .related-courses-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)); /* 2 columns on tablet */
    }
}

@media (max-width: 576px) {
    .related-courses-grid {
        grid-template-columns: 1fr; /* 1 column on mobile */
    }
}

/* Hide sidebar on mobile */
@media (max-width: 768px) {
    .courses-wrapper {
        flex-direction: column;
    }
    
    .filter-sidebar {
        flex: none;
        width: 100%;
        margin-bottom: 25px;
    }
    
    .courses-container {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
    
    .filter-menu {
        justify-content: flex-start;
        overflow-x: auto;
        padding: 10px;
    }
    
    .filter-btn {
        padding: 10px 20px;
        white-space: nowrap;
    }
}

@media (max-width: 480px) {
    .courses-container {
        grid-template-columns: 1fr;
    }
    
    .elearning-courses-container {
        padding: 10px;
    }
    
    .course-card {
    }
    
    .related-course .course-card {
    }
}

/* ACCA Course Card */
.course-card.acca .course-type {
    color: #D6840E;
}

/* CIPS Course Card */
.course-card.cips .course-type {
    color: #D6840E;
}

/* QCTO Course Card */
.course-card.qcto .course-type {
    color: #D6840E;
}

/* MICT Course Card */
.course-card.mict .course-type {
    color: #D6840E;
}

/* ETDP Course Card */
.course-card.etdp .course-type {
    color: #D6840E;
}

/* Services Seta Course Card */
.course-card.services-seta .course-type {
    color: #D6840E;
}

/* PMI Course Card */
.course-card.pmi .course-type {
    color: #D6840E;
}

/* Checkbox Styles for Filters */
.checkbox-group {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    background: #f9f9f9;
}

.checkbox-label {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    font-size: 14px;
    color: #555;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 8px;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.checkbox-label:hover {
    color: #D6840E;
}