/* ========================================
   CSS Reset & Base Styles
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #8b5cf6;
    --primary-dark: #7c3aed;
    --primary-light: #a78bfa;
    --secondary-color: #ec4899;
    --bg-dark: #0a0a0f;
    --bg-card: #1a1a2e;
    --bg-card-hover: #252538;
    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --text-muted: #6b6b7b;
    --accent-gradient: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
    --shadow-sm: 0 2px 8px rgba(139, 92, 246, 0.1);
    --shadow-md: 0 4px 16px rgba(139, 92, 246, 0.2);
    --shadow-lg: 0 8px 32px rgba(139, 92, 246, 0.3);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

button {
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ========================================
   Header & Navigation
   ======================================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(139, 92, 246, 0.1);
}

.navbar {
    padding: 16px 0;
}

.nav-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo h1 {
    font-size: 28px;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo span {
    color: var(--primary-color);
}

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

.nav-link {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-secondary);
    position: relative;
    padding: 8px 0;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent-gradient);
}

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

.btn-signup {
    padding: 12px 32px;
    background: var(--accent-gradient);
    color: white;
    border-radius: 25px;
    font-weight: 600;
    font-size: 15px;
    box-shadow: var(--shadow-sm);
}

.btn-signup:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    width: 30px;
}

.menu-toggle span {
    width: 100%;
    height: 3px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: var(--transition);
}

/* ========================================
   Hero Section
   ======================================== */
.hero {
    padding: 140px 0 80px;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    animation: pulse 8s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.hero-subtitle {
    display: inline-block;
    padding: 8px 16px;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 20px;
    font-size: 14px;
    color: var(--primary-light);
    margin-bottom: 20px;
}

.hero-title {
    font-size: 64px;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 24px;
    background: linear-gradient(135deg, #ffffff 0%, #e0e0ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-description {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 40px;
    line-height: 1.8;
}

/* Search Bar */
.search-bar {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 8px;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(139, 92, 246, 0.1);
}

.search-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding: 8px;
}

.search-tab {
    flex: 1;
    padding: 12px 24px;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 12px;
    font-weight: 500;
    font-size: 15px;
}

.search-tab.active {
    background: var(--accent-gradient);
    color: white;
}

.search-inputs {
    display: grid;
    grid-template-columns: 2fr 1.5fr 1.5fr auto;
    gap: 12px;
    padding: 8px;
}

.search-input,
.search-select {
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 15px;
    outline: none;
    transition: var(--transition);
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-input:focus,
.search-select:focus {
    border-color: var(--primary-color);
    background: rgba(139, 92, 246, 0.1);
}

.search-select option {
    background: var(--bg-card);
    color: var(--text-primary);
}

.btn-search {
    padding: 16px 32px;
    background: var(--accent-gradient);
    color: white;
    border-radius: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.btn-search:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Hero 3D House */
.hero-image {
    position: relative;
    height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.house-model {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 1000px;
}

.house-3d {
    position: relative;
    width: 400px;
    height: 400px;
    transform-style: preserve-3d;
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotateY(0deg); }
    50% { transform: translateY(-20px) rotateY(10deg); }
}

.house-structure {
    position: relative;
    width: 100%;
    height: 100%;
}

.house-base {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    height: 250px;
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(139, 92, 246, 0.2) 100%);
    border: 2px solid rgba(139, 92, 246, 0.3);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
}

.house-roof {
    position: absolute;
    bottom: 240px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 170px solid transparent;
    border-right: 170px solid transparent;
    border-bottom: 120px solid var(--primary-color);
    filter: drop-shadow(0 -4px 20px rgba(139, 92, 246, 0.4));
}

.house-details {
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 100px;
    background: rgba(236, 72, 153, 0.3);
    border: 2px solid var(--secondary-color);
    border-radius: 8px;
}

/* ========================================
   Properties Section
   ======================================== */
.properties-section {
    padding: 80px 0;
}

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

.section-title {
    font-size: 36px;
    font-weight: 700;
}

.section-title.center {
    text-align: center;
    margin: 0 auto 48px;
}

.btn-see-all {
    padding: 12px 28px;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.3);
    color: var(--primary-light);
    border-radius: 20px;
    font-weight: 600;
    font-size: 15px;
}

.btn-see-all:hover {
    background: rgba(139, 92, 246, 0.2);
    border-color: var(--primary-color);
}

.properties-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 32px;
}

.property-card {
    background: var(--bg-card);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(139, 92, 246, 0.1);
    transition: var(--transition);
    cursor: pointer;
}

.property-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.property-image {
    position: relative;
    width: 100%;
    height: 280px;
    overflow: hidden;
}

.property-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.property-card:hover .property-image img {
    transform: scale(1.1);
}

.property-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    padding: 8px 16px;
    background: var(--accent-gradient);
    color: white;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.property-badge.featured {
    background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
}

.property-info {
    padding: 24px;
}

.property-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
}

.property-location {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 16px;
}

.property-features {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.property-features span {
    font-size: 13px;
    color: var(--text-secondary);
}

.property-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid rgba(139, 92, 246, 0.1);
}

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

.btn-view {
    padding: 10px 24px;
    background: var(--accent-gradient);
    color: white;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

.btn-view:hover {
    transform: scale(1.05);
}

/* ========================================
   Advice Section
   ======================================== */
.advice-section {
    padding: 80px 0;
    background: rgba(139, 92, 246, 0.03);
}

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

.advice-card {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 40px;
    border: 1px solid rgba(139, 92, 246, 0.1);
    transition: var(--transition);
}

.advice-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.advice-card.large {
    grid-row: span 2;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(236, 72, 153, 0.1) 100%);
}

.advice-3d {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 1000px;
}

.model-house {
    width: 250px;
    height: 250px;
    background: var(--bg-card);
    border: 2px solid rgba(139, 92, 246, 0.3);
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    animation: rotate3d 10s ease-in-out infinite;
    transform-style: preserve-3d;
}

@keyframes rotate3d {
    0%, 100% { transform: rotateY(0deg) rotateX(0deg); }
    25% { transform: rotateY(90deg) rotateX(10deg); }
    50% { transform: rotateY(180deg) rotateX(0deg); }
    75% { transform: rotateY(270deg) rotateX(-10deg); }
}

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

.advice-card h3 {
    font-size: 24px;
    margin-bottom: 12px;
}

.advice-card p {
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.8;
}

.btn-learn-more {
    padding: 12px 28px;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.3);
    color: var(--primary-light);
    border-radius: 20px;
    font-weight: 600;
    font-size: 15px;
}

.btn-learn-more:hover {
    background: var(--accent-gradient);
    color: white;
    border-color: transparent;
}

/* ========================================
   Statistics Section
   ======================================== */
.stats-section {
    padding: 80px 0;
}

.stats-header {
    text-align: center;
    margin-bottom: 48px;
}

.stats-header p {
    color: var(--text-secondary);
    margin-top: 12px;
}

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

.stat-card {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    border: 1px solid rgba(139, 92, 246, 0.1);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.stat-value {
    font-size: 48px;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 16px;
}

/* ========================================
   Featured Carousel
   ======================================== */
.featured-section {
    padding: 80px 0;
    background: rgba(139, 92, 246, 0.03);
}

.carousel-controls {
    display: flex;
    gap: 12px;
}

.carousel-btn {
    width: 48px;
    height: 48px;
    background: var(--bg-card);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 50%;
    color: var(--text-primary);
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.carousel-btn:hover {
    background: var(--accent-gradient);
    border-color: transparent;
    transform: scale(1.1);
}

.featured-carousel {
    display: flex;
    gap: 32px;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 20px 0;
    scrollbar-width: none;
}

.featured-carousel::-webkit-scrollbar {
    display: none;
}

.carousel-item {
    min-width: 400px;
    background: var(--bg-card);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(139, 92, 246, 0.1);
    transition: var(--transition);
}

.carousel-item:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
}

/* ========================================
   Rated Section
   ======================================== */
.rated-section {
    padding: 80px 0;
}

.rated-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 32px;
}

.rated-large {
    background: var(--bg-card);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(139, 92, 246, 0.1);
}

.property-image-large {
    position: relative;
    height: 400px;
    overflow: hidden;
}

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

.property-info-large {
    padding: 32px;
}

.property-info-large h3 {
    font-size: 28px;
    margin-bottom: 12px;
}

.property-description {
    color: var(--text-secondary);
    line-height: 1.8;
    margin: 16px 0;
}

.property-price-large {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-light);
    margin-top: 20px;
}

.rated-small-grid {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.rated-small {
    background: var(--bg-card);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(139, 92, 246, 0.1);
    transition: var(--transition);
    cursor: pointer;
}

.rated-small:hover {
    transform: translateX(8px);
    box-shadow: var(--shadow-md);
}

.rated-small img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.rated-info {
    padding: 20px;
}

.rated-info h4 {
    font-size: 18px;
    margin-bottom: 8px;
}

.rated-info p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 12px;
}

.rated-info .price {
    color: var(--primary-light);
    font-weight: 700;
    font-size: 20px;
}

/* ========================================
   Footer
   ======================================== */
.footer {
    background: var(--bg-card);
    padding: 80px 0 24px;
    border-top: 1px solid rgba(139, 92, 246, 0.1);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 48px;
    margin-bottom: 48px;
}

.footer-section h3 {
    font-size: 18px;
    margin-bottom: 20px;
    color: var(--primary-light);
}

.footer-section ul {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-section a {
    color: var(--text-secondary);
    font-size: 15px;
}

.footer-section a:hover {
    color: var(--primary-light);
}

.newsletter-form {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.newsletter-form input {
    flex: 1;
    padding: 14px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 15px;
    outline: none;
}

.newsletter-form input::placeholder {
    color: var(--text-muted);
}

.btn-subscribe {
    padding: 14px 28px;
    background: var(--accent-gradient);
    color: white;
    border-radius: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.btn-subscribe:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.social-links {
    display: flex;
    gap: 16px;
}

.social-links a {
    width: 40px;
    height: 40px;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-light);
    transition: var(--transition);
}

.social-links a:hover {
    background: var(--accent-gradient);
    color: white;
    border-color: transparent;
    transform: translateY(-4px);
}

.footer-bottom {
    text-align: center;
    padding-top: 32px;
    border-top: 1px solid rgba(139, 92, 246, 0.1);
    color: var(--text-secondary);
}

/* ========================================
   Scroll to Top Button
   ======================================== */
.scroll-top {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 56px;
    height: 56px;
    background: var(--accent-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 999;
}

.scroll-top.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-top:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(139, 92, 246, 0.4);
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 1024px) {
    .hero-title {
        font-size: 48px;
    }
    
    .search-inputs {
        grid-template-columns: 1fr;
    }
    
    .properties-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
    
    .advice-grid {
        grid-template-columns: 1fr;
    }
    
    .advice-card.large {
        grid-row: span 1;
    }
    
    .rated-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        top: 72px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 72px);
        background: rgba(10, 10, 15, 0.98);
        backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 40px;
        transition: var(--transition);
        border-right: 1px solid rgba(139, 92, 246, 0.1);
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .menu-toggle {
        display: flex;
    }
    
    .menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(8px, 8px);
    }
    
    .menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(6px, -6px);
    }
    
    .hero-content {
        grid-template-columns: 1fr;
    }
    
    .hero-title {
        font-size: 36px;
    }
    
    .hero-image {
        height: 350px;
    }
    
    .house-3d {
        width: 300px;
        height: 300px;
    }
    
    .section-title {
        font-size: 28px;
    }
    
    .properties-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
    }
    
    .carousel-item {
        min-width: 300px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }
    
    .hero {
        padding: 100px 0 40px;
    }
    
    .hero-title {
        font-size: 28px;
    }
    
    .hero-description {
        font-size: 16px;
    }
    
    .btn-signup {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .search-tabs {
        flex-direction: column;
    }
    
    .properties-section {
        padding: 40px 0;
    }
    
    .stat-value {
        font-size: 36px;
    }
    
    .newsletter-form {
        flex-direction: column;
    }
}