/* Listing Detail Page Styles - Using Design System Tokens */
/* Design system is loaded via responsive.css in templates */

/* Global Reset - Listing Detail Page Specific */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family-primary);
    line-height: var(--line-height-normal);
    font-size: var(--font-body);
    color: var(--color-text-primary);
    background: var(--color-bg-secondary);
    overflow-x: hidden;
}

/* Property Detail Container */
.property-detail-container {
    max-width: var(--container-2xl);
    margin: 0 auto;
    padding: var(--spacing-xl);
    background: var(--color-white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    margin-top: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
}

/* Property Information Section */
.property-info-section {
    background: linear-gradient(135deg, var(--color-gray-100), var(--color-gray-200));
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
    border-left: var(--spacing-sm) solid var(--color-primary);
}

.property-title {
    font-size: var(--font-title-h2);
    font-weight: var(--font-weight-title);
    color: var(--color-text-primary);
    margin-bottom: var(--spacing-lg);
    line-height: var(--line-height-tight);
    text-shadow: var(--spacing-xs) var(--spacing-xs) var(--spacing-xs) rgba(0, 0, 0, 0.1);
}

.property-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.detail-item {
    background: var(--color-white);
    padding: var(--card-padding);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: var(--input-border-width) solid transparent;
    transition: var(--transition-all);
}

.detail-item:hover {
    transform: translateY(calc(-1 * var(--spacing-xs)));
    box-shadow: var(--shadow-lg);
    border-color: var(--color-primary);
}

.detail-label {
    font-size: var(--font-body-small);
    font-weight: var(--font-weight-semibold);
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: var(--letter-spacing-wide);
    margin-bottom: var(--spacing-sm);
}

.detail-value {
    font-size: var(--font-title-h4);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-primary);
}

.price-value {
    font-size: var(--font-title-h1);
    color: var(--color-primary);
}

.location-value {
    color: var(--color-accent-teal);
    font-weight: var(--font-weight-semibold);
}

/* Image Carousel */
.slideshow-container {
    position: relative;
    width: 100%;
    max-width: clamp(600px, 70vw, 700px);
    margin: 0 auto;
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    min-height: 350px; /* Prevent collapse when no images */
    background-color: var(--color-gray-100, #f0f0f0);
}

.slide {
    display: none;
    min-height: 350px; /* Maintain height even when hidden */
}

/* Ensure first slide is visible by default to prevent layout collapse */
.slideshow-container .slide:first-child {
    display: block !important;
}

.slide img {
    width: 100%;
    height: clamp(350px, 40vh, 450px);
    min-height: 350px;
    max-height: 450px;
    object-fit: cover;
    transition: transform var(--transition-base);
    background-color: var(--color-gray-100, #f0f0f0);
    display: block;
}

/* Fallback for broken images */
.slide img[src=""],
.slide img:not([src]) {
    background-color: var(--color-gray-200);
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"><rect fill="%23ddd" width="100" height="100"/><text x="50%" y="50%" text-anchor="middle" dy=".3em" fill="%23999" font-size="14">No Image</text></svg>');
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

.slide img:hover {
    transform: scale(1.02);
}

.prev, .next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    padding: var(--spacing-md) var(--spacing-lg);
    color: var(--color-text-inverse);
    font-weight: var(--font-weight-bold);
    font-size: var(--font-title-h5);
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.5));
    border: none;
    border-radius: var(--radius-full);
    z-index: 2;
    transform: translateY(-50%);
    transition: var(--transition-all);
}

.prev:hover, .next:hover {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    transform: translateY(-50%) scale(1.1);
}

.prev { left: var(--spacing-lg); }
.next { right: var(--spacing-lg); }

/* Map Section */
.map-section {
    background: var(--color-white);
    border-radius: var(--radius-xl);
    padding: var(--card-padding);
    box-shadow: var(--shadow-sm);
    border: var(--input-border-width) solid var(--color-border-light);
}

.map-title {
    font-size: var(--font-title-h4);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-primary);
    margin-bottom: var(--spacing-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.leaflet-map {
    height: clamp(300px, 35vh, 350px);
    width: 100%;
    border-radius: var(--radius-lg);
    border: var(--input-border-width) solid var(--color-border-light);
}

.map-error-message {
    padding: var(--spacing-md);
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: var(--radius-md);
    margin: var(--spacing-sm) 0;
    color: #856404;
    text-align: center;
    font-size: var(--font-body-small);
    font-weight: var(--font-weight-medium);
}

/* Key Features Section */
.key-features-section {
    background: var(--color-white);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    margin-top: var(--spacing-md);
    box-shadow: var(--shadow-sm);
    border-left: var(--spacing-sm) solid var(--color-accent-teal);
}

.features-title {
    font-size: var(--font-title-h2);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-primary);
    margin-bottom: var(--spacing-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.features-content {
    font-size: var(--font-subtitle);
    line-height: var(--line-height-relaxed);
    color: var(--color-text-secondary);
    font-weight: var(--font-weight-medium);
    background: var(--color-bg-secondary);
    padding: var(--card-padding);
    border-radius: var(--radius-md);
    border: var(--border-width) solid var(--color-border-light);
    white-space: pre-line;
}

.features-content p {
    margin-bottom: var(--spacing-xs);
}

.features-content p:empty {
    display: none;
}

.description-section {
    margin-top: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
}

.description-title {
    font-size: var(--font-title-h2);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-primary);
    margin-bottom: var(--spacing-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.description-content {
    font-size: var(--font-subtitle);
    line-height: var(--line-height-relaxed);
    color: var(--color-text-secondary);
    font-weight: var(--font-weight-medium);
    background: var(--color-bg-secondary);
    padding: var(--card-padding);
    border-radius: var(--radius-md);
    border: var(--border-width) solid var(--color-border-light);
    white-space: pre-line;
}

.description-content p {
    margin-bottom: var(--spacing-xs);
}

/* Responsive Design */
@media (max-width: 768px) {
    .property-detail-container {
        margin: var(--spacing-md);
        padding: var(--spacing-md);
    }
    
    .property-title {
        font-size: var(--font-title-h1);
    }
    
    .property-details {
        grid-template-columns: 1fr;
    }
    
    .slideshow-container {
        max-width: 100%;
    }
    
    .slide img {
        height: clamp(250px, 30vh, 300px);
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.6s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-in-left {
    animation: slideInLeft 0.6s ease-out;
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-50px); }
    to { opacity: 1; transform: translateX(0); }
}

.slide-in-right {
    animation: slideInRight 0.6s ease-out;
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(50px); }
    to { opacity: 1; transform: translateX(0); }
}

