/**
 * Nanovi 360° Viewer Styles
 */

/* ===========================================
   INLINE-MODUS (Standard)
   =========================================== */
.nanovi360_inline {
    position: relative;
    width: 100%;
    height: 500px;
    background-color: #f5f5f5;
    border-radius: 8px;
    overflow: hidden;
}

.nanovi360_inline .content,
.nanovi360_inline #showcase,
.nanovi360_inline .showcase,
.nanovi360_inline #threesixty,
.nanovi360_inline #threesixty-main,
.nanovi360_inline #viewer {
    width: 100%;
    height: 100%;
}

.nanovi360_inline #viewer {
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: grab;
}

.nanovi360_inline #viewer:active {
    cursor: grabbing;
}

.nanovi360_inline #viewer img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
}

/* ===========================================
   MODAL-MODUS (Popup/Fullscreen)
   =========================================== */

/* Modal Overlay */
.nanovi360_bodyOuter {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 999999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.nanovi360_bodyOuter.disabled {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Modal Body */
.nanovi360_body {
    position: relative;
    width: 90%;
    max-width: 1200px;
    height: 80vh;
    max-height: 800px;
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* Close Button */
#nanovi360_close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 32px;
    font-weight: bold;
    color: #333;
    cursor: pointer;
    z-index: 1000;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.9);
    transition: background-color 0.2s ease, color 0.2s ease;
}

#nanovi360_close:hover {
    background-color: #333;
    color: #fff;
}

/* Content Container */
.nanovi360_body .content {
    width: 100%;
    height: 100%;
}

.nanovi360_body #showcase {
    width: 100%;
    height: 100%;
}

.nanovi360_body .showcase {
    width: 100%;
    height: 100%;
}

/* 360 Viewer Container */
#threesixty {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

#threesixty-main {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

#viewer {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: grab;
    background-color: #f5f5f5;
}

#viewer:active {
    cursor: grabbing;
}

#viewer img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
}

/* iPad-spezifische Styles */
#main.isipad #viewer {
    touch-action: none;
}

/* Hidden Utility Class */
.hidden {
    display: none !important;
}

/* Responsive Anpassungen */
@media screen and (max-width: 768px) {
    .nanovi360_body {
        width: 95%;
        height: 70vh;
        border-radius: 4px;
    }

    #nanovi360_close {
        top: 10px;
        right: 10px;
        font-size: 28px;
        width: 36px;
        height: 36px;
    }
}

@media screen and (max-width: 480px) {
    .nanovi360_body {
        width: 100%;
        height: 100%;
        border-radius: 0;
    }

    #nanovi360_close {
        top: 15px;
        right: 15px;
    }
}

/* Loading Indicator (optional) */
#viewer.loading::after {
    content: '';
    position: absolute;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #333;
    border-radius: 50%;
    animation: nanovi360-spin 1s linear infinite;
}

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