/* Basic Reset */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f2f2f2;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    height: 100vh;
    padding: 20px;
}

/* Main container layout - Stack forms vertically */
.main-container {
    display: flex;
    flex-direction: column; /* Stack elements vertically */
    gap: 20px;
    width: 100%;
    max-width: 1200px;
}

/* Style for each form container */
.container {
    width: 100%;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
    text-align: center;
}

/* Form and button styles */
h1 {
    font-size: 24px;
    margin-bottom: 20px;
    color: #333;
}

h2 {
    font-size: 20px;
    color: #333;
}

.input-section label {
    display: block;
    font-size: 16px;
    margin-top: 15px;
    color: #555;
}

input[type="number"] {
    width: 100%;
    padding: 8px;
    margin-top: 5px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 16px;
}

button {
    margin-top: 20px;
    padding: 10px;
    width: 100%;
    background-color: #28a745;
    color: white;
    font-size: 16px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

button:hover {
    background-color: #218838;
}

/* Result section */
.result-section {
    margin-top: 30px;
}

.result {
    font-weight: bold;
    color: #28a745;
}

/* Table Section */
.table-section {
    margin-top: 20px;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    text-align: center;
}

table, th, td {
    border: 1px solid #ddd;
}

th, td {
    padding: 10px;
}

th {
    background-color: #f0f0f0;
}

/* Error message styles */
.error-message {
    color: red;
    font-size: 0.9em;
    margin-top: 5px;
}

input.error {
    border-color: pink;
}

/* Responsive styles for smaller screens */
@media (max-width: 768px) {
    .main-container {
        flex-direction: column; /* Ensure forms stack vertically */
        align-items: center;
    }

    .container {
        width: 100%;
        margin-bottom: 20px;
    }
}
