/* Cubik 3D Viewer - Scoped Styles */
/* Prefix: cubik-viewer- to avoid conflicts */

.cubik-viewer-container {
    max-width: 1400px;
    margin: 0 auto;
}

.cubik-viewer-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 30px;
    color: #1a1a1a;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.cubik-viewer-wrapper {
    width: 100%;
    height: 700px;
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    position: relative;
}

.cubik-viewer-model {
    --poster-color: #f5f5f5;
    --progress-bar-color: #1a73e8;
}

/* Loading spinner - hidden by default, shown via JS */
.cubik-viewer-loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    border: 3px solid #e0e0e0;
    border-top-color: #1a73e8;
    border-radius: 50%;
    animation: cubik-viewer-spin 1s linear infinite;
    pointer-events: none;
    z-index: 11;
    display: none;
}

.cubik-viewer-loading-spinner.active {
    display: block;
}

@keyframes cubik-viewer-spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Progress bar */
.cubik-viewer-progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(0, 0, 0, 0.1);
    z-index: 11;
    display: none;
    transition: opacity 0.3s;
}

.cubik-viewer-progress-bar.active {
    display: block;
}

.cubik-viewer-progress-bar-update {
    height: 100%;
    background: #1a73e8;
    width: 0%;
    transition: width 0.3s;
}

/* AR Button */
.cubik-viewer-ar-button {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border: none;
    border-radius: 50px;
    padding: 14px 28px;
    font-size: 15px;
    font-weight: 500;
    color: #1a1a1a;
    cursor: pointer;
    display: none;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.2s;
    z-index: 10;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.cubik-viewer-ar-button:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    transform: translateX(-50%) translateY(-2px);
}

.cubik-viewer-ar-button svg {
    width: 20px;
    height: 20px;
}

/* Show AR button only on mobile */
@media (max-width: 768px) {
    .cubik-viewer-ar-button {
        display: flex;
    }
}

/* QR Container - compact in corner */
.cubik-viewer-qr-container {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: white;
    padding: 16px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 10;
    max-width: 220px;
}

.cubik-viewer-qr-text {
    font-size: 10px;
    color: #666;
    text-align: center;
    line-height: 1.3;
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.cubik-viewer-qrcode {
    display: flex;
    align-items: center;
    justify-content: center;
}

.cubik-viewer-qrcode img {
    border-radius: 4px;
}

/* Show QR code only on desktop */
@media (min-width: 769px) {
    .cubik-viewer-qr-container {
        display: flex;
    }
}

/* Mobile responsive */
@media (max-width: 768px) {
    .cubik-viewer-title {
        font-size: 24px;
        margin-bottom: 20px;
    }
    
    .cubik-viewer-wrapper {
        height: 400px;
        border-radius: 12px;
    }
}

@media (max-width: 480px) {
    .cubik-viewer-wrapper {
        height: 350px;
    }
}
