:root {
    --primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --primary-solid: #667eea;
    --secondary-solid: #764ba2;
    --light-bg: #f9fafb;
    --border: #e5e7eb;
    --text-dark: #1f2937;
    --text-muted: #6b7280;
}

/* ===== Filter Form ===== */
.filter-form {
    width: 100%;
}

/* ===== Course Filters Sidebar ===== */
.course-filters {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    height: fit-content;
    position: sticky;
    top: 100px;
}

.filter-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-title i {
    color: var(--primary-solid);
}

.filter-group {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.filter-group:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.filter-group h5 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ===== Filter Checkbox ===== */
.filter-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    font-size: 14px;
    color: var(--text-muted);
    transition: color 0.3s ease;
}

.filter-checkbox:hover {
    color: var(--text-dark);
}

.filter-checkbox input {
    display: none;
}

.checkmark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-radius: 4px;
    margin-right: 10px;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.filter-checkbox input:checked + .checkmark {
    background: var(--primary-solid);
    border-color: var(--primary-solid);
    color: white;
}

.filter-checkbox:hover .checkmark {
    border-color: var(--primary-solid);
}

/* ===== Filter Actions ===== */
.filter-actions {
    margin-top: 16px;
}

.btn-reset-filters {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-solid);
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.3s ease;
}

.btn-reset-filters:hover {
    gap: 12px;
    color: var(--secondary-solid);
}

/* ===== Courses Header (Search & Sort) ===== */
.courses-header {
    display: flex;
    gap: 16px;
    margin-bottom: 32px;
    flex-wrap: wrap;
    align-items: center;
}

.search-box {
    flex: 1;
    min-width: 200px;
    position: relative;
    display: flex;
    align-items: center;
}

.search-box i {
    position: absolute;
    left: 16px;
    color: var(--text-muted);
    font-size: 18px;
    pointer-events: none;
}

.search-box input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.3s ease;
    background: white;
    color: var(--text-dark);
}

.search-box input::placeholder {
    color: #d1d5db;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-solid);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.sort-dropdown {
    min-width: 180px;
}

.sort-dropdown select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dark);
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
    font-family: inherit;
}

.sort-dropdown select:focus {
    outline: none;
    border-color: var(--primary-solid);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* ===== Courses Grid ===== */
.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

/* ===== Course Card ===== */
.course-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid var(--border);
}

.course-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    transform: translateY(-4px);
    border-color: var(--primary-solid);
}

/* ===== Course Image Wrapper ===== */
.course-image-wrapper {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #000;
}

.course-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.course-card:hover .course-image {
    transform: scale(1.05);
}

.course-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.btn-view-course {
    background: var(--primary);
    color: white;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.btn-view-course:hover {
    transform: scale(1.05);
    color: white;
}

/* ===== Course Content ===== */
.course-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.course-badges {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.badge-level {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
}

.badge-level.badge-beginner {
    background: #dcfce7;
    color: #15803d;
}

.badge-level.badge-intermediate {
    background: #fed7aa;
    color: #b45309;
}

.badge-level.badge-advanced {
    background: #fce7f3;
    color: #be185d;
}

.badge-students {
    background: #f0f9ff;
    color: #0369a1;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.course-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0 0 12px 0;
    line-height: 1.4;
}

.course-title a {
    color: var(--text-dark);
    text-decoration: none;
    transition: color 0.3s ease;
}

.course-title a:hover {
    color: var(--primary-solid);
}

.course-description {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0 0 12px 0;
    line-height: 1.5;
}

.course-meta {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.course-program {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-muted);
}

.course-program i {
    color: var(--primary-solid);
}

/* ===== Course Footer ===== */
.course-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-top: none;
    background: white;
    margin-top: auto;
}

.course-price {
    font-weight: 700;
    font-size: 1.1rem;
    color: #10b981;
    margin: 0;
}

.course-badge-free {
    display: inline-block;
    background: #dcfce7;
    color: #15803d;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-detail {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--primary-solid);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
}

.btn-detail:hover {
    gap: 10px;
    color: var(--secondary-solid);
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--border);
}

.empty-icon {
    font-size: 64px;
    color: #d1d5db;
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--text-muted);
    margin-bottom: 24px;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--primary);
    color: white;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
    color: white;
}

/* ===== Pagination ===== */
.pagination-wrapper {
    display: flex;
    justify-content: center;
}

.pagination-wrapper .pagination {
    gap: 8px;
    flex-wrap: wrap;
}

.pagination-wrapper .page-link {
    border: 2px solid var(--border);
    color: var(--primary-solid);
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.pagination-wrapper .page-link:hover {
    background: var(--primary);
    border-color: var(--primary-solid);
    color: white;
}

.pagination-wrapper .page-item.active .page-link {
    background: var(--primary);
    border-color: var(--primary-solid);
    color: white;
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .course-filters {
        position: static;
    }

    .courses-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

@media (max-width: 768px) {
    .courses-header {
        flex-direction: column;
    }

    .search-box,
    .sort-dropdown {
        width: 100%;
    }

    .course-footer {
        padding: 1.25rem;
    }

    .course-price {
        font-size: 1.5rem;
    }

    .courses-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 16px;
    }

    .course-filters {
        margin-top: 30px;
    }

    .filter-group {
        margin-bottom: 20px;
        padding-bottom: 20px;
    }
}

@media (max-width: 480px) {
    .courses-grid {
        grid-template-columns: 1fr;
    }

    .filter-title {
        font-size: 16px;
    }

    .course-filters {
        padding: 16px;
    }

    .empty-state {
        padding: 40px 16px;
    }
    .course-footer {
        padding: 1rem;
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .course-price {
        font-size: 0.95rem;
    }

    .course-badge-free {
        font-size: 11px;
        padding: 3px 10px;
    }
}