/* Scene Configurator Styles */

/* Main Layout */
.configurator-wrapper {
    display: flex;
    height: 100vh;
    overflow: hidden;
    padding-top: 80px;
    /* Space for fixed navbar */
}

/* Scene Canvas Area (Left) */
.scene-canvas-container {
    flex-grow: 1;
    position: relative;
    background-color: #f0f0f0;
    overflow: hidden;
    /* Cursor indicates 3D interaction */
    cursor: grab;
}

.scene-canvas-container:active {
    cursor: grabbing;
}

/* Canvas element text */
canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* Sidebar Area (Right) */
.product-sidebar {
    width: 350px;
    background: white;
    border-left: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    z-index: 10;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.05);
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--color-border);
    background: white;
}

.sidebar-header h2 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    margin-bottom: 15px;
}

/* Collection Tabs */
.collection-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 5px;
}

.tab-btn {
    padding: 6px 12px;
    background: #f5f5f5;
    border: none;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.tab-btn:hover {
    background: #e0e0e0;
}

.tab-btn.active {
    background: var(--color-primary);
    color: white;
}

/* Product Grid */
.product-grid {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.product-card {
    background: white;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    /* Horizontal layout */
    align-items: center;
    min-height: 80px;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: var(--color-primary);
}

.product-thumb {
    width: 80px;
    height: 80px;
    object-fit: cover;
    background: #f9f9f9;
    flex-shrink: 0;
}

.product-info {
    padding: 10px 15px;
    flex-grow: 1;
    overflow: hidden;
}

.product-name {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-meta {
    font-size: 0.75rem;
    color: #999;
}

/* Overlay UI Elements */
.scene-overlay-top {
    position: absolute;
    top: 20px;
    left: 20px;
    pointer-events: none;
    /* Let clicks pass through to canvas */
    z-index: 5;
}

.scene-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    margin-top: 10px;
    text-shadow: 0 2px 4px rgba(255, 255, 255, 0.8);
}

.back-link {
    pointer-events: auto;
    text-decoration: none;
    color: var(--color-text-main);
    font-weight: 500;
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.8);
    padding: 5px 10px;
    border-radius: 4px;
}

.scene-loader {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
    transition: opacity 0.5s;
    opacity: 0;
    pointer-events: none;
}

.scene-loader.active {
    opacity: 1;
    pointer-events: auto;
}

.interaction-hints {
    position: absolute;
    bottom: 20px;
    right: 20px;
    /* Bottom right of canvas */
    background: rgba(255, 255, 255, 0.9);
    padding: 15px;
    border-radius: 8px;
    font-size: 0.8rem;
    color: #666;
    pointer-events: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.hint-item {
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.hint-item:last-child {
    margin-bottom: 0;
}

/* Floating Context Controls (Selected Item) */
.context-controls {
    position: absolute;
    top: 20px;
    right: 20px;
    /* Top right of canvas */
    background: white;
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 20;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 150px;
}

.selected-name {
    font-weight: 600;
    font-size: 0.9rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
    text-align: center;
}

.control-actions {
    display: flex;
    justify-content: space-between;
    gap: 5px;
}

.control-actions button {
    flex: 1;
    padding: 8px;
    border: 1px solid #ddd;
    background: #f9f9f9;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.2s;
}

.control-actions button:hover {
    background: white;
    border-color: #ccc;
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.btn-danger {
    color: #cc0000;
}

.btn-danger:hover {
    background: #cc0000 !important;
    color: white !important;
    border-color: #cc0000 !important;
}

/* Bottom Scene Controls */
.scene-controls-bottom {
    position: absolute;
    bottom: 20px;
    left: 20px;
    display: flex;
    gap: 10px;
    z-index: 20;
}

.btn-outline-danger {
    background: white;
    border: 1px solid #cc0000;
    color: #cc0000;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-outline-danger:hover {
    background: #cc0000;
    color: white;
}

.btn-secondary {
    background: #666;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: #444;
}

/* Responsive adjustments */
@media (max-width: 900px) {
    .configurator-wrapper {
        flex-direction: column;
        padding-top: 60px;
    }

    .scene-canvas-container {
        height: 60vh;
    }

    .product-sidebar {
        width: 100%;
        height: 40vh;
        box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.05);
    }

    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
}