/* Matterport Modal Styles */
.matterport_modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    width: 100vw;
    height: 100vh;
    z-index: 99999;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    overflow: hidden;
}

.matterport_modal iframe {
    position: absolute;
    top: 2.5%;
    left: 2.5%;
    width: 95%;
    height: 95%;
    border: none;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    z-index: 99999;
    display: block;
    background-color: #000000;
}

.matterport_modal_close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    background-color: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.matterport_modal_close:hover {
    background-color: #ffffff;
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.matterport_modal_close:active {
    transform: scale(0.95);
}

.matterport_modal_close::before,
.matterport_modal_close::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 2px;
    background-color: #333;
    transition: background-color 0.3s ease;
}

.matterport_modal_close:hover::before,
.matterport_modal_close:hover::after {
    background-color: #000;
}

.matterport_modal_close::before {
    transform: rotate(45deg);
}

.matterport_modal_close::after {
    transform: rotate(-45deg);
}

/* Prevent body scroll when modal is open */
body.modal-open {
    overflow: hidden !important;
    position: fixed;
    width: 100%;
    height: 100%;
}

div[tdvclass="Button"] div[tdvclass="content"] {
    width: auto !important;
    overflow: hidden;
}

/* Responsive adjustments */
@media screen and (max-width: 768px) {
    .matterport_modal {
        /* Ensure full screen coverage on mobile */
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
    }

    .matterport_modal iframe {
        position: absolute !important;
        width: 100% !important;
        height: 100% !important;
        max-width: 100vw;
        max-height: 100vh;
        top: 0 !important;
        left: 0 !important;
        border-radius: 4px;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        z-index: 100000 !important;
    }

    .matterport_modal_close {
        position: fixed !important;
        top: 10px !important;
        right: 10px !important;
        width: 40px;
        height: 40px;
    }

    .matterport_modal_close::before,
    .matterport_modal_close::after {
        width: 18px;
    }
}