/* STANDALONE STYLES FOR DUAL-DATABASE SEARCH BAR & LISTINGS HEADER CARD */

/* 1. Compact Premium Search Bar Wrapper & Layout */
.compact-search-bar {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 50px;
    padding: 0.35rem 0.35rem 0.35rem 1.5rem;
    margin-bottom: 0 !important;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.05);
}

.search-bar-wrapper + .portal-container {
    margin-top: 1.5rem !important;
}

.search-bar-form {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr auto;
    gap: 0.85rem;
    align-items: center;
}

.search-field {
    position: relative;
    display: flex;
    align-items: center;
    height: 100%;
}

.search-field:not(:last-of-type)::after {
    content: '';
    position: absolute;
    right: -0.45rem;
    top: 20%;
    height: 60%;
    width: 1px;
    background-color: rgba(226, 232, 240, 0.8);
}

.field-icon {
    color: var(--accent);
    font-size: 1.05rem;
    position: absolute;
    left: 0;
    pointer-events: none;
}

.search-field input[type="text"] {
    width: 100%;
    border: none;
    background: transparent;
    color: #334155;
    font-size: 0.95rem;
    padding: 0.65rem 0.5rem 0.65rem 1.65rem;
    outline: none;
    font-family: inherit;
}

.search-field input[type="text"]::placeholder {
    color: #94a3b8;
}

.search-field select {
    width: 100%;
    border: none;
    background: transparent;
    color: #334155;
    font-size: 0.95rem;
    padding: 0.65rem 1.5rem 0.65rem 1.65rem;
    outline: none;
    cursor: pointer;
    font-family: inherit;
    appearance: none;
    -webkit-appearance: none;
}

/* Custom dropdown arrow for select elements */
.search-field select {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%2364748b' stroke-width='2' viewBox='0 0 24 24'><path d='M19 9l-7 7-7-7'/></svg>");
    background-repeat: no-repeat;
    background-position: right 0.25rem center;
}

.search-field optgroup {
    background-color: #ffffff;
    color: #64748b;
    font-weight: 700;
}

.search-field option {
    background-color: #ffffff;
    color: #334155;
}

.btn-search-submit {
    background-color: var(--accent);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 0.75rem 2rem;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.25);
    white-space: nowrap;
}

.btn-search-submit:hover {
    background-color: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 15px rgba(249, 115, 22, 0.35);
}

.btn-search-submit .btn-icon {
    display: none;
}

/* 2. Listings Header Title Row */
.listings-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.85rem 1.25rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 0;
    margin-top: 0;
}

.listings-title-row h2 {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--primary);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.listing-count-badge {
    font-size: 0.8rem;
    color: #475569;
    background-color: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 0.25rem 0.65rem;
    font-weight: 550;
    display: inline-block;
    vertical-align: middle;
}

.listing-count-badge strong {
    margin: 0 0.25rem;
    color: var(--accent);
    font-weight: 700;
}

/* 3. Mobile Responsive Adaptation */
@media (max-width: 768px) {
    /* Mobile Compact Search Bar Layout */
    .compact-search-bar {
        border-radius: 16px;
        padding: 0.75rem;
        margin-bottom: 1.5rem;
        box-shadow: 0 8px 25px rgba(15, 23, 42, 0.05);
        background: #ffffff;
    }

    .search-bar-form {
        display: grid;
        grid-template-columns: repeat(6, 1fr);
        gap: 0.5rem;
        align-items: stretch;
    }

    .btn-search-submit {
        grid-row: 1;
        grid-column: span 1;
        width: 100%;
        height: 38px;
        border-radius: 8px;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-left: 0;
    }

    .btn-search-submit .btn-text {
        display: none;
    }

    .btn-search-submit .btn-icon {
        display: block !important;
        font-size: 14px;
        color: white;
    }

    .search-field {
        grid-column: span 2;
        background: #f8fafc;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        padding-left: 0.5rem;
    }

    .search-field.search-input-group {
        grid-row: 1;
        grid-column: span 5;
    }

    .search-field:not(:last-of-type)::after {
        display: none;
    }

    .field-icon {
        display: none;
    }

    .search-field input[type="text"] {
        font-size: 12px !important;
        padding: 0.6rem 0.2rem;
    }

    .search-field select {
        font-size: 11px !important;
        padding: 0.6rem 0.8rem 0.6rem 0.2rem;
        background-position: right 0 center;
    }

    .search-field input[type="text"]:focus,
    .search-field select:focus {
        font-size: 16px !important;
    }

    /* Listings Header Mobile */
    .listings-title-row {
        padding: 0.65rem 0.75rem !important;
        margin-bottom: 0.75rem !important;
    }

    .listings-title-row h2 {
        font-size: 0.76rem !important;
    }

    .listings-title-row .count-prefix,
    .listings-title-row .count-suffix {
        display: none !important;
    }

    .listing-count-badge {
        font-size: 0.75rem !important;
        padding: 0.15rem 0.45rem !important;
    }
}

/* Ensure card link overlay functions as a block tag for native navigation */
a.card-link-overlay {
    display: block;
    text-decoration: none;
    color: inherit;
}

/* Reduce spacing between listings header and listings feed */
.portal-main-col {
    gap: 0.5rem !important;
}
.listings-title-row {
    margin-bottom: 0px !important;
    padding-bottom: 0.25rem !important;
}
