/**
 * 3D Viewer Frontend Styles
 */

.threed-viewer-wrapper {
    display: block;
    margin: 20px 0;
    width: 100%;
    max-width: 100%;
}

.threed-viewer-container {
    position: relative;
    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);
}

.threed-viewer-container canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

.threed-viewer-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 20px 40px;
    background-color: rgba(255, 255, 255, 0.95);
    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: 250px;
}

.threed-progress-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

.threed-progress-bar {
    width: 100%;
    height: 8px;
    background-color: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.threed-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #45a049);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
}

.threed-progress-text {
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

.threed-viewer-error {
    padding: 20px;
    background-color: #fee;
    border: 1px solid #fcc;
    border-radius: 4px;
    color: #c33;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: 14px;
    text-align: center;
    margin: 20px;
}

/* Responsywność */
@media (max-width: 768px) {
    .threed-viewer-container {
        border-radius: 0;
    }
    
    .threed-viewer-loading {
        padding: 15px 30px;
        font-size: 14px;
    }
}

/* Pełny ekran */
.threed-viewer-container.fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999;
    border-radius: 0;
    margin: 0;
}

/* Przyciski kontroli */
.threed-fullscreen-button,
.threed-autorotate-button,
.threed-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);
}

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

.threed-autorotate-button {
    right: 60px; /* Obok przycisku fullscreen */
}

.threed-autorotate-horizontal {
    right: 60px; /* Pierwszy przycisk autorotacji */
}

.threed-autorotate-vertical {
    right: 110px; /* Drugi przycisk autorotacji */
}

.threed-reset-view-button {
    right: 160px; /* Przycisk reset view */
}

.threed-fullscreen-button:hover,
.threed-autorotate-button:hover,
.threed-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);
}

.threed-fullscreen-button:active,
.threed-autorotate-button:active,
.threed-reset-view-button:active {
    transform: scale(0.95);
}

/* Stan aktywny dla przycisku autorotacji */
.threed-autorotate-button.active {
    background-color: rgba(33, 150, 243, 0.2);
    border-color: #2196F3;
    color: #2196F3;
}

.threed-autorotate-button.active:hover {
    background-color: rgba(33, 150, 243, 0.3);
}

/* Vinetowanie - efekt ciemnienia na krawędziach */
.threed-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;
}

