/* CDGS LP Course Filter v1.0.5 - Enhanced Design */

/* Container */
.cdgs-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Anuphan', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Arial;
}

.cdgs-title {
    font-size: 28px;
    margin: 8px 0 16px;
}

.cdgs-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 20px;
}

/* Sidebar */
.cdgs-sidebar {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 12px;
    position: sticky;
    top: 16px;
    height: fit-content;
}

.cdgs-filter input[type=text] {
    width: 100%;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px;
    height: 40px;
    margin-bottom: 12px;
    outline: none;
}

.cdgs-filter-title {
    font-weight: 700;
    margin: 10px 0 6px;
}

.cdgs-filter-list {
    display: grid;
    gap: 8px;
    margin-bottom: 10px;
	color: #384252;
}

#cdgs-clear {
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #f8fafc;
    cursor: pointer;
    width: 100%;
}

#cdgs-clear:hover {
    background: #e5e7eb;
}

/* Toolbar */
.cdgs-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

#cdgs-sort {
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    outline: none;
}

.cdgs-view-toggle button {
    border: 1px solid #d1d5db;
    background: #fff;
    padding: 6px 10px;
    cursor: pointer;
    border-radius: 8px;
    margin-left: 4px;
}

.cdgs-view-toggle button.active {
    background: #7cbf7c;
    color: #fff;
    border-color: #7cbf7c;
}

/* Results */
.cdgs-results {
    min-height: 220px;
    position: relative;
}

.cdgs-courses {
    display: grid;
    gap: 16px;
}

.cdgs-courses.cdgs-view-card {
    grid-template-columns: repeat(3, 1fr);
}

.cdgs-courses.cdgs-view-list {
    grid-template-columns: 1fr;
}

/* Card Item */
.cdgs-item {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
}

.cdgs-item:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.cdgs-item .cdgs-thumb {
    position: relative;
    overflow: hidden;
}

.cdgs-item .cdgs-thumb img {
    width: 100%;
    display: block;
    object-fit: cover;
}

/* Card Body */
.cdgs-card-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* Stars */
.cdgs-stars {
    display: flex;
    gap: 2px;
    margin-bottom: 8px;
}

.cdgs-stars .star {
    color: #d1d5db;
    font-size: 16px;
}

.cdgs-stars .star.filled {
    color: #fbbf24;
}

.cdgs-stars .star.half {
    color: #fbbf24;
    opacity: 0.5;
}

/* Title */
.cdgs-item h3 {
    font-size: 16px;
    margin: 0 0 8px 0;
    line-height: 1.4;
}

.cdgs-item h3 a {
    color: #111827;
    text-decoration: none;
}

.cdgs-item h3 a:hover {
    color: #7cbf7c;
}

/* Author */
.cdgs-author {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 12px;
}

/* Meta Info */
.cdgs-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 16px;
    flex: 1;
}

.cdgs-meta .meta-item {
    font-size: 13px;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 4px;
}

.cdgs-meta .meta-item .icon {
    font-size: 14px;
}

/* Footer */
.cdgs-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid #e5e7eb;
}

.cdgs-footer .price {
    font-size: 18px;
    font-weight: 700;
    color: #10b981;
}

.cdgs-footer .btn-detail {
    padding: 8px 16px;
    background: #7cbf7c;
    color: #fff;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
}

.cdgs-footer .btn-detail:hover {
    background: #34393a;
}

/* List View Specific */
.cdgs-item.list {
    flex-direction: row;
    padding: 16px;
    gap: 16px;
}

.cdgs-item.list .cdgs-thumb {
    flex-shrink: 0;
    width: 200px;
}

.cdgs-item.list .cdgs-thumb img {
    width: 200px;
    height: 133px;
    object-fit: cover;
    border-radius: 8px;
}

.cdgs-item.list .cdgs-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.cdgs-item.list h3 {
    margin: 4px 0 8px 0;
}

.cdgs-meta-list {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 12px;
    flex: 1;
}

.cdgs-meta-list .meta-item {
    font-size: 13px;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 4px;
}

.cdgs-footer-list {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid #e5e7eb;
}

.cdgs-footer-list .price {
    font-size: 18px;
    font-weight: 700;
    color: #10b981;
}

.cdgs-footer-list .btn-detail {
    padding: 8px 16px;
    background: #7cbf7c;
    color: #fff;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
}

.cdgs-footer-list .btn-detail:hover {
    background: #34393a;
}

/* Pagination */
.cdgs-pagination {
    display: flex;
    gap: 6px;
    margin-top: 16px;
    flex-wrap: wrap;
    justify-content: center;
}

.cdgs-pagination a,
.cdgs-pagination span {
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    text-decoration: none;
    line-height: 1;
    display: inline-block;
}

.cdgs-pagination .page-numbers.current,
.cdgs-pagination span.current,
.cdgs-pagination a.current {
    background: #7cbf7c !important;
    color: #fff !important;
    border-color: #7cbf7c !important;
}

.cdgs-loading {
    padding: 24px;
    text-align: center;
    color: #6b7280;
}

.cdgs-empty {
    text-align: center;
    padding: 40px;
    color: #6b7280;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .cdgs-layout {
        grid-template-columns: 1fr;
    }

    .cdgs-sidebar {
        position: static;
    }

    .cdgs-courses.cdgs-view-card {
        grid-template-columns: repeat(2, 1fr);
    }

    .cdgs-meta {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .cdgs-wrap {
        padding: 12px;
    }

    .cdgs-toolbar {
        flex-direction: column;
        gap: 12px;
    }

    #cdgs-sort {
        width: 100%;
    }

    .cdgs-item.list {
        flex-direction: column;
    }

    .cdgs-item.list .cdgs-thumb {
        width: 100%;
    }

    .cdgs-item.list .cdgs-thumb img {
        width: 100%;
        height: auto;
    }

    .cdgs-meta-list {
        flex-direction: column;
        gap: 8px;
    }
}

@media (max-width: 640px) {
    .cdgs-courses.cdgs-view-card {
        grid-template-columns: 1fr;
    }

    .cdgs-title {
        font-size: 22px;
    }

    .cdgs-footer,
    .cdgs-footer-list {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .cdgs-footer .btn-detail,
    .cdgs-footer-list .btn-detail {
        width: 100%;
        text-align: center;
    }
}