/* Property Search Styles */

/* ================================================
   1. Homepage Styles
   ================================================ */

.search-homepage {
    /*background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);*/
    min-height: 100vh;
}

/* Hero Section */
.hero-section {
    padding: 2rem 0 2rem;
    color: #000;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.9);
}

/* Search Form Container */
.search-form-container {
    max-width: 600px;
    margin: 0 auto;
}

.search-form-container .card {
    border-radius: 15px;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.search-form-container .card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border: none;
    padding: 1.25rem;
}

.search-form-container .card-body {
    padding: 2rem;
}

/* ================================================
   2. City Selection Styles
   ================================================ */

.city-select-container {
    position: relative;
}

.city-select-container .form-select {
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.city-select-container .form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.city-autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.city-autocomplete-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.city-autocomplete-item:hover,
.city-autocomplete-item.highlighted {
    background-color: #f8f9fa;
}

.city-autocomplete-item:last-child {
    border-bottom: none;
}

.city-autocomplete-item .city-name {
    font-weight: 600;
    color: #333;
}

.city-autocomplete-item .city-state {
    font-size: 0.875rem;
    color: #666;
}

/* ================================================
   3. Locality Selection Styles
   ================================================ */

.locality-input-container {
    position: relative;
}

.locality-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    min-height: 0;
}

.locality-tag {
    display: inline-flex;
    align-items: center;
    background: var(--rightghar-primary);
    color: var(--rightghar-black);
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

.locality-tag .remove-tag {
    background: none;
    border: none;
    color: #000;
    margin-left: 0.5rem;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    padding: 0;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.locality-tag .remove-tag:hover {
    opacity: 1;
}

.locality-input-container .form-control {
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    transition: all 0.3s ease;
    padding: 0.2rem 0.75rem !important;
}

.locality-input-container .form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.locality-autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 180px;
    overflow-y: auto;
    z-index: 1050;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.locality-autocomplete-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.locality-autocomplete-item:hover,
.locality-autocomplete-item.highlighted {
    background-color: #60b2ff;
}

.locality-autocomplete-item:last-child {
    border-bottom: none;
}

.locality-autocomplete-item .locality-name {
    font-weight: 600;
    color: #333;
}

.locality-autocomplete-item .locality-details {
    font-size: 0.875rem;
    color: #666;
}

/* Custom locality item styling */
.locality-autocomplete-item.custom-locality-item {
    background-color: #f8f9fa;
    border-left: 3px solid #667eea;
}

.locality-autocomplete-item.custom-locality-item:hover,
.locality-autocomplete-item.custom-locality-item.highlighted {
    background-color: #e9ecef;
}

.locality-autocomplete-item.custom-locality-item .locality-name {
    color: #667eea;
    font-style: italic;
}

.locality-autocomplete-item.custom-locality-item .locality-details {
    color: #6c757d;
    font-size: 0.8rem;
}

/* ================================================
   4. Listing Type Toggle Styles
   ================================================ */

.listing-type-toggle .btn-group {
    overflow: hidden;
}

.listing-type-toggle .btn {
    transition: all 0.3s ease;
}

.listing-type-toggle .btn-outline-primary {
    color: var(--rightghar-black);
    background: white;
}

.listing-type-toggle .btn-check:checked + .btn-outline-primary {
    color: var(--rightghar-black);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

/* ================================================
   5. Trust Indicators
   ================================================ */

.trust-indicators {
    margin-top: 3rem;
}

.trust-indicators .col-md-4 {
    padding: 1rem;
}

.trust-indicators i {
    margin-bottom: 0.5rem;
}

.trust-indicators p {
    color: #000;
    font-weight: 500;
}

/* ================================================
   6. Search Form Fragment Styles
   ================================================ */

.search-form-fragment .form-select,
.search-form-fragment .form-control {
    border-radius: 0;
}

.search-form-fragment .input-group-text {
    background: #f8f9fa;
    border-color: #dee2e6;
    color: #6c757d;
}

.search-modification-bar {
    top: 0;
    z-index: 1020;
    backdrop-filter: blur(10px);
    background: rgba(248, 249, 250, 0.95) !important;
    margin-top: 5px;
}

.search-criteria-display {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.search-criteria-item {
    display: inline-flex;
    align-items: center;
    margin-right: 1rem;
    margin-bottom: 0.25rem;
}

/* ================================================
   7. Suggested Properties Section
   ================================================ */

.suggested-properties-section {
    background: white;
    margin-top: -50px;
    border-radius: 25px 25px 0 0;
    position: relative;
    z-index: 10;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    color: #333;
}

/* ================================================
   8. Form Validation Styles
   ================================================ */

.was-validated .form-select:invalid,
.form-select.is-invalid {
    border-color: #dc3545;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
}

.was-validated .form-select:valid,
.form-select.is-valid {
    border-color: #198754;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23198754' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
}

/* ================================================
   9. Loading States
   ================================================ */

.search-form-loading {
    pointer-events: none;
    opacity: 0.7;
}

.search-form-loading .btn {
    position: relative;
}

.search-form-loading .spinner-border {
    width: 1rem;
    height: 1rem;
}

/* ================================================
   10. Responsive Design
   ================================================ */

/* Tablet Styles */
@media (max-width: 991.98px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .search-form-container .card-body {
        padding: 1.5rem;
    }
    
    .trust-indicators {
        margin-top: 2rem;
    }
}

/* Mobile Styles */
@media (max-width: 767.98px) {
    .hero-section {
        padding: 2rem 0 1rem;
    }
    
    .hero-title {
        font-size: 1.75rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .search-form-container .card-body {
        padding: 1.25rem;
    }
    
    .listing-type-toggle .btn {
        font-size: 0.9rem;
    }
    
    .trust-indicators {
        margin-top: 1.5rem;
    }
    
    .trust-indicators .col-md-4 {
        margin-bottom: 1rem;
    }
    
    .search-criteria-display {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .search-criteria-item {
        margin-right: 0;
        margin-bottom: 0.5rem;
    }
    
    .suggested-properties-section {
        margin-top: -25px;
    }
}

/* Extra Small Mobile */
@media (max-width: 575.98px) {
    .hero-title {
        font-size: 1.5rem;
    }
    
    .search-form-container {
        margin: 0 1rem;
    }
    
    .search-form-container .card-body {
        padding: 1rem;
    }
    
    .locality-tags {
        margin-bottom: 0.5rem;
    }
    
    .locality-tag {
        font-size: 0.8rem;
        padding: 0.25rem 0.5rem;
    }
}

/* ================================================
   11. Animation and Transitions
   ================================================ */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-form-container .card {
    animation: fadeInUp 0.8s ease-out;
}

.trust-indicators {
    animation: fadeInUp 1s ease-out 0.3s both;
}

.locality-tag {
    animation: fadeInUp 0.3s ease-out;
}

/* Hover effects */
/*.search-form-container .card:hover {*/
/*    transform: translateY(-5px);*/
/*    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);*/
/*    transition: all 0.3s ease;*/
/*}*/

/* Focus states */
.form-control:focus,
.form-select:focus {
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* ================================================
   12. Accessibility Enhancements
   ================================================ */

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .hero-section {
        background: #000;
        color: #fff;
    }
    
    .search-form-container .card {
        border: 2px solid #fff;
    }
    
    .btn-primary {
        background: #fff;
        color: #000;
        border: 2px solid #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ================================================
   Search Modification Bar Styles
   ================================================ */

.mod-locality-input-container .locality-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-bottom: 0;
    min-height: 0;
}

.mod-locality-input-container .locality-tag {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    white-space: nowrap;
}

.mod-locality-input-container .locality-tag .remove-tag {
    margin-left: 0.25rem;
    font-size: 0.875rem;
}

.mod-locality-input-container .locality-input-field {
    border: none;
    outline: none;
    background: transparent;
    flex: 1;
    min-width: 60px;
    font-size: 0.875rem;
    padding: 0.25rem;
}

.mod-locality-input-container .locality-input-field::placeholder {
    color: #999;
    font-size: 0.8rem;
}

/* Responsive adjustments for modification bar */
@media (max-width: 768px) {
    .mod-locality-input-container .locality-tag {
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
    }
}

/* Fix z-index issues for modification bar autocomplete */
.search-modification-bar-content {
    position: relative;
    z-index: 1050; /* Higher than sticky filters */
}

.search-modification-bar-content .locality-autocomplete-dropdown {
    z-index: 1060 !important; /* Ensure dropdown appears above everything */
    /* Remove position fixed to maintain proper positioning relative to input */
}

/* Alternative fix: Ensure all input groups in modification bar have proper stacking */
.search-modification-bar .input-group,
.search-modification-bar-content .input-group {
    position: relative;
    z-index: 1055;
}

/* Ensure the modification bar itself has higher z-index than sticky bar */
.search-modification-bar {
    position: relative;
    z-index: 1050;
}

/* Specific fix for modification bar locality container positioning */
.mod-locality-input-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
    min-height: 24px;
    width: 100%;
    position: relative; /* Create positioning context for dropdown */
    z-index: 1055; /* Ensure this container is above sticky bar */
}

/* Ensure the autocomplete dropdown in modification bar has correct width and positioning */
.mod-locality-input-container .locality-autocomplete-dropdown {
    position: absolute !important;
    width: 100% !important; /* Match the container width */
    left: 0 !important;
    right: auto !important;
    z-index: 1060 !important;
}

/* ================================================
   10. Homepage Locality Input Container Styles
   ================================================ */

.homepage-locality-input-container {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.25rem;
    min-height: 34px;
    padding: 0.1rem;
    position: relative;
}

.homepage-locality-input-container .locality-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    align-items: center;
    margin: 0.2rem 0;
    min-height: 0;
}

.homepage-locality-input-container .locality-tag {
    display: inline-flex;
    align-items: center;
    background: var(--rightghar-primary);
    color: var(--rightghar-black);
    padding: 0.25rem 0.5rem;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
}

.homepage-locality-input-container .locality-tag .remove-tag {
    background: none;
    border: none;
    color: #fff;
    margin-left: 0.375rem;
    cursor: pointer;
    font-size: 0.875rem;
    line-height: 1;
    padding: 0;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.homepage-locality-input-container .locality-tag .remove-tag:hover {
    opacity: 1;
}

.homepage-locality-input-container .locality-input-field {
    border: none;
    outline: none;
    flex: 1;
    min-width: 120px;
    padding: 0.25rem 0;
    font-size: 1rem;
    background: transparent;
}

.homepage-locality-input-container .locality-input-field::placeholder {
    color: #6c757d;
    opacity: 0.8;
}

.homepage-locality-input-container .locality-input-field:focus {
    outline: none;
    box-shadow: none;
}

/* Form control styling for homepage locality container */
.form-control-like {
    display: block;
    width: 100%;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #212529;
    background-color: #fff;
    background-image: none;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    padding: 0;
}

.form-control-like:focus-within {
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.form-control-like.no-padding {
    padding: 0 !important;
}

.ws-nowrap {
    white-space: nowrap;
}

/* Responsive adjustments for homepage locality container */
@media (max-width: 768px) {
    .homepage-locality-input-container {
        padding: 0.25rem;
        min-height: 32px;
    }
    
    .homepage-locality-input-container .locality-input-field {
        min-width: 100px;
        font-size: 0.875rem;
    }
    
    .homepage-locality-input-container .locality-tag {
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
    }
}
