/* ===========================================
   COURSE FILTER SECTION - HOMEPAGE
   =========================================== */
.course-filter {
    position: absolute;
    left: 50%;
    bottom: -30%;
    transform: translate(-50%, -50%);
    width: 100%;
    max-width: 1280px;
    padding: 30px 20px;
    background-color: var(--color-primary);
    border-radius: 30px;
    box-shadow: var(--shadow-lg);
    z-index: 9;
}

.filter-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-around;
    gap: 20px;
    height: 100%;
}

/* Filter Text */
.filter-text p {
    margin: 0;
    font-size: clamp(18px, 3vw, 24px);
    font-weight: 600;
    line-height: 1.6;
    letter-spacing: 0.5px;
    color: #fff;
}

/* Filter Form */
.filter-form {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

/* Submit Button */
.filter-submit {
    padding: 14px 32px;
    background: #fff;
    color: var(--color-primary);
    font-size: 15px;
    font-weight: 700;
    border: none;
    border-radius: 50px;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-submit:hover {
    background: var(--color-secondary);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(57, 166, 83, 0.4);
}

/* ===========================================
   CUSTOM MULTI-SELECT
   =========================================== */
.custom-select {
    position: relative;
    min-width: 220px;
}

.custom-select#program-select {
    min-width: 260px;
}

/* Trigger */
.custom-select__trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 52px;
    padding: 12px 16px;
    background: #fff;
    border: 1px solid transparent;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.25s;
}

.custom-select__trigger:hover,
.custom-select.is-open .custom-select__trigger {
    border-color: var(--color-secondary);
}

.custom-select.is-open .custom-select__trigger {
    border-radius: 10px 10px 0 0;
    border-bottom-color: transparent;
}

/* Icon */
.custom-select__icon {
    flex-shrink: 0;
    color: #888;
}

/* Placeholder */
.custom-select__placeholder {
    font-size: 12px;
  color: #888;
  display: -webkit-box;
  -webkit-line-clamp: 2;      /* số dòng */
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.custom-select.has-value .custom-select__placeholder {
    display: none;
}

/* Arrow */
.custom-select__arrow {
    flex-shrink: 0;
    color: #888;
    transition: transform 0.3s ease;
}

.custom-select.is-open .custom-select__arrow {
    transform: rotate(180deg);
}

/* Tags */
.custom-select__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    flex: 1;
}

.custom-select__tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    background: var(--color-secondary);
    color: #fff;
    font-size: 11px;
    font-weight: 500;
    border-radius: 5px;
    white-space: nowrap;
}

.custom-select__tag-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s;
}

.custom-select__tag-remove:hover {
    background: rgba(255, 255, 255, 0.4);
}

.custom-select__tag-remove svg {
    width: 10px;
    height: 10px;
}

/* Dropdown */
.custom-select__dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    /* max-height: 220px; */
    background: #fff;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--color-secondary);
    border-top: none;
    border-radius: 0 0 10px 10px;
    overflow-y: auto;
    z-index: 100;
    display: none;
}

/* .custom-select.is-open .custom-select__dropdown {
    display: block;
} */

/* Options */
.custom-select__option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.2s;
}

.custom-select__option:hover {
    background: #f5f5f5;
}

.custom-select__option.is-selected {
    background: rgba(57, 166, 83, 0.08);
}

.custom-select__option.is-disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* Checkbox */
.custom-select__checkbox {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border: 2px solid #ccc;
    border-radius: 4px;
    flex-shrink: 0;
    transition: all 0.2s;
}

.custom-select__option.is-selected .custom-select__checkbox {
    background: var(--color-secondary);
    border-color: var(--color-secondary);
}

.custom-select__option.is-selected .custom-select__checkbox::after {
    content: '';
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-top: -2px;
}

/* Label */
.custom-select__label {
    font-size: 13px;
    color: var(--color-text);
}

.custom-select__option.is-selected .custom-select__label {
    font-weight: 600;
    color: var(--color-secondary);
}

/* ===========================================
   RESPONSIVE
   =========================================== */

/* Tablet Large */
@media (max-width: 1300px) {
    .course-filter {
        position: static;
        transform: none;
        margin: 2rem 20px 0;
    }
}

/* Tablet */
@media (max-width: 1024px) {
    .filter-wrapper {
        flex-direction: column;
        text-align: center;
        gap: 24px;
    }

    .filter-text p br {
        display: none;
    }

    .filter-form {
        width: 100%;
        justify-content: center;
    }

    .custom-select {
        min-width: 180px;
        max-width: 220px;
    }

    .custom-select#program-select {
        min-width: 200px;
        max-width: 260px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .course-filter {
        padding: 24px 16px;
        border-radius: 16px;
    }

    .filter-form {
        flex-direction: column;
    }

    .custom-select,
    .custom-select#program-select {
        width: 100%;
        min-width: 100%;
        max-width: 100%;
    }

    .custom-select__trigger {
        min-height: 48px;
        padding: 10px 14px;
    }

    .filter-submit {
        width: 100%;
        padding: 16px 32px;
    }
}