/* ==========================================================================
   Budi Wiki Search
   ========================================================================== */

.budi-ws__wrapper {
    width: 100%;
}

/* ==========================================================================
   Search Bar
   ========================================================================== */

.budi-ws__search-bar {
    max-width: 715px;
    margin-inline: auto;
    margin-bottom: 50px;
}

.budi-ws__form {
    display: flex;
    align-items: center;
    gap: 15px;
}

.budi-ws__input-group {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
    gap: 12px;
    border-radius: 100px;
    border: 1px solid rgba(0, 0, 0, 0.20);
    background: rgba(255, 255, 255, 0.25);
    box-shadow: 0 2px 20px 0 rgba(0, 0, 0, 0.05);
    height: 60px;
    padding: 15px 20px;
}

.budi-ws__search-icon {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    color: #888;
}

.budi-ws__search-input {
    flex: 1;
    border: none !important;
    background: transparent !important;
    outline: none !important;
    box-shadow: none !important;
    font-weight: 400;
    color: var(--color-sub);
    padding: 10px 0;
    min-width: 0;
}

.budi-ws__search-input::placeholder {
    color: rgba(23, 23, 23, 0.7);
}

.budi-ws__search-input:focus,
.budi-ws__search-input:focus-visible {
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
}

/* Button — override parent theme's aggressive button rules */
.budi-ws__wrapper .budi-ws__search-btn {
    flex-shrink: 0;
    background: var(--bg-main-linear, linear-gradient(135deg, #FF4540, #E30612)) !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 100px !important;
    height: 60px !important;
    line-height: 1em !important;
    padding: 12px 28px !important;
    font-family: inherit !important;
    font-weight: 600 !important;
    cursor: pointer;
    transition: opacity 0.25s ease;
    white-space: nowrap;
}

.budi-ws__wrapper .budi-ws__search-btn:hover {
    opacity: 0.88;
}

.budi-ws__wrapper .budi-ws__search-btn.is-loading {
    opacity: 0.75 !important;
    pointer-events: none !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
}

.budi-ws__wrapper .budi-ws__search-btn.is-loading::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: budi-ws-spin 0.7s linear infinite;
    flex-shrink: 0;
}

@keyframes budi-ws-spin {
    to { transform: rotate(360deg); }
}

/* ==========================================================================
   Topic Pills
   ========================================================================== */

.budi-ws__topics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    column-gap: 10px;
    row-gap: 20px;
    max-width: 900px;
    margin-inline: auto;
}

.budi-ws__topics.is-loading {
    opacity: 0.4;
    pointer-events: none;
}

.budi-ws__no-results {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 40px 20px;
    text-align: center;
    color: var(--color-sub);
}

.budi-ws__no-results-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: #f5f5f5;
    color: var(--color-sub);
    margin-bottom: 4px;
}

.budi-ws__no-results-title {
    font-weight: 700;
    margin: 0;
}

.budi-ws__no-results-hint {
    opacity: 0.6;
    margin: 0;
}

.budi-ws__topic-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
    color: var(--color-sub);
    border-radius: 100px;
    height: 50px;
    padding: 10px 25px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
    white-space: nowrap;
}

.budi-ws__topic-pill:hover {
    background: var(--color-main);
    color: #ffffff;
    text-decoration: none;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 992px) {
    .budi-ws__topics {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    .budi-ws__input-group {
        padding: 6px 16px;
        gap: 8px;
    }

    .budi-ws__wrapper .budi-ws__search-btn {
        padding: 10px 18px !important;
    }

    .budi-ws__topic-pill {
        padding: 8px 16px;
    }
}

@media (max-width: 576px) {
    .budi-ws__form {
        flex-wrap: wrap;
    }

    .budi-ws__input-group {
        width: 100%;
    }

    .budi-ws__wrapper .budi-ws__search-btn {
        width: 100% !important;
        justify-content: center;
    }

    .budi-ws__topics {
        grid-template-columns: 1fr;
    }
}
