body {
    display: flex;
    flex-direction: column;
    height: 100vh;
    margin: 0;
    font-family: 'Poppins', sans-serif;
    overflow: hidden; /* Prevent scrolling during preloader */
}

#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 48px;
    font-weight: bold;
    z-index: 1000;
    animation: fadeOut 1s forwards 2s; /* Animation */
}

@keyframes fadeOut {
    to {
        opacity: 0;
        visibility: hidden;
    }
}

header {
    width: 100%;
    background-color: #007BFF;
    color: white;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 0;
    z-index: 1000;
}

.logo {
    font-size: 24px;
    font-weight: 600;
}

nav {
    display: flex;
    align-items: center;
}

nav a {
    color: white;
    text-decoration: none;
    margin: 0 15px;
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.bar {
    height: 3px;
    width: 25px;
    background-color: white;
    margin: 3px 0;
}

footer {
    width: 100%;
    background-color: #007BFF;
    color: white;
    text-align: center;
    padding: 10px 0;
    position: fixed;
    bottom: 0;
}

#container {
    display: flex;
    width: 100%;
    margin-top: 60px;
}

#viewerContainer {
    width: 85%;
    height: calc(100vh - 60px - 40px); /* Adjust for header and footer */
    position: relative;
}

model-viewer,
#webglViewer {
    width: 100%;
    height: 100%;
}

#webglViewer {
    display: none; /* Hide Three.js viewer by default */
}

#panel {
    width: 15%;
    background-color: #f8f9fa;
    padding: 20px;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
}

#uploadButton, #arToggle, #viewSampleButton, #resetButton, #modelViewerTab, #threeJsViewerTab {
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    background-color: #007BFF;
    color: white;
    border: none;
    border-radius: 5px;
    width: 100%;
    margin-bottom: 20px;
}

#uploadButton:hover, #arToggle:hover, #viewSampleButton:hover, #resetButton:hover, #modelViewerTab:hover, #threeJsViewerTab:hover {
    background-color: #0056b3;
}

#fileNamePlaceholder {
    width: 100%;
    padding: 10px;
    background-color: #e9ecef;
    border-radius: 5px;
    margin-bottom: 10px;
    text-align: center;
}

input[type="file"] {
    display: none;
}

label {
    margin-bottom: 10px;
    width: 100%;
    text-align: left;
}

#backgroundColor {
    width: 100%;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    nav {
        display: none;
    }

    .hamburger {
        display: flex;
    }

    .menu-active {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 60px;
        right: 0;
        background-color: #007BFF;
        width: 100%;
        padding: 10px 0;
    }

    .menu-active a {
        margin: 10px 0;
        text-align: center;
    }

    #panel {
        width: 100%;
        position: fixed;
        bottom: 40px; /* Added margin for the footer */
        left: 0;
        background-color: #007BFF;
        flex-direction: row;
        justify-content: space-around;
        padding: 10px;
        box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1);
    }

    #panel button, #panel div {
        width: auto;
        background-color: white;
        color: #007BFF;
        border-radius: 50px;
        flex-grow: 1;
        margin: 0 5px;
    }

    #fileNamePlaceholder {
        display: none;
    }

    #viewerContainer {
        width: 100%;
        height: calc(100vh - 60px - 40px); /* Adjust for header and footer */
    }

    model-viewer, #webglViewer {
        width: 100%;
        height: 100%;
    }
}

@media (max-width: 400px) {
    #panel button, #panel div {
        padding: 5px 10px;
        font-size: 14px;
    }
}

/* Additional styles for new buttons */
#modelViewerTab, #threeJsViewerTab {
    margin-bottom: 10px;
}

