/**
 * Playfield Search Tabs + Search Bar
 * Brand red tab bar on top + white search form on bottom = unified card
 * Brand color: Playfield dark red #8b0303
 */

/* ========================================
   Tab Bar Container — Brand red background
   Top corners rounded, bottom corners flat (joins the form)
   ======================================== */
.playfield-search-tabs {
    display: block;
    position: relative;
    border-radius: 10px 10px 0 0;
    overflow: hidden;
    margin-bottom: 0;
    z-index: 2;
    background: #8b0303;
}

/* No pseudo-element needed — background is on the container itself */

/* ========================================
   Inner wrapper — padding and base text color
   ======================================== */
.playfield-search-tabs .pf-tabs-inner {
    position: relative;
    display: flex;
    padding: 14px 25px;
    color: rgba(255, 255, 255, 0.75);
    font-size: 16px;
}

/* ========================================
   Individual Tab
   ======================================== */
.playfield-search-tabs .pf-tab {
    display: inline-block;
    padding: 3px 0;
    font-size: 15px;
    font-weight: 500;
    margin-right: 22px;
    position: relative;
    cursor: pointer;
    transition: 0.3s;
    user-select: none;
    color: rgba(255, 255, 255, 0.75);
    background: none;
    border: none;
    text-decoration: none;
    outline: none;
    letter-spacing: 0.3px;
    border-radius: 0;
    line-height: 1.4;
}

.playfield-search-tabs .pf-tab:last-child {
    margin-right: 0;
}

/* Icon inside tab */
.playfield-search-tabs .pf-tab i {
    font-size: 14px;
    margin-right: 4px;
    transition: color 0.3s;
}

/* Hover + Active text = full white */
.playfield-search-tabs .pf-tab:hover,
.playfield-search-tabs .pf-tab.active {
    color: #fff;
}

.playfield-search-tabs .pf-tab:hover i,
.playfield-search-tabs .pf-tab.active i {
    color: #fff;
}

/* ========================================
   Active underline via ::after pseudo
   White underline on red background
   ======================================== */
.playfield-search-tabs .pf-tab::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    height: 2px;
    width: 0%;
    background: #fff;
    transition: all 0.4s ease;
}

.playfield-search-tabs .pf-tab.active::after {
    width: 100%;
    left: 0;
}

/* External link icon (Events tab) */
.playfield-search-tabs .pf-tab .pf-tab-external {
    font-size: 10px;
    opacity: 0.5;
    margin-left: 3px;
}

/* ========================================
   Search Form — White card with bottom radius + shadow
   Matches Listeo: .simple-slider-search-form .main-search-input
   ======================================== */

/* Remove any existing border-radius on the search widget so it
   connects flush to the tab bar above */
.playfield-search-tabs + .widget-listing-search-form,
.playfield-search-tabs + .widget-listing-search-form .filter-listing-form,
.playfield-search-tabs ~ .widget-listing-search-form,
.playfield-search-tabs ~ .widget-listing-search-form .filter-listing-form {
    border-top-left-radius: 0 !important;
    border-top-right-radius: 0 !important;
}

/* The search form container itself */
.playfield-search-tabs + .widget-listing-search-form,
.playfield-search-tabs ~ .widget-listing-search-form {
    border-radius: 0 0 10px 10px !important;
    box-shadow: 0 3px 12px 0 rgba(0, 0, 0, 0.15) !important;
    padding: 12px !important;
    margin: 0 !important;
    background: #fff !important;
}

/* Inner form element also matches */
.playfield-search-tabs + .widget-listing-search-form .filter-listing-form,
.playfield-search-tabs ~ .widget-listing-search-form .filter-listing-form {
    border-radius: 0 0 10px 10px !important;
    box-shadow: none !important;
    margin: 0 !important;
}

/* ========================================
   Hidden field styling
   ======================================== */
.pf-hidden-tab-filter {
    display: none !important;
}

/* Category field removed from widget via Elementor — no CSS hide needed */

/* ========================================
   Mobile Responsive
   ======================================== */
@media (max-width: 767px) {
    .playfield-search-tabs .pf-tabs-inner {
        padding: 12px 16px;
    }

    .playfield-search-tabs .pf-tab {
        padding: 3px 0;
        font-size: 17px;
        margin-right: 20px;
    }

    .playfield-search-tabs .pf-tab i {
        font-size: 12px;
    }

    .playfield-search-tabs .pf-tab .pf-tab-external {
        display: none;
    }
}

@media (max-width: 480px) {
    .playfield-search-tabs .pf-tabs-inner {
        padding: 10px 12px;
    }

    .playfield-search-tabs .pf-tab {
        padding: 3px 0;
        font-size: 17px;
        margin-right: 20px;
    }
}

/* ========================================
   Popular Searches Dropdown
   Appears on search input focus — white card
   positioned below the search form
   ======================================== */
.pf-popular-searches {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 100;
    background: #fff;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    padding: 16px 20px 18px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    pointer-events: none;
}

.pf-popular-searches.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

/* Dropdown title — small gray label */
.pf-popular-searches h4 {
    margin: 0 0 10px 0;
    padding: 0;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #888;
}

/* Tags wrapper */
.pf-suggestion-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Individual pill tag */
.pf-suggestion-tag {
    display: inline-block;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 500;
    color: #444;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    line-height: 1.4;
}

.pf-suggestion-tag:hover {
    background: #8b0303;
    color: #fff;
    border-color: #8b0303;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(139, 3, 3, 0.25);
}

.pf-suggestion-tag:active {
    transform: translateY(0);
}

/* ========================================
   Popular Searches — Mobile
   ======================================== */
@media (max-width: 767px) {
    .pf-popular-searches {
        padding: 12px 14px 14px;
    }

    .pf-suggestion-tags {
        gap: 6px;
    }

    .pf-suggestion-tag {
        padding: 5px 12px;
        font-size: 12px;
    }
}

/* ========================================
   FILTER MODAL — Actions Row (inline buttons)
   ======================================== */
.pf-actions-row {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 8px;
    justify-content: flex-end;
}
.pf-actions-row > .d-flex {
    flex-shrink: 0;
}

/* ========================================
   FILTER MODAL — Trigger Button
   ======================================== */
.pf-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 18px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}
.pf-filter-btn:hover {
    background: #8b0303;
    color: #fff;
    border-color: #8b0303;
}
.pf-filter-btn i {
    font-size: 13px;
}
.pf-filter-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: #8b0303;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    margin-left: 4px;
}
.pf-filter-btn:hover .pf-filter-badge {
    background: #fff;
    color: #8b0303;
}

/* ========================================
   FILTER MODAL — Overlay + Panel
   ======================================== */
.pf-filter-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s, visibility 0.25s;
}
.pf-filter-overlay.open {
    opacity: 1;
    visibility: visible;
}
.pf-filter-modal {
    background: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 720px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    transform: translateY(20px);
    transition: transform 0.25s;
}
.pf-filter-overlay.open .pf-filter-modal {
    transform: translateY(0);
}

/* ─── Header ─── */
.pf-filter-header {
    display: flex;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid #eee;
}
.pf-filter-close {
    background: none;
    border: none;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    color: #666;
    padding: 0 0 0 16px;
    order: 2;
}
.pf-filter-close:hover {
    color: #8b0303;
}
.pf-filter-title {
    flex: 1;
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #222;
}
.pf-filter-clear {
    background: none;
    border: none;
    font-size: 15px;
    color: #8b0303;
    cursor: pointer;
    font-weight: 500;
    padding: 4px 0;
}
.pf-filter-clear:hover {
    text-decoration: underline;
}

/* ─── Body ─── */
.pf-filter-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
}
.pf-filter-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 24px;
    margin-bottom: 20px;
}
.pf-filter-row:last-child {
    margin-bottom: 0;
}
.pf-filter-section {
    min-width: 0;
}
.pf-filter-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #444;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* ─── Multi-Select Dropdown ─── */
.pf-ms-dropdown {
    position: relative;
}
.pf-ms-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fafafa;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    transition: border-color 0.2s;
    text-align: left;
}
.pf-ms-trigger:hover {
    border-color: #8b0303;
}
.pf-ms-placeholder {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.pf-ms-arrow {
    font-size: 11px;
    color: #999;
    margin-left: 8px;
    transition: transform 0.2s;
}
.pf-ms-panel.open ~ .pf-ms-trigger .pf-ms-arrow,
.pf-ms-dropdown:has(.pf-ms-panel.open) .pf-ms-arrow {
    transform: rotate(180deg);
}
.pf-ms-panel {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 10;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    display: none;
}
.pf-ms-panel.open {
    display: block;
}
.pf-ms-search {
    display: block;
    width: calc(100% - 16px);
    margin: 8px;
    padding: 7px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    outline: none;
}
.pf-ms-search:focus {
    border-color: #8b0303;
}
.pf-ms-list {
    max-height: 200px;
    overflow-y: auto;
    padding: 4px 0;
}
.pf-ms-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    font-size: 13px;
    color: #333;
    cursor: pointer;
    transition: background 0.15s;
}
.pf-ms-item:hover {
    background: #f5f5f5;
}
.pf-ms-item input[type="checkbox"] {
    accent-color: #8b0303;
    width: 15px;
    height: 15px;
    cursor: pointer;
    flex-shrink: 0;
}

/* ─── Simple Select ─── */
.pf-filter-select {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fafafa;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    outline: none;
}
.pf-filter-select:focus {
    border-color: #8b0303;
}

/* ─── Checkbox Grid (Regions) ─── */
.pf-cb-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.pf-cb-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 13px;
    color: #444;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}
.pf-cb-item:hover {
    border-color: #8b0303;
    background: #fff5f5;
}
.pf-cb-item:has(input:checked) {
    border-color: #8b0303;
    background: #8b0303;
    color: #fff;
}
.pf-cb-item input[type="checkbox"] {
    display: none;
}

/* ─── Full-width filter row (single item spans both columns) ─── */
.pf-filter-row-full {
    grid-template-columns: 1fr;
}

/* ─── Toggle Switch (Featured Profiles) ─── */
.pf-filter-toggle-section {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.pf-filter-toggle-section .pf-filter-label {
    margin-bottom: 0;
    white-space: nowrap;
}
.pf-toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
    cursor: pointer;
}
.pf-toggle input[type="checkbox"] {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}
.pf-toggle-slider {
    position: absolute;
    inset: 0;
    background: #ccc;
    border-radius: 24px;
    transition: background 0.25s;
}
.pf-toggle-slider::before {
    content: "";
    position: absolute;
    left: 3px;
    top: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: transform 0.25s;
}
.pf-toggle input[type="checkbox"]:checked + .pf-toggle-slider {
    background: #8b0303;
}
.pf-toggle input[type="checkbox"]:checked + .pf-toggle-slider::before {
    transform: translateX(20px);
}
.pf-toggle-text {
    font-size: 13px;
    color: #666;
    line-height: 1.3;
}

/* ─── Footer ─── */
.pf-filter-footer {
    padding: 14px 24px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.pf-filter-apply {
    padding: 10px 32px;
    background: #8b0303;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.pf-filter-apply:hover {
    background: #6d0202;
}

/* ========================================
   FILTER MODAL — Responsive (Mobile slide-up)
   ======================================== */
@media (max-width: 767px) {
    .pf-filter-overlay {
        align-items: flex-end;          /* anchor modal to bottom */
    }
    .pf-filter-modal {
        width: 100%;
        max-width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 16px 16px 0 0;
        transform: translateY(100%);    /* start fully off-screen below */
        transition: transform 0.35s cubic-bezier(0.33, 1, 0.68, 1); /* easeOutCubic */
    }
    .pf-filter-overlay.open .pf-filter-modal {
        transform: translateY(0);       /* slide up into view */
        border-radius: 0;              /* full-screen once open */
    }
    .pf-filter-row {
        grid-template-columns: 1fr;
        gap: 14px;
    }
    .pf-filter-btn {
        padding: 8px 14px;
        font-size: 13px;
    }
    .pf-actions-row {
        gap: 6px;
        justify-content: center;
    }
}

/* Tablet: reduce location width + widen actions to prevent overlap */
@media (min-width: 768px) and (max-width: 991px) {
    /* Shrink location column on tablet */
    .filter-listing-form .item-column.item-last {
        flex: 0 0 28% !important;
        max-width: 28% !important;
    }
    /* Widen the actions/submit column to fit Filters + Search */
    .filter-listing-form .form-group-search {
        flex: 0 0 30% !important;
        max-width: 30% !important;
    }
    .pf-filter-btn {
        padding: 8px 12px;
        font-size: 13px;
    }
}

/* Desktop-only: pill-shaped filter button + column rebalancing */
@media (min-width: 992px) {
    .pf-filter-btn {
        border-radius: 60px;
    }
    /* Shrink location column to make room for Filters + Search */
    .filter-listing-form .item-column.item-last {
        flex: 0 0 33.333% !important;
        max-width: 33.333% !important;
    }
    /* Widen the actions/submit column */
    .filter-listing-form .form-group-search {
        flex: 0 0 25% !important;
        max-width: 25% !important;
    }
}

/* ──────────────────────────────────────
   Hide AI Chat welcome bubble on mobile
   ────────────────────────────────────── */
@media (max-width: 767px) {
    .listeo-floating-welcome-bubble {
        display: none !important;
    }
}

/* ──────────────────────────────────────
   AI Smart Search Toggle (inside search input)
   Mirrors Listeo's .ai-btn-container pattern
   ────────────────────────────────────── */

/* Container — absolute-positioned inside the input wrapper */
.pf-ai-btn-container {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
}

/* Button — pill-shaped, icon-only by default */
.pf-ai-toggle {
    padding: 1px 6px;
    background: linear-gradient(292deg, #8b5cf6, #ec4899, #f59e0b);
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0;
    justify-content: center;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    line-height: 24px;
    width: 26px;
    height: 26px;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                padding 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.3s ease;
}

/* Robot icon — always visible */
.pf-ai-button-icon {
    flex-shrink: 0;
    font-size: 12px;
    margin-right: 0;
    transition: margin-right 0.3s ease;
}

/* Label text — hidden by default, revealed on hover */
.pf-ai-button-text {
    max-width: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-width 0.3s ease, opacity 0.3s ease;
    white-space: nowrap;
    font-size: 12px;
    line-height: 24px;
}

/* Hover — expand to show label text */
.pf-ai-toggle:hover {
    width: auto;
    padding: 1px 12px;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(139, 92, 246, 0.35);
}

.pf-ai-toggle:hover .pf-ai-button-icon {
    margin-right: 5px;
}

.pf-ai-toggle:hover .pf-ai-button-text {
    max-width: 130px;
    opacity: 1;
}

/* Active state — brighter glow, text stays visible */
.pf-ai-toggle.active {
    box-shadow: 0 2px 14px rgba(139, 92, 246, 0.5);
    background: linear-gradient(292deg, #7c3aed, #db2777, #f59e0b);
    width: auto;
    padding: 1px 12px;
}

.pf-ai-toggle.active .pf-ai-button-icon {
    margin-right: 5px;
}

.pf-ai-toggle.active .pf-ai-button-text {
    max-width: 130px;
    opacity: 1;
}

/* OFF state — site brand color, slightly transparent */
.pf-ai-toggle:not(.active) {
    background: #8b0303;
    opacity: 0.7;
}

.pf-ai-toggle:not(.active):hover {
    opacity: 1;
    background: linear-gradient(292deg, #8b5cf6, #ec4899, #f59e0b);
}

/* Activation bounce animation */
.pf-ai-toggle.pf-ai-activating {
    animation: pf-toggle-pop 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes pf-toggle-pop {
    0%   { transform: scale(1); }
    25%  { transform: scale(1.15); }
    50%  { transform: scale(0.95); }
    100% { transform: scale(1); }
}

/* Subtle glow on the search form when AI mode is active */
.filter-listing-form.pf-ai-mode-active {
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.12);
    transition: box-shadow 0.3s ease;
}

/* ── Responsive: Mobile ── */
@media (max-width: 767px) {
    .pf-ai-toggle {
        width: 22px;
        height: 22px;
    }
    .pf-ai-button-icon {
        font-size: 10px;
    }
    .pf-ai-toggle:hover .pf-ai-button-text {
        max-width: 100px;
    }
}

