/* ===========================
   Hero Section Styles (Index)
   Dedicated stylesheet for hero section only
   =========================== */

/* Main hero wrapper and background */
.hero-section {
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    background-image: url('../images/hero-bg.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    position: relative;
    padding: 100px 0;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
}

.hero-section .container {
    max-width: 1200px !important;
    position: relative;
    z-index: 2;
}

.hero-title {
    color: #ffffff;
    font-size: 3.5rem;
}

.hero-subtitle {
    color: #f8f9fa;
    font-size: 1.25rem;
}

/* Search box and tabs inside hero */
.search-box {
    background: var(--white);
    padding: 2.2rem 2.5rem 2.5rem 2.5rem;
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.12);
    animation: fadeInUp 0.9s ease 0.3s, floatLift 5.5s ease-in-out 1.4s infinite;
    animation-fill-mode: both;
    position: relative;
    z-index: 50;
}

.search-box::before {
    content: "";
    position: absolute;
    top: 0;
    left: -130%;
    width: 65%;
    height: 100%;
    background: linear-gradient(110deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.35) 45%, rgba(255,255,255,0) 100%);
    transform: skewX(-20deg);
    animation: lightSweep 4.8s ease-in-out 1.8s infinite;
    pointer-events: none;
    z-index: 0;
}

.search-box > * {
    position: relative;
    z-index: 5;
}

.property-tabs {
    border-bottom: 1px solid #dee2e6;
    gap: 0;
    margin-bottom: 1.5rem;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.property-tabs::-webkit-scrollbar {
    display: none;
}

.property-tabs .nav-item {
    margin: 0;
    flex: 0 0 auto;
}

.property-tabs .nav-link {
    border: none;
    background: transparent;
    color: #9ca3af;
    font-weight: 500;
    padding: 0.7rem 1.3rem;
    border-radius: 0;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    border-bottom: 3px solid transparent;
    margin-bottom: -1px;
    position: relative;
}

.property-tabs .nav-link:hover {
    color: var(--primary-color);
    border-bottom-color: rgba(255, 107, 53, 0.3);
}

.property-tabs .nav-link.active {
    background: transparent;
    color: var(--primary-color);
    font-weight: 600;
    border-bottom-color: var(--primary-color);
    animation: tabBounce 0.35s ease;
}

.property-tabs .nav-link.active::after {
    content: "";
    position: absolute;
    left: 8%;
    right: 8%;
    bottom: -3px;
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, #ff8a5b, #ff6b35, #ff8a5b);
    background-size: 200% 100%;
    animation: tabLineFlow 0.7s ease;
}

.search-input-group {
    position: relative;
}

.ai-toggle-wrapper {
    position: absolute;
    top: 1.2rem;
    right: 1.5rem;
    z-index: 10;
}

.btn-ai-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 99px;
    border: 1px solid rgba(44, 110, 145, 0.2);
    background: #fff;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.btn-ai-toggle:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
    border-color: #2c6e91;
}

.ai-stars {
    color: #eb8944;
    font-size: 1.1rem;
    display: flex;
    animation: sparkle 2s infinite;
}

.ai-text {
    font-size: 0.85rem;
    font-weight: 700;
    color: #2c6e91;
}

.search-flip-wrap {
    perspective: 2000px;
    position: relative;
    width: 100%;
    z-index: 30;
}

.search-flip-card {
    position: relative;
    width: 100%;
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    min-height: 120px;
    z-index: 31;
}

.search-flip-card.is-flipped {
    transform: rotateY(180deg);
}

.search-flip-face {
    width: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.search-flip-back {
    position: absolute;
    top: 0;
    left: 0;
    transform: rotateY(180deg);
}

/* AI mode in hero search */
.ai-search-container {
    background: linear-gradient(135deg, #f0f7ff 0%, #ffffff 100%);
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid #dbeafe;
}

.ai-badge {
    background: #2c6e91;
    color: #fff;
    padding: 4px 12px;
    border-radius: 99px;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    width: fit-content;
}

.ai-input-wrapper {
    display: flex;
    gap: 12px;
    align-items: center;
}

.ai-search-input-main {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.ai-input-icon {
    position: absolute;
    left: 15px;
    color: #2c6e91;
    font-size: 1.2rem;
}

.ai-query-input {
    padding: 14px 110px 14px 45px !important;
    border-radius: 12px !important;
    border: 2px solid #e2e8f0 !important;
    background: #fff !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05) !important;
    font-size: 1.05rem !important;
    width: 100%;
}

.ai-query-input:focus {
    border-color: #2c6e91 !important;
    box-shadow: 0 4px 20px rgba(44, 110, 145, 0.15) !important;
    outline: none;
}

.btn-ocr-action {
    position: absolute;
    right: 10px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #495057;
    transition: all 0.2s;
}

.btn-ocr-action:hover {
    background: #e9ecef;
    color: #212529;
}

.btn-ai-search {
    background: #2c6e91;
    color: #fff;
    padding: 14px 25px;
    border-radius: 12px;
    font-weight: 700;
    border: none;
    transition: all 0.3s;
    white-space: nowrap;
}

.btn-ai-search:hover {
    background: #1e4d66;
    transform: translateX(4px);
    color: #fff;
}

.ai-chip {
    background: #fff;
    border: 1px solid #e2e8f0;
    padding: 6px 14px;
    border-radius: 99px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
    outline: none;
}

.ai-chip:hover {
    border-color: #2c6e91;
    color: #2c6e91;
    background: #f0f7ff;
}

.city-suggest-box {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
    max-height: 220px;
    overflow-y: auto;
    z-index: 50;
}

.city-suggest-item {
    padding: 10px 12px;
    font-size: 0.92rem;
    color: #334155;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
}

.city-suggest-item:last-child {
    border-bottom: none;
}

.city-suggest-item:hover {
    background: #f8fafc;
    color: #2c6e91;
}

.search-input-group .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    font-size: 1rem;
    z-index: 1;
}

.search-input-group .search-input {
    padding: 0.75rem 0.75rem 0.75rem 42px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-weight: 400;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    color: #495057;
}

.search-input-group .search-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.15rem rgba(255, 107, 53, 0.1);
    outline: none;
}

.search-input-group .search-input::placeholder {
    color: #adb5bd;
    font-weight: 400;
}

.search-box .form-select {
    padding: 0.75rem 0.75rem;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-weight: 400;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    color: #495057;
}

.search-box .form-select:hover,
.search-input-group .search-input:hover {
    border-color: #ffb193;
}

.search-box .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.15rem rgba(255, 107, 53, 0.1);
}

.btn-search {
    background: var(--primary-color);
    color: #ffffff;
    border: none;
    padding: 0.75rem 1.8rem;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.btn-search:hover {
    background: #e55a2b;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
    color: #ffffff;
}

.search-form .btn-outline-secondary {
    border-width: 1.5px;
    transition: all 0.25s ease;
}

.search-form .btn-outline-secondary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.08);
}

.search-form .row > div {
    animation: riseIn 0.5s ease both;
}

.search-form .row > div:nth-child(2) {
    position: relative;
    z-index: 999;
}

.search-box.tab-switching .search-form .row > div:nth-child(1) { animation-delay: 0.02s; }
.search-box.tab-switching .search-form .row > div:nth-child(2) { animation-delay: 0.05s; }
.search-box.tab-switching .search-form .row > div:nth-child(3) { animation-delay: 0.08s; }
.search-box.tab-switching .search-form .row > div:nth-child(4) { animation-delay: 0.11s; }
.search-box.tab-switching .search-form .row > div:nth-child(5) { animation-delay: 0.14s; }

/* Hero feature points below search box */
.hero-features {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    margin-top: 1.2rem;
    padding: 0 3rem;
    position: relative;
    z-index: 1;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #1a1a1a;
    font-size: 0.9rem;
    font-weight: 500;
}

.feature-item i {
    color: #10b981;
    font-size: 1.2rem;
}

.recent-search-section {
    padding: 0.8rem 1.2rem;
    border-radius: 6px;
    font-size: 0.9rem;
    display: inline-block;
    margin-top: 1.5rem;
}

.recent-search-section .recent-label {
    color: #ffffff;
    font-weight: 500;
    margin-right: 0.8rem;
}

.recent-search-section .recent-item {
    color: #1a1a1a;
    background: #ffffff;
    padding: 0.4rem 1rem;
    border-radius: 6px;
    display: inline-block;
    font-weight: 400;
}

/* Hero animations */
@keyframes sparkle {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.1); }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes riseIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes lightSweep {
    0% {
        left: -130%;
        opacity: 0;
    }
    15% {
        opacity: 1;
    }
    55%,
    100% {
        left: 155%;
        opacity: 0;
    }
}

@keyframes floatLift {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-4px);
    }
}

@keyframes tabLineFlow {
    from {
        background-position: 100% 0;
        opacity: 0.4;
    }
    to {
        background-position: 0 0;
        opacity: 1;
    }
}

@keyframes tabBounce {
    0% { transform: translateY(0); }
    50% { transform: translateY(-2px); }
    100% { transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .search-box,
    .search-box::before,
    .search-form .row > div,
    .property-tabs .nav-link.active,
    .property-tabs .nav-link.active::after {
        animation: none !important;
    }
}

/* Hero-only responsive adjustments */
@media (max-width: 992px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }
}

@media (max-width: 991px) {
    .ai-input-wrapper {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-ai-search {
        width: 100%;
    }

    .hero-section {
        padding: 60px 0;
        min-height: auto;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .property-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 5px;
    }

    .property-tabs .nav-item {
        flex: 0 0 auto;
    }

    .search-box {
        padding: 1.5rem;
    }
}

@media (max-width: 768px) {
    .hero-section {
        padding: 60px 0;
        min-height: auto;
    }

    .hero-title {
        font-size: 2.2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 2rem;
    }

    .search-form .row > div {
        margin-bottom: 15px;
    }

    .search-form .col-md-2,
    .search-form .col-md-3 {
        width: 100% !important;
    }

    .btn-search {
        width: 100%;
        margin-top: 10px;
    }

    .search-box {
        padding: 1.5rem;
    }

    .ai-toggle-wrapper {
        position: static;
        margin-bottom: 1rem;
        display: flex;
        justify-content: center;
    }

    .btn-ai-toggle {
        width: 100%;
        justify-content: center;
    }

    .hero-features {
        padding: 0 10px;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .hero-section .bg-white.rounded-4 {
        min-width: 100% !important;
        padding: 20px !important;
    }

    .search-flip-card {
        min-height: 350px;
    }

    .search-input-group .search-input {
        font-size: 0.9rem;
    }
}
