/* Apply global styles */
body {
    font-family: 'Nunito', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f4f9;
    color: #333;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Grid container */
.grid-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 20px;
    padding: 20px;
    max-width: 1200px;
    margin: auto;
    box-sizing: border-box;
}

/* Form container */
.grid-item {
    background: #ffffff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
}

/* Form styling */
form {
    display: flex;
    flex-direction: column;
}

label {
    margin: 10px 0 5px 0;
    font-weight: bold;
}

input[type="range"] {
    width: 100%;
}

output {
    font-weight: bold;
    margin-left: 10px;
}

input[type="number"],
input[type="submit"] {
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #ccc;
    margin-bottom: 10px;
    font-size: 16px;
    box-sizing: border-box;
}

input[type="submit"] {
    background-color: #007bff;
    color: #fff;
    cursor: pointer;
    transition: background-color 0.3s ease;
    border: none;
}

input[type="submit"]:hover {
    background-color: #0056b3;
}

/* 3D Viewer and Results */
#3d-viewer,
#results {
    background-color: #e9ecef;
    border-radius: 8px;
    padding: 20px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
}

#3d-viewer {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .grid-container {
        grid-template-columns: 1fr;
    }

    #3d-viewer {
        height: 300px;
    }

    input[type="number"],
    input[type="submit"] {
        font-size: 14px;
    }
}

@media (max-width: 768px) {
    .grid-container {
        padding: 10px;
    }

    .grid-item {
        padding: 15px;
    }

    #3d-viewer {
        height: 250px;
    }
}

@media (max-width: 480px) {
    .grid-container {
        padding: 5px;
    }

    .grid-item {
        padding: 10px;
    }

    #3d-viewer {
        height: 200px;
    }

    input[type="number"],
    input[type="submit"] {
        font-size: 12px;
    }
}

/* Ensuring Cross-Browser Compatibility */
input,
button,
textarea {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    font-family: inherit;
}

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    background-color: #007bff;
}

input[type="range"]::-webkit-slider-runnable-track {
    background: #ccc;
    height: 5px;
    border-radius: 3px;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 15px;
    height: 15px;
    background: #007bff;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

input[type="range"]::-moz-range-track {
    background: #ccc;
    height: 5px;
    border-radius: 3px;
}

input[type="range"]::-moz-range-thumb {
    width: 15px;
    height: 15px;
    background: #007bff;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

input[type="range"]::-ms-track {
    background: transparent;
    border-color: transparent;
    border-width: 5px 0;
    color: transparent;
}

input[type="range"]::-ms-fill-lower {
    background: #ccc;
    border-radius: 3px;
}

input[type="range"]::-ms-fill-upper {
    background: #ccc;
    border-radius: 3px;
}

input[type="range"]::-ms-thumb {
    width: 15px;
    height: 15px;
    background: #007bff;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

input[type="range"]:focus {
    outline: none;
}

/* Smooth transitions */
* {
    transition: all 0.3s ease;
}