/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --black: #000;
    --white: #fff;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --purple-light: #e0c1fe;
    --purple: #952afc;
    --text: #333;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: var(--text);
    background: var(--white);
}

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

/* Hero Section - Full width image with overlay */
.hero {
    position: relative;
    height: 70vh;
    min-height: 500px;
    overflow: hidden;
}

.hero-image {
    position: absolute;
    inset: 0;
}

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

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.1) 0%,
        rgba(0, 0, 0, 0.2) 50%,
        rgba(0, 0, 0, 0.7) 100%
    );
}

.hero-content {
    position: absolute;
    bottom: 48px;
    left: 48px;
    color: var(--white);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.hero h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.hero-address {
    font-size: clamp(1.1rem, 2vw, 1.5rem);
    font-weight: 400;
    opacity: 0.95;
}

/* Navigation Tabs - Dark background */
.tabs-nav {
    background: var(--black);
    position: sticky;
    top: 0;
    z-index: 100;
}

.tabs-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.tabs-container::-webkit-scrollbar {
    display: none;
}

.tab {
    color: var(--white);
    text-decoration: none;
    padding: 18px 24px;
    font-size: 0.95rem;
    font-weight: 500;
    white-space: nowrap;
    transition: background 0.2s, color 0.2s;
    border-bottom: 3px solid transparent;
}

.tab:hover {
    background: rgba(255, 255, 255, 0.1);
}

.tab.active {
    border-bottom-color: var(--purple);
}

/* Sections */
.section {
    padding: 64px 0;
}

.section-gray {
    background: var(--gray-50);
}

.section-header {
    display: flex;
    align-items: baseline;
    gap: 16px;
    margin-bottom: 32px;
}

.section-header h2 {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--gray-900);
}

.photo-count {
    font-size: 0.95rem;
    color: var(--gray-600);
}

/* Property Stats with Icons */
.property-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 24px;
    margin-bottom: 48px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--gray-200);
    list-style: none;
}

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

.stat-icon {
    width: 32px;
    height: 32px;
    fill: var(--gray-700);
    flex-shrink: 0;
}

.stat span {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--gray-800);
}

/* Property Description */
.property-description {
    max-width: 800px;
}

.property-description p {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--gray-700);
    margin-bottom: 20px;
}

.property-description p:last-child {
    margin-bottom: 0;
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.gallery-item {
    aspect-ratio: 4/3;
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
    background: var(--gray-200);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

/* Video Container */
.video-container {
    position: relative;
    width: 100%;
    max-width: 900px;
    aspect-ratio: 16/9;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Floor Plan */
.floorplan-container {
    display: flex;
    justify-content: center;
}

.floorplan-image {
    max-width: 100%;
    max-height: 600px;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
}

.floorplan-image:hover {
    transform: scale(1.02);
}

/* Map */
.map-container {
    width: 100%;
    height: 400px;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 48px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

.map-container iframe {
    width: 100%;
    height: 100%;
}

/* Nearby Grid */
.nearby-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
}

.nearby-card {
    background: var(--white);
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.nearby-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--purple-light);
}

.nearby-card ul {
    list-style: none;
}

.nearby-card li {
    padding: 8px 0;
    color: var(--gray-600);
    font-size: 0.95rem;
    border-bottom: 1px solid var(--gray-100);
}

.nearby-card li:last-child {
    border-bottom: none;
}

/* Footer */
.footer {
    background: var(--black);
    color: var(--white);
    text-align: center;
    padding: 32px 24px;
}

.footer p {
    font-size: 1rem;
    opacity: 0.9;
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.lightbox.active {
    display: flex;
}

.lightbox-content {
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 4px;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 24px;
    background: none;
    border: none;
    color: var(--white);
    font-size: 2.5rem;
    cursor: pointer;
    z-index: 1001;
    opacity: 0.8;
    transition: opacity 0.2s;
    line-height: 1;
}

.lightbox-close:hover {
    opacity: 1;
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--white);
    font-size: 1.5rem;
    padding: 16px 12px;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s;
}

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

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.lightbox-counter {
    color: var(--white);
    margin-top: 16px;
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Floor Plan Lightbox with Pan/Zoom */
.floorplan-lightbox {
    flex-direction: column;
}

.floorplan-controls {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 1001;
}

.floorplan-controls button {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 10px 18px;
    font-size: 1.1rem;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.2s;
}

.floorplan-controls button:hover {
    background: rgba(255, 255, 255, 0.25);
}

.floorplan-hint {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    z-index: 1001;
    text-align: center;
}

.floorplan-viewer {
    width: 100%;
    height: 100%;
    overflow: hidden;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.floorplan-viewer.zoomed {
    cursor: grab;
}

.floorplan-viewer.zoomed:active {
    cursor: grabbing;
}

.floorplan-viewer img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    transform-origin: center center;
    transition: transform 0.2s ease-out;
    user-select: none;
    -webkit-user-drag: none;
}

.floorplan-viewer.zoomed img {
    max-width: none;
    max-height: none;
}

/* Responsive */
@media (max-width: 768px) {
    .hero {
        height: 50vh;
        min-height: 350px;
    }

    .hero-content {
        bottom: 32px;
        left: 24px;
        right: 24px;
    }

    .tab {
        padding: 14px 16px;
        font-size: 0.9rem;
    }

    .section {
        padding: 48px 0;
    }

    .property-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .stat-icon {
        width: 24px;
        height: 24px;
    }

    .stat span {
        font-size: 0.95rem;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 8px;
    }

    .gallery-item {
        border-radius: 4px;
    }

    .lightbox-prev,
    .lightbox-next {
        padding: 10px 8px;
        font-size: 1.25rem;
    }

    .map-container {
        height: 300px;
    }
}

@media (max-width: 480px) {
    .hero-content {
        bottom: 24px;
        left: 16px;
        right: 16px;
    }

    .container {
        padding: 0 16px;
    }

    .property-stats {
        gap: 12px;
    }

    .nearby-grid {
        grid-template-columns: 1fr;
    }
}
