﻿/* ----- GLOBAL STYLES ----- */
body {
    margin: 0;
    font-family: 'Arial', sans-serif;
}

/* Progress Overlay */
#progress-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 18px;
    font-weight: bold;
    z-index: 1000;
    display: none; /* Hidden by default */
}

/* Progress Box */
.progress-box {
    background: rgba(30, 30, 30, 0.9);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    width: 300px;
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 8px;
    background: #555;
    margin-top: 10px;
    border-radius: 5px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: #ffcc00;
    transition: width 0.5s ease-in-out;
}



/* Make sure the canvas does not overflow */
#three-canvas {
    width: 100% !important;
    height: 100% !important;

    display: block;
    touch-action: none; /* Prevents unwanted touch interactions */
    overflow: hidden; /* Prevents internal scrollbars */
    background: url('/assets/textures/background.webp') no-repeat center center;
    background-size: cover; /* This ensures it maintains aspect ratio */
    filter: brightness(1.2); /* Increase the value to make it brighter */
}

    #three-canvas::before {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(255, 255, 255, 0.5); /* Adjust the opacity (0.1 - 0.5) */
        pointer-events: none; /* Ensures clicks go through the overlay */
    }




/* Basic Layout */
#webapp-container {
    position: relative;
    width: 100%;
    height: 100vh;
}
/* Sidebar Styles */
#sidebar {
    position: fixed;
    right: -300px;
    top: 0%;
    height: 81vh; /* 80% of viewport height */
    width: 280px;
    padding: 15px;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.2);
    transition: right 0.3s ease-in-out;
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.1); /* Increased transparency */
    backdrop-filter: blur(2px); /* Adds blur effect */
    z-index: 9000; /* Ensure it's above the bottom bar */
    transition: right 0.3s ease-in-out, opacity 0.3s ease-in-out;
    opacity: 1;
}

    #sidebar:not(.open) {
        opacity: 0;
        pointer-events: none; /* Prevents interaction when hidden */
    }


/* Floating Options Button - Rounded */
#toggle-sidebar {
    position: fixed;
    top: 80%;
    right: 10px;
    transform: translateY(-50%);
    background: #5a3a1b;
    color: white;
    border: none;
    padding: 12px;
    width: 80px; /* Ensures button is a circle */
    height: 80px; /* Ensures button is a circle */
    border-radius: 50%; /* Makes it round */
    cursor: pointer;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.2);
    z-index: 9999; /* Ensure it's above the bottom bar */
    font-size: 14px;
    font-weight: bold;
    gap: 5px;
}

    #sidebar.open {
        right: 0;
    }

/* Darken Sidebar Close Button */
#close-sidebar {
    font-size: 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #5a3a1b;
}

.floating-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #5a3a1b; /* Keep the brown tone */
    color: white;
    border: none;
    padding: 12px 16px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    gap: 5px;
    font-weight: bold;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.2);
}

/* Bottom Bar Styling */
#bottom-bar {
    position: fixed;
    bottom: 10px;
    left: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.4);
    display: flex;
    justify-content: space-around; /* Distribute buttons evenly */
    align-items: center;
    border-radius: 12px;
    box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.2);
    padding: 12px 16px; /* More padding for "air" */
    height: auto;
    gap: 12px; /* Adds space between buttons */
    z-index: 1000; /* Ensure sidebar is still above this */
}

    /* Button Styling */
    #bottom-bar button {
        background-color: #5a3a1b;
        color: white;
        padding: 10px 12px; /* Increased padding */
        border-radius: 8px; /* Rounded corners */
        font-size: 14px;
        font-weight: bold;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px; /* Space between icon & text */
        transition: background-color 0.2s ease-in-out;
        flex: 1; /* Ensure both buttons take equal space */
        min-width: 140px; /* Prevent too small buttons */
    }

        /* Button Hover Effect */
        #bottom-bar button:hover {
            background-color: #3e2a13;
        }

        /* Improve icon spacing */
        #bottom-bar button img {
            width: 18px;
            height: 18px;
        }


/* Fix Price Alignment */
#price-display {
    font-weight: bold;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 5px;
    color: white; /* White for better contrast */
    text-shadow: 2px 2px 3px rgba(0, 0, 0, 0.7);
}

/* Collapsible Sections */
.collapsible {
    background-color: #5a3a1b; /* Darker brown */
    color: white;
    padding: 12px;
    font-size: 16px;
    font-weight: bold;
    text-align: left;
    border: none;
    cursor: pointer;
    width: 100%;
    border-radius: 5px;
    transition: background-color 0.2s ease-in-out;
}
    .collapsible:hover {
        background-color: #3e2a13; /* Even darker on hover */
    }

    /* Adjust the active section */
    .collapsible.active {
        background-color: #8c6239; /* Slightly lighter when expanded */
    }


    .collapsible:after {
        content: "▼";
        float: right;
    }

    .collapsible.active:after {
        content: "▲";
    }

/* Wrapper for all sliders */
.slider-wrapper {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px;
    background: rgba(0, 0, 0, 0); /* Darker transparency for contrast */
    border-radius: 10px;
    backdrop-filter: blur(6px); /* Soft blur for clarity */
}

/* Individual slider container */
.slider-container {
    display: flex;
    flex-direction: column;
    background: transparent; /* Ensure full transparency */
    padding: 8px;
    border-radius: 5px;
}

    /* Slider Label */
    .slider-container label {
        color: white; /* White text */
        font-size: 14px;
        font-weight: bold;
        text-shadow: 2px 2px 3px rgba(0, 0, 0, 0.7); /* Black outline */
        margin-bottom: 5px;
        display: block;
    }

/* Collapsible section */
.content {
    display: none;
    padding: 10px;
    background: transparent !important; /* Fully transparent */
}

/* Styled slider */
.styled-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 8px;
    background: rgba(0, 0, 0, 0.6); /* Semi-transparent track */
    border-radius: 5px;
    outline: none;
    transition: opacity 0.2s;
}

    /* Slider Thumb */
    .styled-slider::-webkit-slider-thumb {
        -webkit-appearance: none;
        width: 20px;
        height: 20px;
        border-radius: 50%;
        background: #8c6239;
        cursor: pointer;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    }

    /* Thumb hover effect */
    .styled-slider:hover::-webkit-slider-thumb {
        background: #a57247;
    }

#buttons-section {
    margin-top: 20px;
}

button {
    background-color: #5a3a1b;
    color: white;
    padding: 10px;
    border: none;
    cursor: pointer;
    width: 100%;
    align-items: center; /* Align text and numbers */
}

button:hover {
        background-color: #3e2a13;
}

.content {
    display: none;
    padding: 10px;
    background-color: #f4f4f4;
}

.container {
    width: 90%;
    max-width: 400px;
    margin: 20px auto;
    text-align: center;
}


.active {
    display: block;
}

    .collapsible:hover {
        background-color: #ddd;
    }

.content {
    padding: 10px;
    display: none;
    background-color: #f9f9f9;
}

/* ----- TEXTURE SELECTION ----- */
.texture-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

    .texture-options img {
        width: 48px;
        height: 48px;
        margin: 0px;
        border: 2px solid transparent;
        cursor: pointer;
        transition: border-color 0.2s ease-in-out, transform 0.1s ease-in-out;
    }

        .texture-options img:hover {
            transform: scale(1.1);
            border-color: #8c6239;
        }

        .texture-options img.selected {
            border: 2px solid black;
        }

/* ✅ Custom Styled Checkbox */
.options-container input[type="checkbox"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border: 2px solid #8c6239; /* Warm brown border */
    border-radius: 3px;
    background: transparent;
    cursor: pointer;
    display: inline-block;
    vertical-align: middle;
    transition: all 0.2s ease-in-out;
    //display: flex;
    align-items: center;
    gap: 5px;
}

    .options-container input[type="checkbox"]:checked {
        background-color: #8c6239; /* Filled brown box */
        border-color: #8c6239;
        position: relative;
    }

        .options-container input[type="checkbox"]:checked::after {
            content: '✔';
            font-size: 12px;
            color: white;
            font-weight: bold;
            position: absolute;
            top: 1px;
            left: 3px;
        }

/* 📌 Align Checkbox Labels */
.options-container label {
    color: white; /* White for better contrast */
    font-weight: bold;
    font-size: 14px;
    text-shadow: 2px 2px 3px rgba(0, 0, 0, 0.7);
    cursor: pointer;
    margin-left: 5px;
}

.material-label {
    color: white; /* White for better contrast */
    font-weight: bold;
    font-size: 14px;
    text-shadow: 2px 2px 3px rgba(0, 0, 0, 0.7);
    cursor: pointer;
    margin-left: 5px;
}

/* 🔽 Custom Styled Dropdown */
.options-container select {
    background: #8c6239; /* Brown background */
    color: white;
    border: 2px solid #6e4a2b; /* Darker border */
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease-in-out;
}

    .options-container select:hover {
        background: #a57247; /* Slightly lighter brown */
    }

    .options-container select:focus {
        border-color: #cfa883; /* Light brown focus */
    }


/* ----- TOGGLE SWITCHES (CHECKBOX) ----- */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
    margin-left: 10px;
}

    .toggle-switch input {
        opacity: 0;
        width: 0;
        height: 0;
    }

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 20px;
}

    .slider:before {
        position: absolute;
        content: '';
        height: 16px;
        width: 16px;
        left: 2px;
        bottom: 2px;
        background-color: white;
        transition: 0.4s;
        border-radius: 50%;
    }

input:checked + .slider {
    background-color: #8c6239;
}

    input:checked + .slider:before {
        transform: translateX(20px);
    }

/* ----- RESPONSIVE DESIGN ADJUSTMENTS ----- */
@media screen and (max-width: 768px) {
    #slider-container {
        width: 95%;
        right: auto;
        left: 50%;
        transform: translateX(-50%);
    }

    .texture-options {
        justify-content: left;
        gap: 8px;
    }

        .texture-options img {
            width: 40px;
            height: 40px;
        }

    /* Stack buttons instead of side-by-side */
    .button-container {
        display: flex;
        flex-direction: column;
        gap: 8px;
        align-items: center;
    }

    /* Improve price section layout */
    #price-section {
        width: 95%;
        margin: auto;
        text-align: center;
        padding: 15px;
        border-radius: 10px;
    }

    #bottom-bar {
        flex-direction: row; /* Stack buttons vertically */
        gap: 8px; /* Space between stacked buttons */
        padding: 12px;
    }

        #bottom-bar button {
            width: 100%; /* Full width buttons on mobile */
        }

}

