/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-y: scroll;
}

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #10b981;
    --dark: #1e293b;
    --gray: #64748b;
    --light: #f1f5f9;
    --white: #ffffff;
    --border: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --radius: 12px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--dark);
    line-height: 1.6;
    background: var(--white);
}

a {
    text-decoration: none;
    color: inherit;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-outline {
    border: 1px solid var(--border);
    color: var(--gray);
    background: transparent;
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-large {
    padding: 14px 32px;
    font-size: 16px;
}

/* ===== HEADER ===== */
.header {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
}

.nav {
    display: flex;
    gap: 32px;
    align-items: center;
}

.nav a {
    color: var(--gray);
    font-size: 15px;
    font-weight: 500;
    padding: 8px 0;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.nav a:hover, .nav a.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
    min-width: 120px;
    z-index: 200;
}

.dropdown-menu a {
    display: block;
    padding: 10px 16px;
    font-size: 14px;
    color: var(--dark);
    border: none !important;
    border-radius: 0 !important;
}

.dropdown-menu a:hover {
    background: var(--light);
    color: var(--primary);
}

.nav-dropdown:hover .dropdown-menu {
    display: block;
}
}

.header-actions {
    display: flex;
    gap: 12px;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
}

/* ===== HERO ===== */
.hero {
    background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 50%, #10b981 100%);
    color: var(--white);
    padding: 80px 0;
    text-align: center;
}

.hero h1 {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 16px;
    line-height: 1.2;
}

.hero p {
    font-size: 20px;
    opacity: 0.9;
    margin-bottom: 40px;
}

.hero-search {
    max-width: 800px;
    margin: 0 auto;
}

.search-box {
    display: flex;
    gap: 8px;
    background: var(--white);
    padding: 8px;
    border-radius: var(--radius);
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.search-select {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    color: var(--dark);
    background: var(--white);
    cursor: pointer;
}

.search-btn {
    padding: 12px 32px;
}

/* ===== STATS ===== */
.stats {
    background: var(--white);
    padding: 60px 0;
    border-bottom: 1px solid var(--border);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 32px;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 42px;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 15px;
    color: var(--gray);
}

/* ===== SECTIONS ===== */
section {
    padding: 80px 0;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
}

.section-header h2 {
    font-size: 28px;
    font-weight: 700;
}

.link-more {
    color: var(--primary);
    font-weight: 500;
}

/* ===== LISTINGS ===== */
.listings {
    background: var(--light);
}

.listings-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.listing-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.listing-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 20px rgba(0,0,0,0.12);
}

.listing-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.listing-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.listing-tag {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--white);
}

.listing-tag.sale {
    background: #ef4444;
}

.listing-tag.rent {
    background: #10b981;
}

.listing-featured, .listing-new {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.listing-featured {
    background: #f59e0b;
    color: var(--white);
}

.listing-new {
    background: #8b5cf6;
    color: var(--white);
}

.listing-info {
    padding: 20px;
}

.listing-price {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
}

.listing-price small {
    font-size: 13px;
    font-weight: 400;
    color: var(--gray);
}

.listing-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    line-height: 1.4;
}

.listing-meta {
    display: flex;
    gap: 12px;
    font-size: 13px;
    color: var(--gray);
    margin-bottom: 16px;
}

.listing-meta span {
    padding: 2px 8px;
    background: var(--light);
    border-radius: 4px;
}

.listing-agent {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.agent-avatar {
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
}

.agent-name {
    font-size: 14px;
    font-weight: 500;
    flex: 1;
}

.agent-phone {
    font-size: 12px;
    color: var(--gray);
}

/* ===== FEATURES ===== */
.features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 32px;
}

.feature-card {
    text-align: center;
    padding: 32px 24px;
    border-radius: var(--radius);
    background: var(--white);
    border: 1px solid var(--border);
    transition: all 0.2s;
}

.feature-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
}

.feature-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.feature-card h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
}

.feature-card p {
    font-size: 14px;
    color: var(--gray);
    line-height: 1.6;
}

/* ===== CTA ===== */
.cta {
    background: linear-gradient(135deg, var(--primary) 0%, #1d4ed8 100%);
    color: var(--white);
    text-align: center;
    padding: 80px 0;
}

.cta h2 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 16px;
}

.cta p {
    font-size: 18px;
    opacity: 0.9;
    margin-bottom: 32px;
}

.cta .btn-primary {
    background: var(--white);
    color: var(--primary);
}

.cta .btn-primary:hover {
    background: var(--light);
}

/* ===== FOOTER ===== */
.footer {
    background: var(--dark);
    color: var(--white);
    padding: 60px 0 0;
}

.footer-content {
    display: grid;
    grid-template-columns: 1.5fr 2fr;
    gap: 60px;
    padding-bottom: 40px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.footer-brand .logo {
    margin-bottom: 16px;
}

.footer-brand p {
    color: rgba(255,255,255,0.6);
    font-size: 14px;
}

.footer-links {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

.footer-col h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
}

.footer-col a {
    display: block;
    font-size: 14px;
    color: rgba(255,255,255,0.6);
    margin-bottom: 10px;
    transition: color 0.2s;
}

.footer-col a:hover {
    color: var(--white);
}

.footer-bottom {
    padding: 24px 0;
    text-align: center;
}

.footer-bottom p {
    font-size: 13px;
    color: rgba(255,255,255,0.4);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .nav { display: none; }
    .mobile-menu-btn { display: block; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .listings-grid { grid-template-columns: repeat(2, 1fr); }
    .features-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    .hero h1 { font-size: 32px; }
    .search-box { flex-direction: column; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .listings-grid { grid-template-columns: 1fr; }
    .features-grid { grid-template-columns: 1fr; }
    .footer-content { grid-template-columns: 1fr; gap: 32px; }
    .footer-links { grid-template-columns: repeat(2, 1fr); }
}
