#topic,
#level {
    width: 300px;
    height: 50px;
}

/* Filter Section */
.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    margin: 50px auto;
    justify-content: left;
    margin-left: 200px;
}

.filter-group {
    display: flex;
    gap: 20px;
}

.filter-group select {
    width: 100%;
    max-width: 300px;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 12px;
    background-color: white;
    cursor: pointer;


}

.card {
    position: relative; /* Tambahkan ini */
    /* properti yang lain tetap */
}

/* Bungkus gambar */
.image-wrapper {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 86px;
    height: 86px;
}

/* Gambar */
.course-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Tampilan "No Image" jika tidak ada gambar */
.no-image {
    width: 100%;
    height: 100%;
    background-color: #e5e5e5;
    color: #777;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 12px;
    border-radius: 0.5rem;
}


/* Course Container */
.course-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-top: 40px;
    padding: 0 20px;
}

.course-title-text {
    display: block;
    margin: 30px 0 25px !important;

    /* Biar hanya 1 baris */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;

    /* Biar tidak tabrakan dengan gambar */
    max-width: calc(100% - 120px); /* 120px = ukuran image-wrapper + jarak */
}

/* Course Card */
.course-card,
.course-card2 {
    background: white;
    padding: 25px;
    border-radius: 12px;
    width: 100%;
    max-width: 400px;
    border: 1px solid #ccc;
    margin: 0 auto;
}

/* Course Info */
.course-info {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
    align-items: center;
}

/* Wrapper Topik */
.container-topik {
    display: flex;
    justify-content: center;
    align-items: stretch; /* <-- ini penting! */
}

.topikkiri {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    align-items: stretch; /* <-- ini penting! */
}

.card {
    flex: 1 1 calc(50% - 20px); /* 2 card per baris, gap 20px */
    max-width: 500px ;
    min-width: 300px ; /* boleh lebih fleksibel */
    height: auto;
    border-radius: 24px !important;
    padding: 20px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.course-description {
    font-size: 18px;
    color: #444;
    display: -webkit-box;
    -webkit-line-clamp: 3; 
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.5;
    max-height: calc(1.8rem * 3); 
    margin-bottom: 10px !important;
}



p.kelas-header {
    font-size: 16px;
}


.card p {
    padding: 10px;
    
}

/* ? Perbaikan utama: info-wrapper agar responsif dan tidak overflow */
.info-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    max-width: 100%;
    align-items: center;
    justify-content: flex-start;
}

.info-wrapper p {
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 0;
    font-size: 16px;
}



.info-wrapper svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}/* ? MEDIA QUERIES UNTUK RESPONSIVENESS */

/* Tablet (Lebar <= 1024px) */
@media (max-width: 1024px) {
    div.filters {
        margin-left: auto;
        margin-right: auto;
        justify-content: center;
    }
    .topikkiri {
        display: flex;
        width: 100%;
        margin-left: auto;
        margin-right: auto;
    }

    .card {
        min-width: 300px;
        
    }

    .course-description {
        font-size: 16px;
        -webkit-line-clamp: 3;
        line-height: 1.7;
    }

    .info-wrapper {
        gap: 1px;
        flex-wrap: wrap;
        flex-direction: column;
        align-items: flex-start;
    }

    .flex-card {
        gap: 10px;
        display: flex;
                                
    }

    .course-title-text {
    width: 200px;
    margin-bottom: 20px !important;
    margin-top: 30px !important;

}

    .course-title-text {
    max-width: calc(100% - 10px);
}
    
    
}

@media (max-width: 767px) {

    .linklink a {
        margin-right: 11px !important;
    }
    /* Layout topik kiri menjadi kolom */
    .topikkiri {
        display: flex;
        flex-direction: column;
    }

    /* Spasi antar filter jadi lebih kecil */
    .filters {
        gap: 20px;
    }

    .course-title-text {
    max-width: calc(100% - 10px);
}


    /* Ukuran kartu kursus disesuaikan untuk layar kecil */
    .course-card,
    .course-card2 {
        width: 100%;
        padding: 15px;
        margin-bottom: 20px;
    }

    /* Tampilan info kursus tetap horizontal tapi tengah dan rapi */
    .course-info {
        display: flex;
        flex-direction: row;
        justify-content: center;
        align-items: center;
        gap: 10px;
        text-align: left;
    }

    /* Dropdown topik & level penuh */
    #level,
    #topic {
        width: 100% ;
    }

    /* Kartu full width dan tidak overflow */
    .card {
        width: 100% !important;
        box-sizing: border-box;
    }

    /* Hilangkan padding kanan untuk elemen terakhir dalam span */
    span p:last-of-type {
        padding-right: 0px;
    }

    /* Span lebar 80% */
    span {
        width: 80%;
    }

    .info-wrapper {
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    gap: 4px !important; 
    max-width: 100%;
    align-items: flex-start;
    justify-content: flex-start;
}
    
    
    
}
