/* Search wrapper */
.dcff-search-wrapper {
    position: relative;
    margin-bottom: 12px;
}

/* Search input */
.dcff-search-input {
    width: 100%;
    padding: 10px 36px 10px 14px;
    font-size: 15px;
    line-height: 1.4;
    border: 1px solid rgba(0, 0, 0, 0.25);
    border-radius: 3px;
    background-color: #fff;
    color: rgba(0, 0, 0, 0.7);
    box-sizing: border-box;
    transition: border-color 0.2s ease;
}

.dcff-search-input:focus {
    outline: none;
    border-color: #066aab;
    box-shadow: 0 0 0 1px #066aab;
}

.dcff-search-input::placeholder {
    color: rgba(0, 0, 0, 0.4);
}

/* Mode indicator: shown when the games search value has been set to the
   "Custom Game Request" label after a transfer. Reads as placeholder-style
   so it's clearly not a live query. */
.dcff-search-input.dcff-mode-indicator {
    font-style: italic;
    color: rgba(0, 0, 0, 0.4);
}

/* Clear button */
.dcff-clear-btn {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 20px;
    line-height: 1;
    color: rgba(0, 0, 0, 0.4);
    cursor: pointer;
    padding: 0 4px;
}

.dcff-clear-btn:hover {
    color: rgba(0, 0, 0, 0.7);
}

/* Result count */
.dcff-result-count {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: rgba(0, 0, 0, 0.45);
}

/* City badge */
.dcff-city-badge {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 12px;
    margin-bottom: 10px;
    font-size: 13px;
    line-height: 1.4;
    color: #1a3a5c;
    background-color: #e8f0fe;
    border-radius: 4px;
}

/* "Show all" button */
.dcff-show-all {
    background: none;
    border: none;
    padding: 0;
    color: #066aab;
    font: inherit;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
}

.dcff-show-all:hover {
    text-decoration: underline;
}

/* Checkbox list container — grid replaces CSS columns so max-height works */
.searchable-checkboxes ul {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr);
    columns: unset !important;
    -webkit-columns: unset !important;
    -moz-columns: unset !important;
    max-height: 420px;
    overflow-y: auto;
    padding-right: 4px;
}

/* Override WPForms li sizing — it sets width:33%/inline-block which conflicts with grid */
/* Note: grid items are auto-blockified, so no display override needed here. */
/* Do NOT use display:block!important — it prevents JS from hiding items with display:none. */
.searchable-checkboxes ul li {
    width: 100% !important;
}

/* Collapsed state — hide the list until user searches */
.searchable-checkboxes ul.dcff-collapsed {
    display: none !important;
}

/* Selected games chip container */
.dcff-selected-games {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.dcff-selected-games:empty {
    display: none;
}

/* Individual chip */
.dcff-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    font-size: 13px;
    line-height: 1.4;
    color: #1a3a5c;
    background-color: #e8f0fe;
    border-radius: 20px;
    white-space: nowrap;
}

.dcff-chip button {
    background: none;
    border: none;
    padding: 0 2px;
    font-size: 16px;
    line-height: 1;
    color: #1a3a5c;
    cursor: pointer;
    opacity: 0.6;
}

.dcff-chip button:hover {
    opacity: 1;
}

/* ── Custom game request field (contextual reveal) ─────────── */

/* Hidden until games search returns zero results.
   Applied via the WPForms field CSS class + a state modifier class. */
.wpforms-field.custom-game-request.dcff-hidden-by-default {
    display: none !important;
}

/* Shown state — subtle visual cue that this appeared in response
   to an empty search. Keeps WPForms' native field styling intact. */
.wpforms-field.custom-game-request.dcff-visible {
    padding: 14px 16px;
    margin-top: 8px;
    background-color: #fff8e1;
    border-left: 3px solid #f5b800;
    border-radius: 4px;
    animation: dcff-custom-field-reveal 0.2s ease-out;
}

.wpforms-field.custom-game-request.dcff-visible .wpforms-field-label {
    color: #5a4200;
    font-weight: 600;
}

.wpforms-field.custom-game-request.dcff-visible .wpforms-field-description,
.wpforms-field.custom-game-request.dcff-visible .wpforms-field-sublabel {
    color: rgba(0, 0, 0, 0.65);
    font-size: 13px;
}

@keyframes dcff-custom-field-reveal {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Mobile: single column */
@media (max-width: 600px) {
    .searchable-checkboxes .wpforms-field-label-inline {
        display: block;
    }

    .searchable-checkboxes ul {
        grid-template-columns: 1fr !important;
    }
}
