/**
 * Three.js GLB Viewer Styles
 * Optimized 3D model viewer styling
 */

/* Container */
.three-viewer-container {
    position: relative;
    width: 100%;
    height: calc(100vh - 120px);
    background: radial-gradient(circle at center, #ffffff 0%, #e5e7eb 100%);
    overflow: hidden;
}

.three-viewer-container canvas {
    display: block;
}

/* Loading Overlay */
.glb-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(247, 247, 247, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    transition: opacity 0.3s ease;
}

.glb-loader-content {
    text-align: center;
    max-width: 280px;
}

.glb-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(2, 56, 116, 0.1);
    border-top-color: #023874;
    border-radius: 50%;
    animation: glb-spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes glb-spin {
    to {
        transform: rotate(360deg);
    }
}

.glb-loading-text {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 16px;
}

.glb-progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(2, 56, 116, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}

.glb-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #023874, #3b82f6);
    border-radius: 3px;
    transition: width 0.2s ease;
}

.glb-progress-text {
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
}

/* Error Overlay */
.glb-error-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(247, 247, 247, 0.95);
    backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.glb-error-content {
    text-align: center;
    color: #ef4444;
}

.glb-error-content svg {
    margin-bottom: 16px;
    opacity: 0.8;
}

.glb-error-content p {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
}

.glb-retry-btn {
    padding: 10px 24px;
    background: #023874;
    color: white;
    font-weight: 600;
    font-size: 14px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.glb-retry-btn:hover {
    background: #034d9a;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(2, 56, 116, 0.3);
}

/* Controls Overlay */
.viewer-controls-overlay {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 9999px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    z-index: 10;
    transition: all 0.3s ease;
}

.viewer-controls-overlay:hover {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15);
}

.viewer-control-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: #1f2937;
    background: white;
    border: 1px solid #e5e7eb;
    cursor: pointer;
    transition: all 0.2s ease;
}

.viewer-control-btn:hover {
    background: #023874;
    color: white;
    border-color: #023874;
    transform: translateY(-2px);
}

.viewer-control-btn.active {
    background: #023874;
    color: white;
    border-color: #023874;
}

.viewer-control-btn svg {
    width: 20px;
    height: 20px;
}

.viewer-divider {
    width: 1px;
    height: 24px;
    background: #d1d5db;
    margin: 8px 4px;
}

/* Status Badge */
.viewer-status-badge {
    position: absolute;
    top: 24px;
    left: 24px;
    padding: 6px 16px;
    background: #023874;
    color: white;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 8px;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(2, 56, 116, 0.3);
}

/* Back Button */
.viewer-back-btn {
    position: absolute;
    top: 24px;
    right: 24px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: white;
    color: #1f2937;
    font-weight: 500;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 10;
    text-decoration: none;
    transition: all 0.2s ease;
}

.viewer-back-btn:hover {
    background: #f9fafb;
    transform: translateX(-4px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.viewer-back-btn svg {
    width: 20px;
    height: 20px;
}

/* Model Info Panel */
.viewer-model-info {
    position: absolute;
    bottom: 100px;
    left: 24px;
    max-width: 300px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.viewer-model-info h2 {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 4px;
}

.viewer-model-info p {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.5;
}

/* Performance Info */
.viewer-performance-info {
    position: absolute;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 16px;
    background: rgba(16, 185, 129, 0.9);
    color: white;
    font-size: 12px;
    font-weight: 600;
    border-radius: 8px;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.viewer-performance-info.show {
    opacity: 1;
}

/* Mobile Responsive */
@media (max-width: 640px) {
    .viewer-model-info {
        display: none;
    }

    .viewer-controls-overlay {
        padding: 10px 16px;
        gap: 8px;
    }

    .viewer-control-btn {
        width: 36px;
        height: 36px;
    }

    .viewer-control-btn svg {
        width: 18px;
        height: 18px;
    }

    .viewer-status-badge {
        font-size: 10px;
        padding: 4px 12px;
    }

    .viewer-back-btn {
        padding: 8px 16px;
        font-size: 14px;
    }
}
