/* Three.js Container 3D Viewer Styles */

.container-3d-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    padding: 12px;
    z-index: 100;
    max-width: 250px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.control-section {
    margin-bottom: 16px;
}

.control-section:last-child {
    margin-bottom: 0;
}

.control-section-title {
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.control-btn {
    width: 100%;
    padding: 8px 12px;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 6px;
    font-family: inherit;
}

.control-btn:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
}

.control-btn:active {
    transform: scale(0.98);
}

.view-preset-btn {
    padding: 6px 10px;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.view-preset-btn:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
}

.view-preset-btn:active {
    transform: scale(0.95);
}

.pallet-info-panel {
    position: absolute;
    bottom: 20px;
    left: 20px;
    z-index: 100;
    animation: slideInLeft 0.3s ease-out;
    max-width: 350px;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Layer toggle checkboxes */
.control-section input[type="checkbox"] {
    cursor: pointer;
    width: 16px;
    height: 16px;
    margin: 0;
}

.control-section label {
    cursor: pointer;
    user-select: none;
}

.control-section label:hover {
    background-color: #f9fafb;
    border-radius: 4px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .container-3d-controls {
        max-width: 200px;
        padding: 8px;
    }
    
    .control-section-title {
        font-size: 11px;
    }
    
    .control-btn,
    .view-preset-btn {
        font-size: 11px;
        padding: 6px 8px;
    }
    
    .pallet-info-panel {
        bottom: 10px;
        left: 10px;
        right: 10px;
        max-width: none;
    }
}

/* Canvas container positioning */
canvas {
    display: block;
}

/* Ensure parent containers have proper positioning */
[id^="canvas"] {
    position: relative;
}

/* Loading overlay styles for Three.js renderer */
.threejs-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
}

.threejs-loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e5e7eb;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Info panel close button */
.pallet-info-panel button {
    background: transparent;
    border: none;
    font-size: 20px;
    line-height: 1;
    padding: 0;
    cursor: pointer;
    transition: color 0.2s;
}

.pallet-info-panel button:hover {
    color: #1f2937;
}

/* Smooth transitions for layer visibility */
.layer-transition {
    transition: opacity 0.3s ease;
}
