/* --- 2. HEADER SECTION --- */
.catalog-header {
    background: var(--primary-gradient);
    padding: 4rem 0 6rem 0;
    /* Extra bottom padding for overlap effect if needed later */
    margin-bottom: 0rem;
    position: relative;
    overflow: hidden;
}

/* Decorative circles */
.catalog-header::before,
.catalog-header::after {
    content: '';
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.catalog-header::before {
    width: 300px;
    height: 300px;
    top: -100px;
    left: -100px;
}

.catalog-header::after {
    width: 150px;
    height: 150px;
    bottom: 20px;
    right: 10%;
}

.header-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: white;
}

.page-title {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 2.8rem;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Search Bar */
.search-wrapper {
    max-width: 600px;
    margin: 2rem auto 0;
    position: relative;
}

.modern-search-input {
    width: 100%;
    padding: 1.2rem 1.5rem;
    padding-right: 4rem;
    border-radius: 50px;
    border: none;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    font-size: 1rem;
}

.search-btn {
    position: absolute;
    right: 6px;
    top: 6px;
    background: #764ba2;
    color: white;
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    transition: 0.3s;
}

.search-btn:hover {
    background: #667eea;
}

/* Stats Strip */
.stats-strip {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 3rem;
    font-size: 0.9rem;
    font-weight: 600;
    opacity: 0.9;
}

.stat-item i {
    margin-right: 8px;
    color: #fbbf24;
}

/* --- 3. FILTER BAR --- */
.filter-section {
    margin-top: -3rem;
    margin-bottom: 1rem;
    position: relative;
    z-index: 5;
}

.filter-card {
    background: white;
    border-radius: 12px;
    padding: 1rem 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.category-pills {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 5px;
}

.cat-pill {
    background: #f3f4f6;
    color: var(--text-dark);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s;
}

.cat-pill:hover,
.cat-pill.active {
    background: var(--text-dark);
    color: white;
}

.sort-dropdown select {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 0.9rem;
    color: var(--text-dark);
    cursor: pointer;
}

/* --- 4. COURSE CARD STYLES --- */
.vibrant-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    border: 1px solid #f0f0f0;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
}

.vibrant-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(118, 75, 162, 0.15);
    /* Purple Glow */
    border-color: rgba(118, 75, 162, 0.1);
}

/* Image & Badges */
.card-thumb-box {
    position: relative;
    height: 190px;
    overflow: hidden;
}

.card-thumb-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.vibrant-card:hover .card-thumb-box img {
    transform: scale(1.08);
}

.badge-container {
    position: absolute;
    top: 12px;
    left: 12px;
    display: flex;
    gap: 5px;
}

.level-badge {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
}

.price-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: white;
    color: var(--text-dark);
    font-weight: 800;
    font-size: 0.8rem;
    padding: 4px 10px;
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.price-badge.free {
    color: var(--accent-green);
}

/* Card Content Layout */
.card-content {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    justify-content: space-between;
    /* Pushes Footer Wrapper to bottom */
}

/* Top Section: Title & Rating */
.rating-row {
    color: #fbbf24;
    font-size: 0.75rem;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.rating-count {
    color: #9ca3af;
    font-size: 0.75rem;
    margin-left: 2px;
}

.card-title {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-dark);
    margin-bottom: 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-title a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}

.vibrant-card:hover .card-title a {
    color: #764ba2;
}

/* Bottom Wrapper (Meta + Button) */
.card-bottom-wrapper {
    margin-top: auto;
}

.meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 15px;
    padding-bottom: 15px;
    border-top: 1px solid #f3f4f6;
    font-size: 0.85rem;
    color: #6b7280;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.meta-item i {
    font-size: 0.9rem;
}

/* Action Buttons */
.card-action {
    width: 100%;
}

.btn-view {
    display: block;
    width: 100%;
    background: var(--primary-gradient);
    color: white;
    font-weight: 700;
    border: 1px solid transparent;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-view:hover {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 12px rgba(118, 75, 162, 0.3);
    transform: translateY(-2px);
}

/* Enrolled State (Green) */
.btn-view.enrolled {
    background: #10b981;
    color: white;
    border: 1px solid #d1fae5;
}

.btn-view.enrolled:hover {
    background: #10b981;
    color: white;
    border-color: #10b981;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* Pagination Margin */
.pagination-wrapper {
    margin-top: 3rem;
}

.btn-view.completed {
    background: #10b981;
    /* Emerald Green */
    border-color: #10b981;
    color: #fff;
}

.btn-view.completed:hover {
    background: #059669;
    border-color: #059669;
}