/* General body styling */
body {
    margin: 0;
    padding: 0;
    font-family: 'Kanit', sans-serif;
    background-color: #ffffff;
    color: #333333;
    box-sizing: border-box; /* Ensures padding and borders are included in the element's dimensions */
}

h1 {
    font-size: 3em; /* Adjusted font size for better scalability */
    padding: 10px;
    text-align: center;
}

/* Calculator layout */
#calculator {
    padding: 20px; /* Increased padding for better spacing */
    margin: 0 auto;
    max-width: 100%; /* Set to full width */
    width: 100%;
    box-sizing: border-box; /* Prevents padding from increasing element size */
}

/* Styling for the confirmation popup */
.confirmation-popup {
    text-align: center;
    max-width: 400px; /* Set a maximum width for the popup */
    padding: 20px;
    background-color: #ffffff; /* White background for the popup */
    border-radius: 10px; /* Rounded corners */
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1); /* Subtle shadow for better visibility */
    margin: 50px auto; /* Center the popup horizontally */
}

/.checkmark {
    font-size: 100px;
    color: #00c853; /* Green color for success */
    margin: 20px 0;
}

.message {
    font-size: 24px;
    color: #333333;
    margin-top: 20px;
}

/* Button for returning to the homepage */
.back-button {
    display: inline-block;
    padding: 15px 30px;
    font-size: 16px;
    background-color: #FF401A; /* Primary orange color */
    color: #ffffff;
    border: none;
    border-radius: 10px; /* Rounded corners */
    cursor: pointer;
    margin-top: 20px;
    text-decoration: none;
    transition: background-color 0.3s, transform 0.3s;
}

.back-button:hover {
    background-color: #ff3300; /* Slightly darker orange on hover */
    transform: scale(1.05);
}

/* Category and subcategory styles */
.category {
    padding: 15px; /* Increased padding for more breathing room */
    font-size: 1.5em;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #ffffff;
    color: #333333;
    font-weight: bold;
    border-bottom: 1px solid #cccccc;
    transition: color 0.3s;
    position: relative;
}

.category:hover {
    color: #FF401A;
}

.category.selected span.category-title {
    color: #FF401A;
}

.category .toggle-icon {
    font-size: 24px;
    margin-left: 10px;
}

.subcategory {
    display: none;
    padding: 10px 15px; /* Added padding for better readability */
    margin: 5px 0;
    color: #333333;
    font-size: 16px;
    transition: max-height 0.5s ease-out;
    overflow: hidden;
}

.subcategory .form-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 10px 0;
    transition: background-color 0.3s, color 0.3s;
}

.subcategory .form-row:nth-child(even) {
    background-color: #f9f9f9;
}

.subcategory .form-row:hover {
    background-color: #FF401A;
    color: #ffffff;
}

.subcategory label {
    flex: 1;
    color: #333333;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 1;
}

.subcategory input[type="number"] {
    width: 100px; /* Increased width for larger screens */
    padding: 5px;
    border: 1px solid #cccccc;
    text-align: right;
    transition: border-color 0.3s;
}

.subcategory input[type="number"]:focus {
    border-color: #0073aa;
}

/* Responsive adjustments for small screens */
@media screen and (max-width: 600px) {
    .subcategory input[type="number"] {
        width: 60px;
        font-size: 14px;
        padding: 5px;
    }

    h1 {
        font-size: 2rem;
    }
}

input[type="button"], button {
    display: block;
    width: 200px; /* Restored original size */
    padding: 10px; /* Adjusted padding */
    background-color: #000000;
    color: #ffffff;
    border: none;
    cursor: pointer;
    margin-top: 20px;
    margin-left: auto;
    margin-right: auto;
    border-radius: 10px; /* Rounded corners */
    transition: background-color 0.3s, transform 0.3s;
}

input[type="button"]:hover, button:hover {
    background-color: #FF401A;
    transform: scale(1.05);
}

.submit-button {
    background-color: #FF401A;
    border-radius: 10px; /* Rounded corners */
}

.submit-button.active {
    background-color: #00FF00;
}

#total-cost {
    font-weight: bold;
    font-size: 1.2em;
    color: #ff3300;
    text-align: center;
    margin-top: 20px;
}

.results {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.results table {
    border-collapse: collapse;
    width: 100%;
    max-width: 1200px;
}

.results th, .results td {
    border: 1px solid #cccccc;
    padding: 10px;
}

.results th {
    background-color: #f0f0f0;
    font-weight: bold;
    text-align: left;
}

.results td {
    text-align: center;
}

.results td:first-child {
    text-align: left;
}

#reset-button, #contact-form {
    display: none;
}

#contact-form input {
    width: calc(100% - 22px);
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #cccccc;
}

.hidden {
    display: none;
}

.visible {
    display: block;
}
