/* ==========================================================================
   CSS Variables & Theming
   ========================================================================== */
:root {
    /* Light Mode - Beige/Light Brown Theme */
    --bg-primary: #EDE5D9;
    /* Light sandy beige */
    --bg-secondary: #E3D8C8;
    /* Deeper beige */
    --bg-card: #F8F4F0;
    /* Soft creamy beige, easy to read */
    --text-primary: #3B2E24;
    /* Dark rich warm brown */
    --text-secondary: #806752;
    /* Medium clay brown */
    --accent-color: #9C6C42;
    /* Warm copper brown accent */
    --accent-hover: #7D512E;
    --border-color: #D6CAba;

    /* Typography */
    --font-sans: 'Outfit', sans-serif;
    --font-serif: 'Playfair Display', serif;

    /* Spacing & Layout */
    --nav-height: 80px;
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;

    /* Shadows - softer for light mode */
    --shadow-sm: 0 4px 12px rgba(166, 124, 82, 0.08);
    --shadow-md: 0 8px 24px rgba(166, 124, 82, 0.12);
    --shadow-hover: 0 16px 32px rgba(166, 124, 82, 0.18);

    --transition: 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

[data-theme="dark"] {
    /* Dark Mode - Sleek Dark with Gold/Warm accents */
    --bg-primary: #121212;
    --bg-secondary: #1E1E1E;
    --bg-card: #252525;
    --text-primary: #EAEAEA;
    --text-secondary: #A0A0A0;
    --accent-color: #D4AF37;
    /* Gold accent */
    --accent-hover: #F1C40F;
    --border-color: #333333;

    /* Shadows - stronger but darker */
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
    --shadow-hover: 0 16px 32px rgba(0, 0, 0, 0.6);
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

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

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-serif);
    font-weight: 600;
    line-height: 1.2;
    color: var(--text-primary);
}

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

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

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    font-family: var(--font-sans);
    font-weight: 500;
    font-size: 1rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all var(--transition);
    border: none;
    outline: none;
}

.btn-primary {
    background-color: var(--accent-color);
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .btn-primary {
    color: #121212;
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

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

.btn-outline:hover {
    background-color: var(--accent-color);
    color: #fff;
}

[data-theme="dark"] .btn-outline:hover {
    color: #121212;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.875rem;
}

/* ==========================================================================
   Topbar & Navigation
   ========================================================================== */
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    background-color: rgba(182, 162, 138, 0.95);
    /* fallback darker beige for topbar */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid transparent;
    z-index: 1000;
    transition: all var(--transition);
}

[data-theme="dark"] .topbar {
    background-color: rgba(18, 18, 18, 0.85);
}

.topbar.scrolled {
    border-bottom-color: var(--border-color);
    box-shadow: var(--shadow-sm);
}

.topbar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.logo a {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
}

.logo span {
    color: var(--accent-color);
    font-style: italic;
}

.nav-menu {
    display: flex;
    gap: 32px;
    margin-left: auto;
    margin-right: 48px;
}

.nav-link {
    font-weight: 500;
    color: var(--text-primary);
    position: relative;
    padding-bottom: 4px;
}

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

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.theme-toggle {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition);
}

.theme-toggle:hover {
    background: var(--border-color);
}

.theme-toggle .light-icon {
    display: none;
}

[data-theme="dark"] .theme-toggle .dark-icon {
    display: none;
}

[data-theme="dark"] .theme-toggle .light-icon {
    display: block;
}

.mobile-menu-btn {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-primary);
}

/* Mobile Nav */
.mobile-nav-overlay {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    width: 100%;
    height: calc(100vh - var(--nav-height));
    background-color: var(--bg-primary);
    z-index: 999;
    transform: translateX(100%);
    transition: transform var(--transition);
    display: flex;
    justify-content: center;
    align-items: center;
}

.mobile-nav-overlay.active {
    transform: translateX(0);
}

.mobile-nav-menu {
    display: flex;
    flex-direction: column;
    gap: 32px;
    text-align: center;
}

.mobile-nav-link {
    font-family: var(--font-serif);
    font-size: 2rem;
    color: var(--text-primary);
}

@media (max-width: 768px) {
    .nav-menu {
        display: none;
    }

    .mobile-menu-btn {
        display: block;
    }
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: var(--nav-height);
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('https://images.unsplash.com/photo-1512917774080-9991f1c4c750?ixlib=rb-4.0.3&auto=format&fit=crop&w=1920&q=80');
    background-size: cover;
    background-position: center;
    z-index: -1;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Lighter hero overlay to increase contrast with the darker navbar */
    background: linear-gradient(135deg, rgba(237, 229, 217, 0.85) 0%, rgba(237, 229, 217, 0.6) 100%);
}

[data-theme="dark"] .hero-overlay {
    background: linear-gradient(135deg, rgba(18, 18, 18, 0.95) 0%, rgba(18, 18, 18, 0.8) 100%);
}

.hero-content {
    position: relative;
    max-width: 800px;
    text-align: left;
    z-index: 1;
}

.hero-subtitle {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--accent-color);
    margin-bottom: 16px;
}

.hero-title {
    font-size: clamp(3rem, 5vw, 5rem);
    margin-bottom: 24px;
}

.hero-title em {
    font-style: italic;
    color: var(--accent-color);
}

.hero-description {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 40px;
    max-width: 600px;
}

/* ==========================================================================
   Properties Section
   ========================================================================== */
.properties-section {
    padding: 100px 0;
    background-color: var(--bg-secondary);
}

.section-header {
    margin-bottom: 60px;
    text-align: center;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 16px;
}

.title-divider {
    width: 60px;
    height: 3px;
    background-color: var(--accent-color);
    margin: 0 auto;
    border-radius: 2px;
}

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

.property-card {
    background-color: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

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

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

.property-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

.property-status {
    position: absolute;
    top: 16px;
    left: 16px;
    background-color: var(--accent-color);
    color: #fff;
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

[data-theme="dark"] .property-status {
    color: #121212;
}

.property-details {
    padding: 24px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.property-location {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.property-title {
    font-size: 1.5rem;
    margin-bottom: 12px;
}

.property-excerpt {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 24px;
    flex-grow: 1;
}

.property-features {
    display: flex;
    gap: 16px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.feature {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.875rem;
    color: var(--text-primary);
    font-weight: 500;
}

.feature i {
    color: var(--accent-color);
}

.property-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.property-price {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Placeholder Card Styling */
.placeholder-card {
    opacity: 0.8;
}

.placeholder-image {
    background-color: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.placeholder-image i {
    font-size: 4rem;
    color: var(--border-color);
}

.status-coming {
    background-color: var(--text-secondary);
    color: white;
}

[data-theme="dark"] .status-coming {
    color: white;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
    background-color: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    padding: 60px 0 24px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-brand p {
    color: var(--text-secondary);
    margin-top: 12px;
    max-width: 300px;
}

.footer-contact h4 {
    font-family: var(--font-sans);
    font-size: 1.125rem;
    margin-bottom: 16px;
}

.footer-contact a {
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-contact a:hover {
    color: var(--accent-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* ==========================================================================
   Utility & Animation
   ========================================================================== */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   Back Link (Detail pages)
   ========================================================================== */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    margin-bottom: 24px;
    font-weight: 500;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 30px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.85rem;
    transition: all var(--transition);
}

.back-link:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateX(-4px);
    text-decoration: none;
    color: #fff;
    border-color: rgba(255, 255, 255, 0.5);
}

/* ==========================================================================
   Secondary Details & Contacts
   ========================================================================== */
.contact-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 30px;
}

.contact-actions .btn {
    width: 100%;
    justify-content: center;
    gap: 8px;
}

.btn-whatsapp {
    border-color: #25D366;
    color: #25D366;
}

.btn-whatsapp:hover {
    background-color: #25D366;
    color: #fff !important;
    border-color: #25D366;
}

[data-theme="dark"] .btn-whatsapp:hover {
    color: #121212 !important;
}

.btn-telegram {
    border-color: #0088cc;
    color: #0088cc;
}

.btn-telegram:hover {
    background-color: #0088cc;
    color: #fff !important;
    border-color: #0088cc;
}

[data-theme="dark"] .btn-telegram:hover {
    color: #121212 !important;
}

.btn-call {
    border-color: var(--text-primary);
    color: var(--text-primary);
}

.btn-call:hover {
    background-color: var(--text-primary);
    color: var(--bg-card) !important;
    border-color: var(--text-primary);
}

.secondary-details-card {
    margin-top: 40px;
    margin-bottom: 40px;
    padding: 32px;
    background-color: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px dashed var(--border-color);
}

.secondary-details-card h3 {
    font-size: 1.25rem;
    margin-bottom: 24px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
}

.secondary-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.secondary-detail-item {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.secondary-detail-item strong {
    color: var(--text-primary);
    display: block;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

@media (max-width: 600px) {
    .secondary-details-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Lightbox Gallery
   ========================================================================== */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    opacity: 1;
    pointer-events: auto;
}

.lightbox-img {
    max-width: 80%;
    max-height: 80vh;
    border-radius: var(--radius-sm);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: 30px;
    right: 40px;
    font-size: 2rem;
    color: #fff;
    cursor: pointer;
    transition: color 0.2s;
}

.lightbox-close:hover {
    color: var(--accent-color);
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255, 255, 255, 0.3);
}

.lightbox-prev {
    left: 40px;
}

.lightbox-next {
    right: 40px;
}

@media (max-width: 768px) {
    .lightbox-img {
        max-width: 95%;
        max-height: 70vh;
    }

    .lightbox-prev {
        left: 10px;
    }

    .lightbox-next {
        right: 10px;
    }

    .lightbox-close {
        top: 20px;
        right: 20px;
    }
}