/* Property Optimization Styles */

/* Floor plan gallery */
.floor-plan-gallery {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin: 2rem 0;
    justify-content: center;
    justify-items: center;
}

.floor-plan-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.floor-plan-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.floor-plan-image-container {
    width: 100%;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.floor-plan-card img {
    max-width: 100%;
    max-height: 450px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

.floor-plan-info {
    padding: 1rem;
    text-align: center;
}

.floor-plan-info h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.2rem;
    color: #333;
}

.floor-plan-info p {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
}

/* 360 Modal Overlay */
.panorama-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    display: none;
    flex-direction: column;
}

.panorama-modal.active {
    display: flex;
}

.modal-header {
    background: white;
    color: #333;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    flex: 1;
    text-align: center;
    color: #333;
}

.back-to-gallery-header {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border: 1px solid rgba(0, 0, 0, 0.9);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.back-to-gallery-header:hover {
    background: rgba(0, 0, 0, 0.9);
    border-color: rgba(0, 0, 0, 1);
}

.close-modal {
    background: none;
    border: none;
    color: #666;
    font-size: 1.8rem;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.close-modal:hover {
    background-color: rgba(0, 0, 0, 0.1);
    color: #333;
}

.modal-content {
    flex: 1;
    position: relative;
}

.modal-panorama-container {
    width: 100%;
    height: 100%;
    position: relative;
}

.modal-panorama {
    width: 100%;
    height: 100%;
}

.modal-plan-container {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 300px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 1rem;
    z-index: 1000;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

.modal-plan-container img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.modal-plan-container .panoramaScenes {
    position: relative;
    display: inline-block;
    width: 100%;
}

.modal-plan-container .panoramaScenes a {
    position: absolute;
    color: #ff6b6b;
    font-size: 1.2rem;
    text-decoration: none;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    border: 2px solid #ff6b6b;
}

.modal-plan-container .panoramaScenes a:hover {
    background: #ff6b6b;
    color: white;
    transform: translate(-50%, -50%) scale(1.15);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4);
}


/* Special case for single item - center it */
.floor-plan-gallery:has(.floor-plan-card:only-child) {
    grid-template-columns: 1fr;
    max-width: 25%;
    margin: 2rem auto;
}

/* Responsive design */
@media (max-width: 1200px) {
    .floor-plan-gallery {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .floor-plan-gallery {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .modal-plan-container {
        top: 10px;
        right: 10px;
        left: 10px;
        width: auto;
        max-width: 280px;
        margin: 0 auto;
    }
}

@media (max-width: 600px) {
    .floor-plan-gallery {
        grid-template-columns: 1fr;
    }
    
    .modal-plan-container {
        position: static;
        width: 100%;
        max-width: none;
        margin: 0;
        border-radius: 0;
        background: rgba(255, 255, 255, 0.98);
    }
    
    .modal-panorama-container {
        flex: 1;
    }
}

/* Loading indicator */
.panorama-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 1.2rem;
    z-index: 1000;
}

.panorama-loading:after {
    content: '...';
    animation: dots 1s steps(5, end) infinite;
}

@keyframes dots {
    0%, 20% {
        color: rgba(255, 255, 255, 0);
        text-shadow:
            .25em 0 0 rgba(255, 255, 255, 0),
            .5em 0 0 rgba(255, 255, 255, 0);
    }
    40% {
        color: white;
        text-shadow:
            .25em 0 0 rgba(255, 255, 255, 0),
            .5em 0 0 rgba(255, 255, 255, 0);
    }
    60% {
        text-shadow:
            .25em 0 0 white,
            .5em 0 0 rgba(255, 255, 255, 0);
    }
    80%, 100% {
        text-shadow:
            .25em 0 0 white,
            .5em 0 0 white;
    }
}