/**
 * Single Listing Styles
 * Styles for individual listing pages
 * Version: 1.15.3
 */

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

.listing-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.listing-title {
    font-size: 2.5em;
    margin: 0;
    color: #333;
    flex: 1;
}

.listing-price {
    font-size: 2em;
    font-weight: bold;
    color: #e74c3c;
    margin-left: 20px;
}

.listing-featured-image {
    margin-bottom: 30px;
    text-align: center;
}

.listing-featured-image img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.listing-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.listing-info-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
}

.listing-info-section h3 {
    margin-top: 0;
    color: #333;
    border-bottom: 2px solid #e74c3c;
    padding-bottom: 10px;
}

.listing-info-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

.listing-info-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.listing-info-label {
    font-weight: bold;
    color: #666;
}

.listing-info-value {
    color: #333;
}

.listing-description {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.listing-description h3 {
    margin-top: 0;
    color: #333;
    border-bottom: 2px solid #e74c3c;
    padding-bottom: 10px;
}

.listing-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.gallery-item {
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

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

.gallery-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}

.contact-form-section {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.contact-form-section h3 {
    margin-top: 0;
    color: #333;
    border-bottom: 2px solid #e74c3c;
    padding-bottom: 10px;
}

.contact-form {
    display: grid;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: bold;
    margin-bottom: 5px;
    color: #666;
}

.form-group input,
.form-group textarea {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #e74c3c;
    box-shadow: 0 0 5px rgba(231, 76, 60, 0.3);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.submit-button {
    background: #e74c3c;
    color: white;
    padding: 15px 30px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.submit-button:hover {
    background: #c0392b;
}

.submit-button:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
}

.map-section {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.map-section h3 {
    margin-top: 0;
    color: #333;
    border-bottom: 2px solid #e74c3c;
    padding-bottom: 10px;
}

#map {
    height: 400px;
    width: 100%;
    border-radius: 8px;
    border: 1px solid #ddd;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .listing-container {
        padding: 15px;
    }
    
    .listing-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .listing-price {
        margin-left: 0;
        margin-top: 10px;
    }
    
    .listing-title {
        font-size: 2em;
    }
    
    .listing-details {
        grid-template-columns: 1fr;
    }
    
    .listing-gallery {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }
    
    .gallery-item img {
        height: 120px;
    }
    
    .contact-form-section {
        padding: 20px;
    }
}

/* Lightbox styles */
.lightbox {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
    /* Use flexbox for perfect centering */
    justify-content: center;
    align-items: center;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Remove the old centering method */
}

.lightbox img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    display: block;
}

.lightbox-close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}

.lightbox-close:hover {
    color: #bbb;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
    background: rgba(0,0,0,0.5);
    padding: 10px 15px;
    border-radius: 4px;
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.lightbox-nav:hover {
    background: rgba(0,0,0,0.8);
}

/* Form feedback styles */
.form-feedback {
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-weight: bold;
}

.form-feedback.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.form-feedback.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #e74c3c;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
} 