/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Open Sans', sans-serif;
    line-height: 1.6;
    color: #333;
}

/* Custom Variables */
:root {
    --primary-blue: #006AFF;
    --dark-blue: #003F7F;
    --light-gray: #F7F8FA;
    --border-gray: #E5E7EB;
    --text-gray: #6B7280;
    --success-green: #10B981;
    --danger-red: #EF4444;
}

/* Navbar Styles */
.navbar {
    border-bottom: 1px solid var(--border-gray);
    padding: 0.5rem 0;
}

.nav-link {
    color: #333 !important;
    font-weight: 500;
    padding: 0.75rem 1rem !important;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: var(--primary-blue) !important;
}

/* Dropdown Menu Positioning Fix */
.navbar-nav .nav-item.dropdown .dropdown-menu {
    left: 50% !important;
    transform: translateX(-50%) !important;
    margin-top: 0.5rem !important;
}

.dropdown-menu {
    border: none;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    padding: 0.5rem 0;
    min-width: 200px;
}

.dropdown-item {
    padding: 0.75rem 1.5rem;
    font-weight: 400;
    transition: background-color 0.2s ease;
}

.dropdown-item:hover {
    background-color: var(--light-gray);
    color: var(--primary-blue);
}

/* Hide default Bootstrap arrow since we're using icons */
.dropdown-toggle::after {
    display: none;
}

/* Ensure proper positioning on mobile */
@media (max-width: 991.98px) {
    .navbar-nav .nav-item.dropdown .dropdown-menu {
        left: 0 !important;
        transform: none !important;
        margin-top: 0 !important;
        border: none;
        box-shadow: none;
        background-color: #f8f9fa;
    }
}

/* Hero Section */
.hero-section {
    position: relative;
    height: 100vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
}

.hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.2));
    z-index: -1;
}

.hero-content {
    position: relative;
    z-index: 1;
    width: 100%;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    margin-bottom: 2rem;
}

/* Search Container */
.search-container {
    max-width: 600px;
    margin: 0 auto;
}

.search-tabs {
    display: flex;
    justify-content: center;
    gap: 0;
    margin-bottom: 1.5rem;
}

.search-tab {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    padding: 1rem 2rem;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: 8px 8px 0 0;
}

.search-tab:first-child {
    border-radius: 8px 0 0 0;
}

.search-tab:last-child {
    border-radius: 0 8px 0 0;
}

.search-tab.active {
    background: white;
    color: var(--primary-blue);
    transform: translateY(-2px);
}

.search-form {
    background: white;
    border-radius: 0 0 8px 8px;
    padding: 1.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.search-input-container {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 1rem;
    color: var(--text-gray);
    z-index: 2;
}

.search-input {
    flex: 1;
    border: 2px solid var(--border-gray);
    border-radius: 8px;
    padding: 1rem 1rem 1rem 3rem;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s ease;
}

.search-input:focus {
    border-color: var(--primary-blue);
}

.search-btn {
    background: var(--primary-blue);
    border: none;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    color: white;
    margin-left: 0.5rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.search-btn:hover {
    background: var(--dark-blue);
}

/* Services Section */
.services-section {
    padding: 5rem 0;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 3rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.service-card {
    padding: 2rem;
    height: 100%;
    transition: transform 0.3s ease;
}

.service-card:hover {
    transform: translateY(-5px);
}

.service-icon {
    color: var(--primary-blue);
    font-size: 3rem;
}

.service-card h4 {
    font-weight: 600;
    margin-bottom: 1rem;
    color: #333;
}

.service-card p {
    color: var(--text-gray);
    margin-bottom: 1.5rem;
}

/* Market Stats */
.market-stats {
    background: var(--light-gray);
}

.stat-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    height: 100%;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-gray);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.stat-change {
    font-size: 0.875rem;
    font-weight: 500;
}

.stat-change.positive {
    color: var(--success-green);
}

.stat-change.negative {
    color: var(--danger-red);
}

/* Featured Listings */
.featured-listings {
    padding: 5rem 0;
}

.property-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
}

.property-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.property-image-container {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.property-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.property-card:hover .property-image {
    transform: scale(1.05);
}

.save-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 2;
}

.save-btn:hover {
    background: white;
    transform: scale(1.1);
}

.save-btn.saved {
    background: var(--primary-blue);
    color: white;
}

.property-status {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: var(--primary-blue);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 600;
}

.property-status.rental {
    background: var(--success-green);
}

.property-info {
    padding: 1.5rem;
}

.property-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 0.5rem;
}

.property-details {
    color: var(--text-gray);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.property-address {
    color: var(--text-gray);
    font-size: 0.875rem;
}

/* Footer */
.footer {
    background: #1f2937 !important;
}

.footer h5 {
    color: white;
    font-weight: 600;
    margin-bottom: 1rem;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.75rem;
}

.footer-links a {
    color: #9CA3AF;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: white;
}

.social-links {
    display: flex;
    align-items: center;
}

.social-link {
    color: #9CA3AF;
    font-size: 1.25rem;
    transition: color 0.3s ease;
}

.social-link:hover {
    color: white;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .search-tabs {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .search-tab {
        border-radius: 8px !important;
        justify-content: center;
    }
    
    .search-input-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .search-btn {
        margin-left: 0;
        width: 100%;
    }
    
    .stat-card {
        margin-bottom: 1rem;
    }
}

@media (max-width: 576px) {
    .hero-section {
        min-height: 500px;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .search-container {
        padding: 0 1rem;
    }
    
    .search-form {
        padding: 1rem;
    }
    
    .service-card {
        padding: 1.5rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
}

/* Loading Animation */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--primary-blue);
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Additional Utility Classes */
.text-primary {
    color: var(--primary-blue) !important;
}

.bg-primary {
    background-color: var(--primary-blue) !important;
}

.btn-primary {
    background-color: var(--primary-blue);
    border-color: var(--primary-blue);
}

.btn-primary:hover {
    background-color: var(--dark-blue);
    border-color: var(--dark-blue);
}

.btn-outline-primary {
    color: var(--primary-blue);
    border-color: var(--primary-blue);
}

.btn-outline-primary:hover {
    background-color: var(--primary-blue);
    border-color: var(--primary-blue);
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Focus States for Accessibility */
.search-input:focus,
.search-btn:focus,
.search-tab:focus {
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-blue);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--dark-blue);
}