/* ============================================
   Modern Category / Course Listing Page
   ============================================ */

.category-page {
    max-width: 1200px;
    margin: 0 auto;
    padding-bottom: 40px;
}

/* --- Page heading & breadcrumb --- */
.category-page h1 {
    font-family: 'Roboto Slab', serif;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 10px;
    line-height: 1.3;
}

.category-page .cat_breadcrumb_separator {
    color: #aaa;
    margin: 0 4px;
}

.category-page h1 a {
    color: #006600;
    text-decoration: none;
}

.category-page h1 a:hover {
    text-decoration: underline;
}

/* --- Subcategory grid --- */
.subcategory-intro {
    font-size: 14px;
    color: #666;
    margin-bottom: 16px;
}

.subcategory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
    margin-bottom: 10px;
}

.subcategory-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f1f5f0;
    border: 1px solid #d4ddd4;
    border-radius: 8px;
    padding: 14px 18px;
    color: #003300;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.subcategory-card:hover {
    background: #006600;
    border-color: #006600;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 102, 0, 0.2);
    text-decoration: none;
}

.subcategory-card:hover .subcategory-arrow {
    color: #fff;
}

.subcategory-name {
    flex: 1;
}

.subcategory-arrow {
    color: #006600;
    font-size: 12px;
    margin-left: 10px;
    transition: color 0.2s ease;
}

.section-divider {
    border: none;
    border-top: 1px solid #e9ecef;
    margin: 28px 0;
}

/* --- Course card grid --- */
.course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.course-card {
    border: 1px solid #e2e6ea;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    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 24px rgba(0, 0, 0, 0.1);
}

.course-card-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.course-card-link:hover {
    text-decoration: none;
    color: inherit;
}

/* Card image */
.course-card-img {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #f8f9fa;
    position: relative;
}

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

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

/* Card body */
.course-card-body {
    padding: 18px 20px 12px;
    flex: 1;
}

.course-card-title {
    font-family: 'Roboto Slab', serif;
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a !important;
    margin: 0 0 8px 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.course-card-desc {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Card footer */
.course-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-top: 1px solid #f0f0f0;
    margin-top: auto;
}

.course-card-price {
    font-size: 18px;
    font-weight: 700;
    color: #006600;
}

.course-card-action {
    font-size: 13px;
    font-weight: 600;
    color: #006600;
    transition: color 0.2s ease;
}

.course-card-action i {
    margin-left: 4px;
    transition: transform 0.2s ease;
}

.course-card:hover .course-card-action i {
    transform: translateX(3px);
}

/* --- Pagination --- */
.category-page .pagination {
    margin: 24px 0;
}

.category-page .pagination a {
    display: inline-block;
    padding: 6px 12px;
    margin: 0 2px;
    border: 1px solid #e2e6ea;
    border-radius: 6px;
    color: #006600;
    font-size: 13px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.category-page .pagination a:hover {
    background: #006600;
    border-color: #006600;
    color: #fff;
}

/* --- Empty state message --- */
.category-page .msg_warning {
    display: block;
    background: #fffdf5;
    border: 1px solid #f0e6c0;
    border-radius: 8px;
    padding: 20px 24px;
    font-size: 14px;
    color: #666;
}

/* --- Responsive --- */
@media (max-width: 991px) {
    .course-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 16px;
    }
}

@media (max-width: 767px) {
    .category-page h1 {
        font-size: 22px;
    }

    .course-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .course-card-img {
        height: 180px;
    }

    .subcategory-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .course-card-body {
        padding: 14px 16px 10px;
    }

    .course-card-footer {
        padding: 12px 16px;
    }
}

@media (min-width: 768px) and (max-width: 991px) {
    .course-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .subcategory-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
