/* Styling for mobile responsiveness, aesthetic */
.visualizer-wrapper {
    display: flex;
    flex-direction: column;
    height: 100vh; /* Full viewport height */
    width: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background-color: #f7f9fc;
    font-family: 'Inter', sans-serif;
}

.canvas-container {
    flex: 1; /* Takes up remaining space, usually top part */
    width: 100%;
    height: 55vh;
    background-color: #d1d8e0;
    position: relative;
    box-shadow: inset 0 -4px 10px rgba(0,0,0,0.05);
}

#canvas-container canvas {
    width: 100% !important;
    height: 100% !important;
    outline: none;
    display: block;
}

.controls-panel {
    height: 45vh;
    background: #ffffff;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    box-shadow: 0 -10px 20px rgba(0,0,0,0.1);
    padding: 25px;
    overflow-y: auto;
    z-index: 10;
    position: relative;
    margin-top: -20px; /* Overlap effect */
}

.controls-panel h3 {
    margin-top: 0;
    color: #1e3c72;
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 25px;
}

.control-group {
    margin-bottom: 25px;
}

.control-group h4 {
    margin-bottom: 15px;
    font-size: 1.1rem;
    color: #444;
    font-weight: 600;
}

.horizontal-scroll {
    display: flex;
    overflow-x: auto;
    gap: 15px;
    padding-bottom: 10px;
    scrollbar-width: thin; /* Firefox */
    scrollbar-color: #cbd5e1 transparent;
}

.horizontal-scroll::-webkit-scrollbar {
    height: 6px;
}
.horizontal-scroll::-webkit-scrollbar-track {
    background: transparent;
}
.horizontal-scroll::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 10px;
}

.material-btn {
    white-space: nowrap;
    padding: 12px 24px;
    border-radius: 30px;
    background-color: #f1f5f9;
    border: 2px solid transparent;
    color: #475569;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

.material-btn:hover {
    background-color: #e2e8f0;
    transform: translateY(-2px);
}

.material-btn.active {
    background-color: #eff6ff;
    border-color: #3b82f6;
    color: #1d4ed8;
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.2);
}

.color-swatch {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    cursor: pointer;
    border: 4px solid #ffffff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.color-swatch:hover {
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.2);
}

.color-swatch.active {
    border-color: #3b82f6;
    transform: scale(1.1);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.3);
}

.color-swatch.active::after {
    content: '✓';
    position: absolute;
    color: white;
    font-size: 24px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

/* Base house swatch styling if needed adjustments */
.house-swatch.active {
    border-color: #10b981;
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.3);
}
.house-swatch.active::after {
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.texture-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    border-radius: 12px;
    background: #fff;
    border: 2px solid transparent;
    padding: 8px;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    min-width: 120px;
}
.texture-card img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 8px;
}
.texture-card span {
    font-size: 0.9rem;
    font-weight: 600;
    color: #444;
    text-align: center;
}
.texture-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.1);
}
.texture-card.active {
    border-color: #3b82f6;
    background: #eff6ff;
}

/* Responsive constraints */
@media (min-width: 1024px) {
    .visualizer-wrapper {
        flex-direction: row;
        height: calc(100vh - 80px); /* Assuming header */
    }
    
    .canvas-container {
        height: 100%;
        box-shadow: none;
    }
    
    .controls-panel {
        width: 400px;
        min-width: 400px;
        height: 100%;
        margin-top: 0;
        border-radius: 0;
        border-left: 1px solid #e2e8f0;
        box-shadow: -5px 0 20px rgba(0,0,0,0.05);
        display: flex;
        flex-direction: column;
    }

    .horizontal-scroll {
        flex-wrap: wrap;
        overflow-x: visible;
        padding-bottom: 0;
    }

    .color-swatch {
        width: 50px;
        height: 50px;
        margin-bottom: 10px;
    }

    .material-btn {
        flex: 1 1 calc(50% - 15px); /* grid-like */
        text-align: center;
        margin-bottom: 10px;
    }
}
