/* Container centered */
.search-page-content {
    background: #fcfcfc;
    padding: 30px 20px 50px;
    min-height: calc(100vh - 80px);
    display: flex;
    justify-content: center;
}

.search-container {
    width: 100%;
    max-width: 850px;
    background: #fff;
    border: 1px solid var(--border-color, #e0e0e0);
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border-radius: 12px;
    margin-bottom: 50px;
    overflow: hidden;
}

.search-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color, #e0e0e0);
    background: #fafafa;
}

.search-tabs button {
    flex: 1;
    background: transparent;
    border: none;
    padding: 16px 0;
    font-size: 1rem;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.search-tabs button:hover {
    color: var(--primary-orange, #e65100);
}

.search-tabs button.active {
    color: var(--primary-green, #2e7d32);
    background: #fff;
}

.search-tabs button.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: var(--primary-green, #2e7d32);
    border-radius: 3px 3px 0 0;
}

.search-tabs .badge {
    background: #e0e0e0;
    color: #555;
    font-size: 0.75rem;
    padding: 2px 7px;
    border-radius: 10px;
    margin-left: 6px;
}

.search-tabs button.active .badge {
    background: var(--primary-green, #2e7d32);
    color: #fff;
}

.search-body {
    padding: 20px 0;
}

.search-body h2 {
    font-size: 1.1rem;
    padding: 0 30px 20px;
    color: #111;
    font-weight: 700;
}

.search-section {
    margin-bottom: 25px;
}

.section-title {
    background: #f5f7fa;
    padding: 10px 30px;
    font-size: 1rem;
    color: #333;
    font-weight: 700;
    margin-bottom: 15px;
    border-left: 4px solid var(--primary-green, #2e7d32);
}

.form-row {
    display: flex;
    padding: 12px 30px;
    align-items: center;
}

.highlight-row {
    background-color: #fff9e6; /* light yellow */
}

.form-label {
    width: 35%;
    font-size: 0.95rem;
    color: #444;
    font-weight: 600;
}

.form-inputs {
    width: 65%;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-inputs select, .select-with-readmore {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.95rem;
    background: #fff;
    color: #333;
    appearance: none;
    outline: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23999999%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem top 50%;
    background-size: 0.65rem auto;
    transition: border-color 0.2s ease;
}

.form-inputs select:focus, .select-with-readmore:focus {
    border-color: var(--primary-orange, #e65100);
}

.to-text {
    font-size: 0.9rem;
    color: #555;
    padding: 0 5px;
}

.select-with-readmore {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    background-image: none;
}

.select-with-readmore .read-more {
    color: var(--primary-orange, #e65100);
    font-size: 0.85rem;
    margin-right: 10px;
    margin-left: auto;
}

.view-less {
    padding: 10px 30px;
    color: var(--primary-orange, #e65100);
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

.premium-block {
    margin: 15px 30px;
    border: 1px solid #ddd;
    border-radius: 8px;
    position: relative;
    padding-top: 20px;
    padding-bottom: 20px;
    background: #fafafa;
}

.premium-icon {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid #ddd;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #9c27b0;
    font-size: 0.9rem;
}

.disabled-row {
    opacity: 0.6;
    pointer-events: none;
}

.disabled-row select {
    background: #f9f9f9;
}

.disabled-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #999;
    font-size: 0.9rem;
}

.premium-cta {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 20px;
}

.premium-cta span {
    font-size: 0.9rem;
    color: #333;
}

.btn-premium {
    background: var(--primary-orange, #e65100);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
}

.pill-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.pill-btn {
    background: #fff;
    border: 1px solid #ccc;
    color: #444;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.88rem;
    cursor: pointer;
    transition: all 0.2s;
}

.pill-btn.active {
    background: #ffe3d1;
    border-color: var(--primary-orange, #e65100);
    color: var(--primary-orange, #e65100);
    font-weight: 600;
}

.search-inline-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 22px 30px;
    border-top: 1px solid #eee;
    margin-top: 20px;
    background: #fafafa;
}

.search-inline-footer .matches-count {
    font-weight: 700;
    font-size: 1rem;
    color: #333;
}

.footer-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-save-search {
    background: #fff;
    border: 1.5px solid var(--primary-orange, #e65100);
    color: var(--primary-orange, #e65100);
    padding: 10px 22px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-save-search:hover {
    background: var(--primary-orange, #e65100);
    color: #fff;
}

.search-inline-footer .btn-search {
    background: var(--primary-orange, #e65100);
    border: none;
    color: #fff;
    padding: 10px 32px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.98rem;
    cursor: pointer;
    transition: background 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.search-inline-footer .btn-search:hover {
    background: #d84315;
}

/* By Profile ID Styles */
.profile-id-search-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.floating-input-group {
    position: relative;
    width: 100%;
}

.floating-input-group input {
    width: 100%;
    padding: 14px 16px;
    border: 1.5px solid var(--primary-green, #2e7d32);
    border-radius: 8px;
    font-size: 1.05rem;
    color: #222;
    outline: none;
    background: #fff;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.floating-input-group input:focus {
    border-color: var(--primary-orange, #e65100);
    box-shadow: 0 0 0 3px rgba(230, 81, 0, 0.1);
}

.floating-input-group label {
    position: absolute;
    top: -10px;
    left: 14px;
    background: #fff;
    padding: 0 6px;
    color: var(--primary-green, #2e7d32);
    font-size: 0.78rem;
    font-weight: 700;
    border-radius: 3px;
}

.btn-view-profile {
    background: #e0e0e0;
    color: #666;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.btn-view-profile.active-btn {
    background: var(--primary-orange, #e65100);
    color: white;
}

.btn-view-profile.active-btn:hover {
    background: #d84315;
}

/* Modal Overlay & Save Search Card Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 15px;
}

.modal-overlay.active {
    display: flex !important;
}

.modal-card {
    background: #fff;
    border-radius: 14px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    animation: modalPop 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modalPop {
    from { opacity: 0; transform: scale(0.92); }
    to { opacity: 1; transform: scale(1); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 22px;
    border-bottom: 1px solid #eee;
    background: #fafafa;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: #222;
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 1.6rem;
    color: #888;
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover {
    color: #222;
}

.modal-body {
    padding: 22px;
}

.modal-footer {
    padding: 14px 22px;
    background: #fafafa;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Saved Search Cards Grid */
.saved-search-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 18px;
    margin-top: 15px;
}

.saved-search-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.saved-search-card:hover {
    border-color: var(--primary-orange, #e65100);
    box-shadow: 0 8px 20px rgba(230,81,0,0.12);
    transform: translateY(-3px);
}

.saved-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.saved-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #222;
    margin: 0 0 4px 0;
}

.saved-card-date {
    font-size: 0.8rem;
    color: #888;
}

.btn-delete-saved {
    background: transparent;
    border: none;
    color: #dc3545;
    font-size: 1rem;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 6px;
    transition: background 0.2s;
}

.btn-delete-saved:hover {
    background: #ffebee;
}

.criteria-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}

.criteria-tag {
    background: #f1f5f9;
    color: #475569;
    font-size: 0.78rem;
    padding: 4px 10px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.saved-card-footer {
    display: flex;
    justify-content: flex-end;
    padding-top: 12px;
    border-top: 1px dashed #f0f0f0;
}

.btn-run-search {
    background: var(--primary-orange, #e65100);
    color: #fff;
    padding: 9px 20px;
    border-radius: 20px;
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: background 0.2s;
}

.btn-run-search:hover {
    background: #d84315;
    color: #fff;
}

/* =========================================================
   SEARCH PAGE — Full Responsive System
   ========================================================= */

/* ── ≤ 768px: Tablet & Mobile ── */
@media (max-width: 768px) {

    .search-page-content {
        padding: 0 0 40px;
        align-items: flex-start;
        background: #f7f8fa;
    }

    .search-container {
        border: none;
        box-shadow: none;
        margin-bottom: 20px;
        border-radius: 0;
        background: transparent;
    }

    /* Tabs — horizontal scroll on small screens */
    .search-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
        display: flex;
        border-bottom: 2px solid var(--border-color, #eee);
        scrollbar-width: none;
        background: #fff;
        position: sticky;
        top: 0;
        z-index: 10;
        box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    }
    .search-tabs::-webkit-scrollbar { display: none; }

    .search-tabs button {
        flex: none;
        padding: 14px 20px;
        font-size: 0.9rem;
        min-width: 110px;
        white-space: nowrap;
    }

    .search-tabs button.active::after {
        width: 70px;
    }

    /* Search body bg */
    .search-body {
        background: #fff;
        border-radius: 10px;
        margin: 12px 10px 0;
        padding: 12px 0;
        box-shadow: 0 2px 8px rgba(0,0,0,0.06);
        border: 1px solid #eee;
    }

    /* Section headings */
    .search-body h2 {
        font-size: 0.95rem;
        padding: 12px 16px 10px;
        color: #222;
    }

    .search-section {
        margin-bottom: 0;
    }

    .section-title {
        padding: 9px 16px;
        font-size: 0.85rem;
        background: #f0f4f8;
        color: #555;
        letter-spacing: 0.02em;
        border-left: 3px solid var(--primary-green, #2e7d32);
        margin-bottom: 6px;
    }

    /* Form rows — stack label above input */
    .form-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        padding: 10px 16px;
        border-bottom: 1px solid #f5f5f5;
    }

    .form-row:last-child {
        border-bottom: none;
    }

    .form-label {
        width: 100%;
        font-size: 0.82rem;
        font-weight: 700;
        color: #333;
        text-transform: uppercase;
        letter-spacing: 0.04em;
    }

    .form-inputs {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
    }

    .form-inputs select {
        font-size: 0.9rem;
        padding: 10px 12px;
        min-width: 0;
        flex: 1;
        border-radius: 8px;
        background-color: #fafafa;
        border: 1px solid #dde3ea;
    }

    .form-inputs select:focus {
        border-color: var(--primary-orange, #e65100);
        background: #fff;
    }

    .to-text {
        padding: 0 2px;
        font-size: 0.82rem;
        align-self: center;
        color: #888;
        flex-shrink: 0;
    }

    /* Range selects (age, height, income) — side-by-side */
    .form-inputs select:first-of-type,
    .form-inputs select:last-of-type {
        flex: 1;
        min-width: 0;
    }

    .select-with-readmore {
        font-size: 0.88rem;
        padding: 10px 12px;
    }

    .view-less {
        padding: 8px 16px;
        font-size: 0.85rem;
    }

    /* Premium Block */
    .premium-block {
        margin: 10px 16px 16px;
        border-radius: 10px;
    }

    .premium-cta {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
        padding: 0 16px;
    }

    .premium-cta span {
        font-size: 0.84rem;
    }

    .btn-premium {
        width: 100%;
        text-align: center;
        padding: 11px;
        font-size: 0.9rem;
        border-radius: 25px;
    }

    /* Pill Group (profile created date) */
    .pill-group {
        gap: 8px;
        flex-wrap: wrap;
        margin-top: 8px;
    }

    .pill-btn {
        padding: 7px 12px;
        font-size: 0.82rem;
        border-radius: 6px;
    }

    /* ── Search Footer ── */
    .search-inline-footer {
        flex-direction: column;
        gap: 14px;
        text-align: center;
        padding: 20px 16px;
        background: #fff;
        border-top: 1px solid #eee;
        margin: 0 10px;
        border-radius: 0 0 10px 10px;
    }

    .search-inline-footer .matches-count {
        font-size: 0.92rem;
        color: #333;
    }

    .footer-actions {
        width: 100%;
        flex-direction: column-reverse;
        gap: 10px;
    }

    .btn-save-search,
    .search-inline-footer .btn-search {
        width: 100%;
        justify-content: center;
        padding: 12px;
        font-size: 0.98rem;
        border-radius: 25px;
    }

    /* ── Saved Search Grid on Mobile ── */
    .saved-search-grid {
        grid-template-columns: 1fr;
    }
}

/* ── ≤ 576px: Small phones ── */
@media (max-width: 576px) {

    .search-tabs button {
        padding: 12px 14px;
        font-size: 0.85rem;
        min-width: 95px;
    }

    .search-body {
        margin: 10px 8px 0;
    }

    .search-body h2 {
        font-size: 0.9rem;
        padding: 10px 14px 8px;
    }

    .section-title {
        padding: 8px 14px;
        font-size: 0.8rem;
    }

    .form-row {
        padding: 9px 14px;
        gap: 5px;
    }

    .form-label {
        font-size: 0.78rem;
    }

    .form-inputs select {
        font-size: 0.85rem;
        padding: 9px 10px;
    }

    .pill-btn {
        padding: 6px 10px;
        font-size: 0.78rem;
    }

    .search-inline-footer {
        margin: 0 8px;
        padding: 16px 14px;
    }

    .premium-block {
        margin: 8px 14px 14px;
    }
}
