/**
 * Nox-3DPrezenter Frontend Styles
 */

.nox-3dprezenter-wrapper {
    display: block;
    margin: 20px 0;
    width: 100%;
    max-width: 100%;
}

.nox-3dprezenter-container {
    position: relative !important;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    background-color: #f5f5f5;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.nox-3dprezenter-container.fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    z-index: 99999 !important;
    border-radius: 0 !important;
    margin: 0 !important;
    border: none !important;
}

/* Dodatkowe style dla mobile fullscreen */
@media (max-width: 768px) {
    .nox-3dprezenter-container.fullscreen {
        z-index: 9999999 !important;
    }
    
    /* Ukryj overflow body gdy fullscreen na mobile */
    body.nox-fullscreen-active {
        overflow: hidden !important;
        position: fixed !important;
        width: 100% !important;
        height: 100% !important;
    }
    
    /* Przenieś wszystkie przyciski do prawego dolnego rogu w trybie fullscreen na mobile - poziomo */
    .nox-3dprezenter-container.fullscreen .nox-fullscreen-button,
    .nox-3dprezenter-container.fullscreen .nox-material-toggle-button,
    .nox-3dprezenter-container.fullscreen .nox-reset-view-button {
        top: auto !important;
        bottom: 10vh !important;
        right: auto !important;
    }
    
    /* Ustaw przyciski poziomo (obok siebie) */
    .nox-3dprezenter-container.fullscreen .nox-fullscreen-button {
        bottom: 10vh !important;
        right: 10px !important;
    }
    
    .nox-3dprezenter-container.fullscreen .nox-material-toggle-button {
        bottom: 10vh !important;
        right: 60px !important;
    }
    
    .nox-3dprezenter-container.fullscreen .nox-reset-view-button {
        bottom: 10vh !important;
        right: 110px !important;
    }
    
    /* Przenieś selektor materiałów do dolnego rogu w trybie fullscreen na mobile */
    .nox-3dprezenter-container.fullscreen .nox-material-selector {
        top: auto !important;
        bottom: calc(10vh + 60px) !important;
        right: 10px !important;
        max-width: calc(100vw - 20px) !important;
    }
    
    /* Ukryj WordPress admin bar i menu mobilne gdy fullscreen */
    body.nox-fullscreen-active #wpadminbar,
    body.nox-fullscreen-active .admin-bar #wpadminbar,
    body.nox-fullscreen-active header,
    body.nox-fullscreen-active nav,
    body.nox-fullscreen-active .site-header,
    body.nox-fullscreen-active .main-navigation,
    body.nox-fullscreen-active .mobile-menu,
    body.nox-fullscreen-active .menu-toggle,
    body.nox-fullscreen-active .site-branding {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        z-index: -1 !important;
    }
}

/* Ukryj WordPress admin bar i menu w trybie fullscreen (wszystkie urządzenia) */
.nox-3dprezenter-container.fullscreen ~ #wpadminbar,
body.nox-fullscreen-active #wpadminbar,
body.nox-fullscreen-active .admin-bar #wpadminbar {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    z-index: -1 !important;
}

.nox-3dprezenter-canvas-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

.nox-3dprezenter-container canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
    position: relative;
    z-index: 1;
    pointer-events: auto;
}

.nox-3dprezenter-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 25px 35px;
    background-color: rgba(255, 255, 255, 0.98);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    z-index: 10;
    text-align: center;
    min-width: 280px;
}

.nox-3dprezenter-loading-text {
    margin: 0 0 15px 0;
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.nox-3dprezenter-progress-container {
    width: 250px;
    height: 6px;
    background-color: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
    margin: 0 auto;
}

.nox-3dprezenter-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 3px;
    transition: width 0.3s ease;
    animation: progressPulse 1.5s ease-in-out infinite;
}

@keyframes progressPulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.nox-3dprezenter-progress-percent {
    margin-top: 10px;
    font-size: 12px;
    color: #666;
}

/* Przyciski kontroli */
.nox-fullscreen-button,
.nox-material-toggle-button,
.nox-reset-view-button {
    position: absolute;
    top: 10px;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.nox-fullscreen-button {
    right: 10px;
}

.nox-material-toggle-button {
    right: 60px;
}

.nox-reset-view-button {
    right: 110px;
}

.nox-fullscreen-button:hover,
.nox-material-toggle-button:hover,
.nox-reset-view-button:hover {
    background-color: rgba(255, 255, 255, 1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    transform: scale(1.05);
}

.nox-fullscreen-button:active,
.nox-material-toggle-button:active,
.nox-reset-view-button:active {
    transform: scale(0.95);
}

.nox-material-toggle-button.active {
    background-color: rgba(102, 126, 234, 0.2);
    border-color: #667eea;
    color: #667eea;
}

.nox-material-toggle-button.active:hover {
    background-color: rgba(102, 126, 234, 0.3);
}

/* Panel wyboru materiałów */
.nox-material-selector {
    position: absolute;
    top: 60px;
    right: 10px;
    background: rgba(255, 255, 255, 0.25);
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    display: none;
    flex-direction: column;
    gap: 10px;
    max-width: 300px;
    min-width: 200px;
    pointer-events: auto;
    backdrop-filter: blur(4px);
}

.nox-material-selector.visible {
    display: flex !important;
}

.nox-material-version-btn {
    pointer-events: auto;
    cursor: pointer;
}

.nox-material-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nox-material-label {
    font-size: 12px;
    font-weight: 600;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nox-material-versions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.nox-material-version-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid #ddd;
    cursor: pointer;
    transition: all 0.2s;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    outline: none;
}

.nox-material-version-btn:hover {
    border-color: #667eea;
    transform: scale(1.1);
}

.nox-material-version-btn.active {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
}

.nox-material-version-btn[data-type="texture"] {
    border-radius: 8px;
}

/* Vignette overlay */
.nox-vignette-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 5;
    background: radial-gradient(ellipse at center, transparent 0%, transparent 60%, rgba(0, 0, 0, 0.4) 100%);
    border-radius: inherit;
}

/* Debug panel */
.nox-debug-panel {
    position: absolute;
    top: 4px;
    left: 4px;
    right: 4px;
    max-height: 80px;
    overflow: auto;
    background: transparent;
    color: #ff0000;
    font-size: 10px;
    font-family: monospace;
    padding: 4px 6px;
    border-radius: 0;
    z-index: 6;
}

