/**
 * Search Section Modern - Premium Redesign
 * Seção de Busca de Imóveis - Design Dinâmico
 */

/* ===== SEÇÃO DE BUSCA ===== */
.search-section-modern {
    padding: 5rem 0;
    background: linear-gradient(160deg, #0a1628 0%, #132238 40%, #0f2922 100%);
    position: relative;
    overflow: hidden;
}

.search-section-modern::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 600px 400px at 20% 50%, rgba(26, 95, 74, .12), transparent),
        radial-gradient(ellipse 400px 300px at 80% 30%, rgba(201, 162, 39, .06), transparent);
    animation: searchGlow 8s ease-in-out infinite alternate;
}

@keyframes searchGlow {
    0% { opacity: .6 }
    100% { opacity: 1 }
}

.search-section-modern::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.02) 1px, transparent 1px);
    background-size: 40px 40px;
}

.search-section-modern .container {
    position: relative;
    z-index: 2;
}

/* Floating shapes */
.search-section-modern .container::before,
.search-section-modern .container::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: .15;
    z-index: -1;
}
.search-section-modern .container::before {
    width: 300px; height: 300px;
    background: #1a5f4a;
    top: -80px; right: -60px;
    animation: floatShape 12s ease-in-out infinite;
}
.search-section-modern .container::after {
    width: 200px; height: 200px;
    background: #c9a227;
    bottom: -40px; left: -30px;
    animation: floatShape 10s ease-in-out infinite reverse;
}
@keyframes floatShape {
    0%, 100% { transform: translate(0, 0) }
    50% { transform: translate(20px, -15px) }
}

/* Header */
.search-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.search-header h2 {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 800;
    color: #fff;
    margin-bottom: 0.75rem;
    letter-spacing: -1px;
    line-height: 1.15;
}

.search-header p {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.5);
    max-width: 500px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ===== SEARCH BOX ===== */
.search-box {
    background: rgba(255, 255, 255, .95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 24px;
    padding: 2.25rem;
    box-shadow:
        0 25px 60px rgba(0, 0, 0, .2),
        0 0 0 1px rgba(255, 255, 255, .1) inset;
    max-width: 960px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}

.search-box::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, #1a5f4a, #c9a227, #1a5f4a);
    background-size: 200% 100%;
    animation: gradientSlide 4s linear infinite;
}

@keyframes gradientSlide {
    0% { background-position: 0% 0 }
    100% { background-position: 200% 0 }
}

/* ===== TABS ===== */
.search-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 1.75rem;
    padding: 5px;
    background: #f1f5f9;
    border-radius: 16px;
}

.search-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 24px;
    background: transparent;
    border: 2px solid transparent;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    color: #94a3b8;
    cursor: pointer;
    transition: all .3s cubic-bezier(.4, 0, .2, 1);
    position: relative;
    font-family: inherit;
}

.search-tab:hover {
    color: #1a5f4a;
    background: rgba(26, 95, 74, .04);
    border-color: rgba(26, 95, 74, .1);
}

.search-tab.active {
    background: linear-gradient(135deg, #1a5f4a, #22785e);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 16px rgba(26, 95, 74, .3);
}

.search-tab i {
    font-size: 1.1rem;
    transition: transform .3s;
}

.search-tab:hover i {
    transform: scale(1.15);
}

/* ===== TAB CONTENT ===== */
.search-tab-content {
    display: none;
}

.search-tab-content.active {
    display: block;
    animation: searchFadeIn .35s ease;
}

@keyframes searchFadeIn {
    from { opacity: 0; transform: translateY(8px) }
    to { opacity: 1; transform: none }
}

/* ===== FORM ===== */
.search-form-modern {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.search-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .75rem;
}

.search-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.search-field label {
    font-size: .68rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: .8px;
}

.search-field select,
.search-field input {
    padding: 12px 14px;
    border: 1.5px solid #e5e7eb;
    border-radius: 12px;
    font-size: .88rem;
    color: #0f172a;
    background: #fff;
    transition: all .25s ease;
    appearance: none;
    font-family: inherit;
    outline: none;
}

.search-field select {
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2394a3b8'/%3E%3C/svg%3E") no-repeat right 14px center;
    padding-right: 2.5rem;
    cursor: pointer;
}

.search-field select:focus,
.search-field input:focus {
    border-color: #1a5f4a;
    box-shadow: 0 0 0 3px rgba(26, 95, 74, .08);
}

.search-field select:hover,
.search-field input:hover {
    border-color: #cbd5e1;
}

/* ===== ADVANCED TOGGLE ===== */
.search-advanced-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 20px;
    background: transparent;
    border: 1.5px dashed #d1d5db;
    border-radius: 10px;
    font-size: .8rem;
    font-weight: 600;
    color: #94a3b8;
    cursor: pointer;
    transition: all .25s ease;
    font-family: inherit;
    margin: 0 auto;
    width: fit-content;
}

.search-advanced-toggle:hover {
    border-color: #1a5f4a;
    color: #1a5f4a;
    background: rgba(26, 95, 74, .03);
}

.search-advanced-toggle i {
    transition: transform .3s ease;
    font-size: .7rem;
}

.search-advanced-toggle.active {
    border-style: solid;
    border-color: #1a5f4a;
    color: #1a5f4a;
    background: rgba(26, 95, 74, .05);
}

.search-advanced-toggle.active i {
    transform: rotate(180deg);
}

/* Advanced Fields */
.search-advanced-fields {
    display: none;
    padding-top: 1rem;
}

.search-advanced-fields.show {
    display: block;
    animation: searchSlideDown .35s ease;
}

@keyframes searchSlideDown {
    from { opacity: 0; transform: translateY(-8px) }
    to { opacity: 1; transform: none }
}

.search-row-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: .75rem;
}

/* ===== SUBMIT BUTTON ===== */
.search-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #1a5f4a 0%, #22785e 100%);
    color: #fff;
    border: none;
    border-radius: 14px;
    font-size: .95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all .35s ease;
    margin-top: .5rem;
    font-family: inherit;
    position: relative;
    overflow: hidden;
}

.search-submit::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    width: 0; height: 0;
    background: rgba(255, 255, 255, .1);
    border-radius: 50%;
    transition: width .5s, height .5s;
    transform: translate(-50%, -50%);
}

.search-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(26, 95, 74, .35);
}

.search-submit:hover::after {
    width: 400px; height: 400px;
}

.search-submit:active {
    transform: translateY(0);
}

.search-submit i {
    font-size: 1rem;
    transition: transform .3s;
}

.search-submit:hover i {
    transform: rotate(15deg) scale(1.1);
}

/* ===== QUICK LINKS ===== */
.search-quick-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 2rem;
}

.search-quick-links .quick-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, .06) !important;
    color: rgba(255, 255, 255, .55) !important;
    font-size: .78rem;
    font-weight: 600;
    border-radius: 50px;
    text-decoration: none !important;
    transition: all .3s ease;
    border: 1px solid rgba(255, 255, 255, .08) !important;
    backdrop-filter: blur(4px);
}

.search-quick-links .quick-link:visited {
    color: rgba(255, 255, 255, .55) !important;
}

.search-quick-links .quick-link:focus,
.search-quick-links .quick-link:active {
    background: rgba(255, 255, 255, .06) !important;
    color: rgba(255, 255, 255, .55) !important;
    outline: none;
}

.search-quick-links .quick-link:hover {
    background: rgba(26, 95, 74, .8) !important;
    color: #fff !important;
    border-color: rgba(26, 95, 74, .6) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(26, 95, 74, .2);
}

.search-quick-links .quick-link i {
    font-size: .78rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 991px) {
    .search-row,
    .search-row-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .search-section-modern {
        padding: 3.5rem 0;
    }

    .search-box {
        padding: 1.5rem;
        border-radius: 18px;
    }

    .search-tabs {
        width: 100%;
    }

    .search-tab {
        flex: 1;
        justify-content: center;
        padding: 10px 16px;
        font-size: .82rem;
    }

    .search-row,
    .search-row-4 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .search-section-modern {
        padding: 2.5rem 0;
    }

    .search-header h2 {
        font-size: 1.5rem;
    }

    .search-header p {
        font-size: .88rem;
    }
}

/* ===== HEADER HIGHLIGHT ===== */
.sh-highlight {
    background: linear-gradient(135deg, #34d399, #c9a227);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== LIVE SEARCH BAR ===== */
.sh-live-wrap {
    position: relative;
    margin-bottom: 1.25rem;
}

.sh-live-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 6px 4px 18px;
    background: #f8fafb;
    border: 2px solid #e5e7eb;
    border-radius: 16px;
    transition: all .3s ease;
}

.sh-live-bar:focus-within {
    border-color: #1a5f4a;
    box-shadow: 0 0 0 4px rgba(26, 95, 74, .08);
    background: #fff;
}

.sh-live-icon {
    color: #94a3b8;
    font-size: .9rem;
    flex-shrink: 0;
    transition: color .3s;
}

.sh-live-bar:focus-within .sh-live-icon {
    color: #1a5f4a;
}

.sh-live-input {
    flex: 1;
    padding: 14px 0;
    border: none;
    background: transparent;
    font-size: .92rem;
    color: #0f172a;
    outline: none;
    font-family: inherit;
}

.sh-live-input::placeholder {
    color: #94a3b8;
}

.sh-live-count {
    font-size: .7rem;
    font-weight: 600;
    color: #1a5f4a;
    white-space: nowrap;
    padding: 4px 10px;
    background: rgba(26, 95, 74, .06);
    border-radius: 8px;
}

.sh-live-count:empty {
    display: none;
}

.sh-live-clear {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    border: none;
    background: #f1f5f9;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .2s;
    flex-shrink: 0;
}

.sh-live-clear:hover {
    background: #ef4444;
    color: #fff;
}

/* ===== LIVE RESULTS ===== */
.sh-live-results {
    position: absolute;
    top: calc(100% + 6px);
    left: 0; right: 0;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .12);
    border: 1px solid #e5e7eb;
    max-height: 420px;
    overflow-y: auto;
    z-index: 100;
    display: none;
}

.sh-live-results.open {
    display: block;
    animation: shSlideDown .25s ease;
}

@keyframes shSlideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: none; }
}

/* Result Card */
.sh-result-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    text-decoration: none;
    border-bottom: 1px solid #f1f5f9;
    transition: background .15s;
}

.sh-result-card:hover {
    background: #f8fafb;
}

.sh-result-card:last-of-type {
    border-bottom: none;
}

.sh-rc-img {
    width: 72px;
    height: 56px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    background: #f1f5f9;
}

.sh-rc-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sh-rc-noimg {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #cbd5e1;
    font-size: 1.2rem;
}

.sh-rc-body {
    flex: 1;
    min-width: 0;
}

.sh-rc-top {
    display: flex;
    gap: 5px;
    margin-bottom: 2px;
}

.sh-rc-tipo {
    font-size: .58rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    background: #f1f5f9;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: .3px;
}

.sh-rc-op {
    font-size: .55rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}

.sh-sale { background: rgba(26, 95, 74, .1); color: #1a5f4a; }
.sh-rent { background: rgba(201, 162, 39, .1); color: #b8941d; }

.sh-rc-title {
    font-size: .8rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sh-rc-loc {
    font-size: .65rem;
    color: #94a3b8;
    margin: 1px 0 0;
    display: flex;
    align-items: center;
    gap: 3px;
}

.sh-rc-loc i {
    font-size: .5rem;
    color: #1a5f4a;
}

.sh-rc-feats {
    display: flex;
    gap: 6px;
    margin-top: 2px;
}

.sh-rc-feats span {
    font-size: .6rem;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 2px;
}

.sh-rc-feats i {
    font-size: .5rem;
    color: #1a5f4a;
}

.sh-rc-price {
    font-size: .85rem;
    font-weight: 800;
    color: #1a5f4a;
    white-space: nowrap;
    flex-shrink: 0;
}

/* View More */
.sh-result-more {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px;
    font-size: .78rem;
    font-weight: 700;
    color: #1a5f4a;
    text-decoration: none;
    border-top: 1px solid #f1f5f9;
    transition: background .15s;
}

.sh-result-more:hover {
    background: rgba(26, 95, 74, .04);
    color: #1a5f4a;
}

/* No Results */
.sh-no-results {
    padding: 2rem;
    text-align: center;
    color: #94a3b8;
}

.sh-no-results i {
    font-size: 1.5rem;
    margin-bottom: .5rem;
    opacity: .4;
}

.sh-no-results p {
    font-size: .82rem;
    margin: 0;
}

/* ===== DIVIDER ===== */
.sh-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 1.25rem;
    color: #cbd5e1;
    font-size: .72rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .8px;
}

.sh-divider::before,
.sh-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}

/* ===== ACTIONS ===== */
.sh-actions {
    display: flex;
    justify-content: center;
    margin-top: .75rem;
}

.sh-actions .search-submit {
    width: auto;
    min-width: 240px;
    border-radius: 14px;
}

/* ===== CATEGORIES ===== */
.sh-cats {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 2rem;
}

.sh-cat {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, .06);
    color: rgba(255, 255, 255, .5);
    font-size: .78rem;
    font-weight: 600;
    border-radius: 50px;
    text-decoration: none;
    transition: all .3s;
    border: 1px solid rgba(255, 255, 255, .08);
    backdrop-filter: blur(4px);
}

.sh-cat:hover {
    background: rgba(26, 95, 74, .7);
    color: #fff;
    border-color: rgba(26, 95, 74, .5);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(26, 95, 74, .2);
}

.sh-cat-all {
    background: rgba(26, 95, 74, .15);
    color: rgba(255, 255, 255, .7);
    border-color: rgba(26, 95, 74, .25);
}

/* ===== ADVANCED TOGGLE ===== */
.search-advanced-toggle .sh-chev {
    transition: transform .3s;
    font-size: .65rem;
}

.search-advanced-toggle.active .sh-chev {
    transform: rotate(180deg);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
    .sh-live-input {
        font-size: .82rem;
    }

    .sh-live-input::placeholder {
        font-size: .75rem;
    }

    .sh-rc-img {
        width: 56px;
        height: 44px;
    }

    .sh-cats {
        gap: 6px;
    }

    .sh-cat {
        font-size: .7rem;
        padding: 6px 12px;
    }

    .sh-actions .search-submit {
        width: 100%;
        min-width: auto;
    }
}