.model-viewer-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    background-color: #f0f0f0;
    touch-action: none; /* Ważne dla smooth touch na mobile */
}

/* Przezroczyste tło */
.model-viewer-container.transparent-bg {
    background-color: transparent !important;
    background-image: none !important;
}

/* Obrazek w tle - domyślne ustawienia */
.model-viewer-container {
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
}

.model-viewer-container canvas {
    display: block;
    width: 100%;
    height: 100%;
    outline: none;
}

/* Loading State */
.model-viewer-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.9);
    z-index: 10;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.model-viewer-loading p {
    margin-top: 20px;
    font-size: 14px;
    color: #666;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Cursor Styles */
.model-viewer-container.manual-control {
    cursor: grab;
}

.model-viewer-container.manual-control:active {
    cursor: grabbing;
}

/* Mobile Optimization */
@media (max-width: 768px) {
    .model-viewer-container {
        /* Na mobile możesz ustawić minimalną wysokość */
        min-height: 300px;
    }
    
    .loading-spinner {
        width: 40px;
        height: 40px;
    }
    
    .model-viewer-loading p {
        font-size: 12px;
    }
}

/* Touch feedback - subtelne podświetlenie przy dotyku */
@media (hover: none) and (pointer: coarse) {
    .model-viewer-container:active {
        opacity: 0.95;
        transition: opacity 0.1s;
    }
}

/* Smooth transitions */
.model-viewer-container {
    transition: background-color 0.3s ease;
}

/* Accessibility - focus state dla klawiatury */
.model-viewer-container:focus-within {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* Prevent text selection podczas przeciągania */
.model-viewer-container {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Optional: Shadow effect dla kontenera */
.model-viewer-container.with-shadow {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Optional: Border dla kontenera */
.model-viewer-container.with-border {
    border: 1px solid #e0e0e0;
}

/* Responsive height adjustments */
@media (max-width: 480px) {
    .model-viewer-container {
        min-height: 250px;
    }
}

@media (min-width: 1200px) {
    .model-viewer-container {
        max-width: 100%;
    }
}
