/* ── WBG Big Dropdowns ──────────────────────────── */

/* Overlay backdrop */
#wbgbd-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 9998;
    backdrop-filter: blur(2px);
}

#wbgbd-overlay.active {
    display: block;
}

/* The big modal panel */
#wbgbd-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    background: #1a1a1c;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 16px;
    box-shadow: 0 24px 64px rgba(0,0,0,0.6);
    width: min(560px, 92vw);
    max-height: 75vh;
    overflow: hidden;
    flex-direction: column;
}

#wbgbd-modal.active {
    display: flex;
}

/* Modal header */
#wbgbd-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
}

#wbgbd-modal-title {
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

#wbgbd-modal-close {
    background: rgba(255,255,255,0.08);
    border: none;
    border-radius: 50%;
    color: rgba(255,255,255,0.6);
    cursor: pointer;
    font-size: 16px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
    line-height: 1;
}

#wbgbd-modal-close:hover {
    background: rgba(255,255,255,0.15);
    color: #fff;
}

/* Search box inside modal */
#wbgbd-search-wrap {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    flex-shrink: 0;
}

#wbgbd-search {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 8px;
    color: #fff;
    font-size: 13px;
    padding: 9px 12px;
    width: 100%;
    box-sizing: border-box;
    outline: none;
}

#wbgbd-search::placeholder {
    color: rgba(255,255,255,0.35);
}

#wbgbd-search:focus {
    border-color: rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.11);
}

/* Options list */
#wbgbd-options {
    overflow-y: auto;
    padding: 8px;
    flex: 1;
}

.wbgbd-option {
    border-radius: 8px;
    color: rgba(255,255,255,0.85);
    cursor: pointer;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 14px;
    padding: 13px 14px;
    transition: background 0.12s;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.wbgbd-option:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}

.wbgbd-option.selected {
    background: rgba(37,99,235,0.25);
    color: #93c5fd;
    font-weight: 600;
}

.wbgbd-option.selected::after {
    content: '✓';
    margin-left: auto;
    color: #2563eb;
    font-weight: 700;
}

.wbgbd-option-all {
    color: rgba(255,255,255,0.45);
    font-style: italic;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    margin-bottom: 4px;
    padding-bottom: 14px;
}

.wbgbd-option.hidden {
    display: none;
}

/* Scrollbar */
#wbgbd-options::-webkit-scrollbar {
    width: 6px;
}
#wbgbd-options::-webkit-scrollbar-track {
    background: transparent;
}
#wbgbd-options::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.15);
    border-radius: 3px;
}

/* ── Mobile: full-screen sheet, bigger tap targets ── */
@media (max-width: 640px) {
    #wbgbd-modal {
        width: 100vw;
        max-width: 100vw;
        height: 100dvh;
        max-height: 100dvh;
        top: 0;
        left: 0;
        transform: none;
        border-radius: 0;
    }

    #wbgbd-modal-header {
        padding: 18px 16px 14px;
    }

    #wbgbd-modal-title {
        font-size: 17px;
    }

    #wbgbd-modal-close {
        width: 38px;
        height: 38px;
        font-size: 18px;
    }

    #wbgbd-search {
        font-size: 16px; /* prevents iOS Safari auto-zoom on focus */
        padding: 12px 14px;
    }

    .wbgbd-option {
        font-size: 16px;
        padding: 16px 14px;
    }
}
