/* =========================================
   1. CSS Variables & Reset (Premium Upgrade)
   ========================================= */
:root {
    /* Premium Brand Colors */
    --color-primary: #0f172a;
    /* Slate 900 - Deepest Charcoal/Blue */
    --color-primary-light: #334155;
    /* Slate 700 */
    --color-primary-dark: #020617;
    /* Slate 950 */

    --color-secondary: #f59e0b;
    /* Amber 500 - Saffron/Gold */
    --color-secondary-hover: #d97706;
    /* Amber 600 */
    --color-secondary-light: #fcd34d;
    /* Amber 300 */

    /* Neutrals */
    --color-text-heading: #0f172a;
    --color-text-body: #475569;
    /* Slate 600 */
    --color-text-light: #94a3b8;
    /* Slate 400 */

    --color-bg-body: #ffffff;
    --color-bg-light: #f8fafc;
    /* Slate 50 */
    --color-bg-subtle: #f1f5f9;
    /* Slate 100 */

    --color-border: #e2e8f0;
    /* Slate 200 */
    --color-border-hover: #cbd5e1;
    /* Slate 300 */

    --color-success: #059669;
    /* Emerald 600 */
    --color-error: #dc2626;
    /* Red 600 */

    /* Typography */
    --font-heading: 'Poppins', sans-serif;
    --font-body: 'Inter', sans-serif;

    /* Spacing System */
    --spacing-xs: 0.5rem;
    /* 8px */
    --spacing-sm: 1rem;
    /* 16px */
    --spacing-md: 1.5rem;
    /* 24px */
    --spacing-lg: 3rem;
    /* 48px */
    --spacing-xl: 5rem;
    /* 80px */
    --spacing-2xl: 8rem;
    /* 128px */

    /* Layout */
    --container-width: 95%;
    /* Wider for modern screens */
    --header-height: 80px;

    /* Premium Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

    /* Radius */
    --radius-sm: 0.375rem;
    /* 6px */
    --radius-md: 0.75rem;
    /* 12px */
    --radius-lg: 1.5rem;
    /* 24px */
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Reset enhancements */
html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    color: var(--color-text-body);
    line-height: 1.7;
    background-color: var(--color-bg-body);
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    color: var(--color-text-heading);
    line-height: 1.1;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    letter-spacing: -0.02em;
}

h1 {
    font-size: 3.5rem;
    font-weight: 700;
}

h2 {
    font-size: 2.5rem;
}

h3 {
    font-size: 1.75rem;
}

h4 {
    font-size: 1.5rem;
}

p {
    margin-bottom: 1rem;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-fast);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* =========================================
   2. Layout & Utility Classes
   ========================================= */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--spacing-md);
    width: 100%;
}

.section-padding {
    padding: var(--spacing-xl) 0;
}

.bg-light {
    background-color: var(--color-bg-light);
}

.bg-dark {
    background-color: var(--color-primary);
    color: #fff;
}

.bg-white {
    background-color: #fff;
}

.text-center {
    text-align: center;
}

.text-white {
    color: white;
}

.d-flex {
    display: flex;
}

.align-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-sm {
    gap: var(--spacing-sm);
}

.gap-md {
    gap: var(--spacing-md);
}

.mt-1 {
    margin-top: 0.5rem;
}

.mt-2 {
    margin-top: 1rem;
}

.mt-3 {
    margin-top: 1.5rem;
}

.mt-4 {
    margin-top: 2rem;
}

.mt-5 {
    margin-top: 3rem;
}

/* Buttons - Modern Gradient & Shadow */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 2rem;
    border-radius: var(--radius-full);
    /* Pill shape for premium feel */
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    border: 1px solid transparent;
    font-family: var(--font-heading);
    letter-spacing: 0.01em;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-secondary) 0%, var(--color-secondary-hover) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(245, 158, 11, 0.4);
}

.btn-secondary {
    background: white;
    color: var(--color-primary);
    border-color: var(--color-border);
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
    border-color: var(--color-primary);
    background-color: var(--color-bg-light);
    transform: translateY(-2px);
}

.btn-outline-light {
    border: 2px solid rgba(255, 255, 255, 0.7);
    color: white;
    background: transparent;
    backdrop-filter: blur(4px);
}

.btn-outline-light:hover {
    background-color: white;
    color: var(--color-primary);
    border-color: white;
}

/* =========================================
   3. Header & Navigation (Glassmorphism)
   ========================================= */
.site-header {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
    height: var(--header-height);
    display: flex;
    align-items: center;
    transition: all 0.4s ease;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.site-header.scrolled {
    height: 70px;
    box-shadow: var(--shadow-md);
    background-color: rgba(255, 255, 255, 0.98);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--color-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: -0.02em;
    white-space: nowrap;
    /* Prevent wrapping */
}

.logo span.brand-highlight {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: var(--color-secondary);
    /* Fallback */
}

.main-nav {
    display: flex;
    flex: 1;
    /* Take up remaining space */
    justify-content: space-between;
    /* Space out children */
    align-items: center;
    margin-left: 2rem;
}

.nav-link {
    font-weight: 600;
    color: var(--color-primary);
    font-size: 0.95rem;
    position: relative;
    padding: 1.5rem 0.5rem;
    /* More padding for click area */
    display: flex;
    align-items: center;
    gap: 4px;
    /* Space between text and arrow */
    white-space: nowrap;
    /* Prevent wrapping */
}

.nav-link:hover,
.nav-link.active {
    color: var(--color-secondary);
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--color-secondary);
    transition: width 0.3s ease;
    border-radius: 2px;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.mobile-menu-btn {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--color-primary);
}

/* Navbar Groups */
.nav-links-group {
    display: flex;
    gap: 2rem;
    align-items: center;
    height: 100%;
    margin: 0 auto;
    /* Center alignment attempt */
}

.nav-actions-group {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    margin-left: auto;
    /* Push to right */
    padding-left: 1.5rem;
    border-left: 1px solid var(--color-border);
}

/* Navbar Elements */
.nav-item-dropdown {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
}

.arrow {
    font-size: 0.65em;
    margin-left: 0;
    /* Handled by gap */
    opacity: 0.7;
    transition: transform 0.2s;
    display: inline-block;
    /* Ensure it behaves nicely */
}

.nav-item-dropdown:hover .arrow {
    transform: rotate(180deg);
}

/* Mega Menu Styles */
.mega-menu {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: 100%;
    background: white;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    padding: 2rem 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 999;
    border-top: 1px solid var(--color-border);
}

.nav-item-dropdown:hover .mega-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.mega-menu-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    /* 5 Columns */
    gap: 2rem;
}

.mega-column h4 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--color-text-heading);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--color-bg-subtle);
    padding-bottom: 0.5rem;
    display: inline-block;
}

.mega-column ul {
    list-style: none;
    padding: 0;
}

.mega-column ul li {
    margin-bottom: 0.75rem;
}

.mega-column ul li a {
    color: var(--color-text-body);
    font-size: 0.9rem;
    position: relative;
    transition: color 0.2s;
}

.mega-column ul li a:hover {
    color: var(--color-secondary);
    padding-left: 5px;
}

.badge-new {
    background-color: #fbbf24;
    /* Amber 400 */
    color: var(--color-primary-dark);
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 4px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    vertical-align: middle;
}

/* Login Link */
.nav-link-login {
    font-weight: 600;
    color: var(--color-primary);
    position: relative;
    padding: 0.5rem 0;
}

.nav-link-login:hover {
    color: var(--color-secondary);
}

/* Post Property Button */
.btn-post-property {
    background: white;
    color: var(--color-primary-dark);
    border: 1px solid var(--color-border);
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.btn-post-property:hover {
    border-color: var(--color-secondary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.badge-free {
    background-color: #fbbf24;
    /* Amber 400 - Goldish */
    color: var(--color-primary-dark);
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 800;
    letter-spacing: 0.05em;
}

/* =========================================
   4. Hero Section (Immersive)
   ========================================= */
.hero-section {
    position: relative;
    min-height: 90vh;
    /* Premium height */
    display: flex;
    align-items: center;
    background-image: url('https://images.unsplash.com/photo-1600607687939-ce8a6c25118c?ixlib=rb-4.0.3&auto=format&fit=crop&w=2000&q=90');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    /* Parallax effect */
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, rgba(15, 23, 42, 0.9) 0%, rgba(15, 23, 42, 0.6) 60%, rgba(15, 23, 42, 0.2) 100%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    color: white;
    max-width: 800px;
    padding-top: var(--header-height);
}

.hero-tag {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--color-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    /* Responsive typography */
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    color: white;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.hero-subtitle {
    font-size: 1.25rem;
    color: #cbd5e1;
    /* Slate 300 */
    margin-bottom: 2.5rem;
    max-width: 600px;
    font-weight: 400;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Animations included later */

/* =========================================
   5. Property Cards (Card Lift & Polish)
   ========================================= */
.property-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2.5rem;
}

.property-card {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-bounce);
    border: 1px solid var(--color-border);
    position: relative;
    display: flex;
    flex-direction: column;
}

.property-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    border-color: rgba(245, 158, 11, 0.3);
}

.card-image-wrapper {
    position: relative;
    height: 240px;
    overflow: hidden;
}

.card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.property-card:hover .card-image {
    transform: scale(1.08);
    /* Subtle zoom */
}

.badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    padding: 0.35rem 0.85rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: white;
    letter-spacing: 0.05em;
    z-index: 2;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.badge-sale {
    background-color: var(--color-secondary);
}

.badge-rent {
    background-color: var(--color-success);
}

.card-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card-location {
    color: var(--color-text-light);
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--color-text-heading);
}

.card-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-secondary);
    /* Highlight Price */
    margin-bottom: 1.25rem;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
    font-size: 0.9rem;
    color: var(--color-text-body);
    margin-bottom: 1rem;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-footer-btn {
    margin-top: auto;
    width: 100%;
    text-align: center;
    padding: 0.75rem;
    background: var(--color-bg-subtle);
    color: var(--color-primary);
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
}

.card-footer-btn:hover {
    background: var(--color-primary);
    color: white;
}

/* =========================================
   6. Features & Highlights
   ========================================= */
.section-header {
    margin-bottom: 4rem;
    text-align: center;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--color-secondary);
    margin: 1rem auto 0;
    border-radius: 2px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: white;
    padding: 2.5rem 2rem;
    border-radius: var(--radius-lg);
    text-align: center;
    transition: var(--transition-smooth);
    border: 1px solid var(--color-border);
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
    border-color: var(--color-secondary);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    display: inline-block;
    padding: 1rem;
    background: var(--color-bg-subtle);
    border-radius: 50%;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* =========================================
   7. Footer (Corporate)
   ========================================= */
.site-footer {
    background-color: var(--color-primary-dark);
    color: #94a3b8;
    padding: 5rem 0 2rem;
    font-size: 0.95rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 4rem;
    margin-bottom: 4rem;
}

.footer-brand h3 {
    color: white;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.footer-heading {
    color: white;
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.footer-links li {
    margin-bottom: 0.85rem;
}

.footer-links a:hover {
    color: var(--color-secondary);
    padding-left: 5px;
}

.footer-contact-item {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.footer-bottom {
    border-top: 1px solid #1e293b;
    padding-top: 2rem;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

/* =========================================
   8. Responsive Design (Mobile First)
   ========================================= */
@media (max-width: 1024px) {
    :root {
        --container-width: 95%;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 3rem;
    }
}

@media (max-width: 768px) {
    h1 {
        font-size: 2.5rem;
    }

    .hero-section {
        min-height: 80vh;
        background-attachment: scroll;
    }

    /* Disable parallax on mobile */

    .nav-container {
        padding: 0 1.5rem;
    }

    .site-header .main-nav {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: 80%;
        max-width: 300px;
        background: white;
        flex-direction: column;
        padding: 5rem 2rem;
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
        transform: translateX(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 999;
        gap: 1.5rem;
        align-items: flex-start;
    }

    .site-header .main-nav.active {
        transform: translateX(0);
    }

    .mobile-menu-btn {
        display: block;
        z-index: 1000;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

    /* Mobile Menu Updates */
    .nav-links-group,
    .nav-actions-group {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
        gap: 1.5rem;
    }

    .nav-actions-group {
        margin-left: 0;
        padding-left: 0;
        border-left: none;
        margin-top: 1.5rem;
        padding-top: 1.5rem;
        border-top: 1px solid var(--color-border);
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
        justify-content: center;
    }
}

/* =========================================
   9. Form Styles (Premium)
   ========================================= */
.form-group {
    margin-bottom: 1.75rem;
}

.form-label {
    margin-bottom: 0.6rem;
    font-weight: 500;
    color: var(--color-primary);
    font-size: 0.95rem;
}

.form-control,
.form-select {
    padding: 0.875rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 1rem;
    background-color: var(--color-bg-light);
    transition: var(--transition-fast);
}

.form-control:focus {
    background-color: white;
    border-color: var(--color-secondary);
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.1);
    outline: none;
}