/* Course List Page Styles */
.hero-gradient {
    background: linear-gradient(135deg, #4e54c8 0%, #8f94fb 100%);
    padding: 4rem 0;
    position: relative;
    overflow: hidden;
}

.hero-gradient::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29-22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%23ffffff' fill-opacity='0.1' fill-rule='evenodd'/%3E%3C/svg%3E");
    opacity: 0.8;
    z-index: 0;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-image {
    position: relative;
    z-index: 1;
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
    100% { transform: translateY(0px); }
}

/* Filter Sidebar */
.filter-sidebar {
    background: #fff;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 20px;
}

.filter-header {
    font-weight: 600;
    margin-bottom: 1rem;
    color: #2d3748;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #edf2f7;
}

/* Course Card */
.course-card {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #fff;
    position: relative;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.course-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(79, 70, 229, 0.03), rgba(99, 102, 241, 0.03));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 0;
}

.course-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.course-card:hover::before {
    opacity: 1;
}

.course-img-container {
    position: relative;
    overflow: hidden;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    background: #f8fafc;
}

.course-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.course-card:hover .course-img {
    transform: scale(1.08);
}

.course-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.badge-bestseller {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    color: #fff;
}

.badge-sale {
    background: linear-gradient(135deg, #ef4444, #f87171);
    color: #fff;
}

.course-level {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    backdrop-filter: blur(4px);
}

.course-body {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
    background: #fff;
}

.course-category {
    display: inline-block;
    margin-bottom: 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #4f46e5;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.course-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: #1e293b;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    /* Standard property for line clamping (not widely supported yet) */
    line-clamp: 2;
    max-height: 3em; /* Fallback for browsers that don't support line-clamp */
    transition: color 0.2s ease;
}

.course-card:hover .course-title {
    color: #4f46e5;
}

.course-instructor {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.instructor-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    margin-right: 10px;
    object-fit: cover;
    border: 2px solid #e2e8f0;
}

.instructor-name {
    font-size: 0.875rem;
    color: #64748b;
    font-weight: 500;
}

.course-meta {
    display: flex;
    align-items: center;
    margin: 1rem 0;
    padding: 0.75rem 0;
    border-top: 1px solid #f1f5f9;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.875rem;
    color: #64748b;
}

.course-meta-item {
    display: flex;
    align-items: center;
    margin-right: 1rem;
}

.course-meta-item:last-child {
    margin-right: 0;
}

.course-meta-item i {
    margin-right: 0.4rem;
    font-size: 1rem;
    color: #94a3b8;
}

.rating {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.rating-stars {
    color: #f59e0b;
    margin-right: 0.5rem;
    display: flex;
    align-items: center;
}

.rating-stars i {
    margin-right: 2px;
}

.rating-count {
    font-size: 0.875rem;
    color: #94a3b8;
    font-weight: 500;
}

.course-price {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.75rem;
}

.price-current {
    font-size: 1.4rem;
    font-weight: 800;
    color: #4f46e5;
    display: flex;
    align-items: center;
}

.price-original {
    font-size: 1rem;
    text-decoration: line-through;
    color: #94a3b8;
    margin-left: 0.5rem;
    font-weight: 500;
}

.enroll-btn {
    padding: 0.5rem 1.25rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    color: white;
    border: none;
    box-shadow: 0 4px 6px rgba(79, 70, 229, 0.2);
}

.enroll-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(79, 70, 229, 0.3);
    color: white;
}

/* Animation for course cards on scroll */
.course-card.animate__animated.animate__fadeInUp {
    animation-duration: 0.6s;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .course-card {
        margin-bottom: 1.5rem;
    }
    
    .course-body {
        padding: 1.25rem;
    }
    
    .course-price {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .price-current {
        font-size: 1.25rem;
    }
    
    .enroll-btn {
        width: 100%;
        justify-content: center;
    }
}

/* Back to top button */
#backToTop {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #4e73df;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    text-decoration: none;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    border: none;
    outline: none;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

#backToTop.show {
    opacity: 1;
    visibility: visible;
}

#backToTop:hover {
    background-color: #2e59d9;
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

#backToTop i {
    transition: transform 0.3s ease;
}

#backToTop:hover i {
    transform: translateY(-2px);
}

/* Pagination */
.pagination {
    margin: 2rem 0;
}

.page-link {
    color: #4e54c8;
    border: 1px solid #e2e8f0;
    padding: 0.5rem 1rem;
    margin: 0 3px;
    border-radius: 6px !important;
    transition: all 0.2s ease;
}

.page-item.active .page-link {
    background-color: #4e54c8;
    border-color: #4e54c8;
}

.page-link:hover {
    color: #3a41bd;
    background-color: #f8f9fa;
    border-color: #e2e8f0;
}

/* Responsive Adjustments */
@media (max-width: 991.98px) {
    .hero-gradient {
        text-align: center;
        padding: 3rem 0;
    }
    
    .hero-image {
        margin-top: 2rem;
        max-width: 80%;
        margin-left: auto;
        margin-right: auto;
    }
    
    .filter-sidebar {
        margin-bottom: 2rem;
        position: static;
    }
}

@media (max-width: 767.98px) {
    .course-col {
        margin-bottom: 1.5rem;
    }
    
    .hero-gradient h1 {
        font-size: 2rem;
    }
    
    .hero-gradient .lead {
        font-size: 1.1rem;
    }
}
