.course-page {
    padding: 40px 20px;
    /* background-color: #1a1e26; */
    color: white;
    height: 90vh;
    margin-top: 50px;
}

.course-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    gap: 40px;
    align-items: flex-start;
    margin-top: 30px;
}

.course-sidebar {
    flex: 1;
    background-color: #313741;
    padding: 24px;
    border-radius: 12px;
    min-width: 260px;
}

.filter-group {
    margin-bottom: 24px;
}

.filter-title {
    font-size: 16px;
    color: #00ff55;
    margin-bottom: 10px;
}

.filter-group label {
    display: block;
    font-size: 14px;
    margin: 6px 0;
    cursor: pointer;
}

.tag {
    display: inline-block;
    background: #00ff55;
    color: black;
    font-size: 13px;
    padding: 4px 8px;
    margin: 4px 4px 0 0;
    border-radius: 6px;
    font-weight: bold;
}

.reset-filter {
    font-size: 13px;
    color: #ccc;
    text-decoration: underline;
    display: block;
    margin-top: 10px;
}

.course-main {
    flex: 3;
}

.course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

.course-card {
    background: #1a1e26;
    border-radius: 12px;
    overflow: hidden;
    color: white;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s ease;
}

.course-card:hover {
    transform: translateY(-4px);
}

.course-thumb {
    position: relative;
}

.course-thumb img {
    width: 100%;
    display: block;
}

.price-tag {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.7);
    padding: 4px 8px;
    border-radius: 6px;
    text-align: right;
}

.price-tag .original {
    font-size: 14px;
    text-decoration: line-through;
    color: #ccc;
}

.price-tag .discount {
    font-size: 16px;
    font-weight: bold;
    color: #00ff55;
}

.video-count {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.6);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    color: white;
}

.video-count i {
    margin-right: 4px;
}

.course-info {
    padding: 12px 16px;
}

.course-info h3 {
    font-size: 16px;
    margin-bottom: 4px;
}

.course-info .type {
    font-size: 13px;
    color: #00ff55;
    margin-bottom: 8px;
}

.course-info .desc {
    font-size: 13px;
    color: #ccc;
}

.pagination {
    text-align: center;
    margin-top: 30px;
}

.pagination a {
    display: inline-block;
    padding: 8px 12px;
    margin: 0 4px;
    border-radius: 4px;
    background: #2a2e38;
    color: white;
    font-size: 14px;
    text-decoration: none;
}

.pagination a.active {
    background: #00ff55;
    color: black;
    font-weight: bold;
}

/* Dropdown Toggle */
.filter-toggle {
    display: none;
    background: #00ff55;
    color: black;
    padding: 12px 16px;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    transition: background 0.3s ease;
}

.filter-toggle:hover {
    background: #00e24d;
}

.filter-toggle .arrow {
    transition: transform 0.3s ease;
}

.filter-toggle .arrow.rotate {
    transform: rotate(180deg);
}

/* Collapsible Content Animation */
.filter-content {
    overflow: hidden;
    max-height: 1000px;
    /* default desktop แสดงอยู่ */
    transition: max-height 0.5s ease;
}

.arrow i {
    transition: transform 0.3s ease;
  }
  
  .arrow.rotate i {
    transform: rotate(180deg);
  }
  


/* ----------------------------------------------- */
/* 📱 Responsive: Mobile & Tablet */
/* ----------------------------------------------- */
@media (max-width: 1024px) {
    .course-container {
        flex-direction: column;
        gap: 30px;
    }

    .course-sidebar {
        width: 100%;
        min-width: auto;
        padding: 16px;
    }

    .course-main {
        width: 100%;
    }

    .course-grid {
        grid-template-columns: repeat(2, 1fr);
        /* ✅ แสดง 2 การ์ดต่อแถว */
        gap: 16px;
    }

    .filter-toggle {
        display: flex;
    }

    .filter-content {
        max-height: 0;
    }

    .filter-content.open {
        max-height: 1000px;
    }

    .filter-toggle {
        display: flex;
    }

    .filter-content {
        max-height: 0;
    }

    .filter-content.open {
        max-height: 1000px;
    }
}

@media (max-width: 768px) {
    .course-page {
        padding: 30px 16px;
        height: auto;
        margin-top: 30px;
    }

    .course-container {
        gap: 20px;
        margin-top: -50px;
    }

    .course-sidebar {
        padding: 14px;
    }

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

    .filter-group label {
        font-size: 13px;
    }

    .tag {
        font-size: 12px;
        padding: 3px 6px;
    }

    .course-grid {
        grid-template-columns: repeat(2, 1fr);
        /* ✅ แสดง 2 การ์ดต่อแถว */
        gap: 16px;
    }

    .course-info h3 {
        font-size: 14px;
    }

    .course-info .desc {
        font-size: 12px;
    }

    .pagination a {
        padding: 6px 10px;
        font-size: 13px;
    }

    .filter-toggle {
        display: flex;
    }

    .filter-content {
        max-height: 0;
    }

    .filter-content.open {
        max-height: 1000px;
    }
}