body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f4;
    margin: 0;
    padding: 20px;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

h1 {
    text-align: center;
    color: #333;
    font-size: 24px;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #555;
    font-size: 14px;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 8px;
    box-sizing: border-box;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

.form-group button {
    width: 100%;
    padding: 10px;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

.form-group button:hover {
    background-color: #218838;
}

.results {
    margin-top: 20px;
}

.results div {
    margin-bottom: 10px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    font-size: 14px;
}

.results div span {
    font-weight: bold;
}

.term-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
}

.term-buttons button {
    padding: 8px 12px;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.input-group {
    display: flex;
    align-items: center;
}

.input-group input {
    flex: 0 0 auto;
    width: 60px;
    margin-right: 5px;
}

.input-group select {
    flex: 1 1 auto;
    width: auto;
}

/* New styles for the term input group */
.form-group .input-group {
    width: 100%;
}

.form-group .input-group input {
    width: 60px;
}

.form-group .input-group select {
    width: calc(100% - 65px);
    padding: 4px;
}

#addTermBtn {
    background-color: #007bff;
}

#addTermBtn:hover {
    background-color: #0056b3;
}

#removeTermBtn {
    background-color: #dc3545;
}

#removeTermBtn:hover {
    background-color: #c82333;
}

#removeTermBtn:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    font-size: 14px;
}

table, th, td {
    border: 1px solid #ccc;
}

th, td {
    padding: 8px;
    text-align: center;
}

th {
    background-color: #f2f2f2;
}

input[type="number"] {
    width: 100%;
    padding: 4px;
    box-sizing: border-box;
    font-size: 14px;
}

.narrow-input {
    width: 60px;
}

.medium-input {
    width: 80px;
}

.wide-input {
    width: 100px;
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.form-row .form-group {
    flex: 1;
    min-width: 200px;
    margin-bottom: 0;
}

#calculateBtn {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 16px;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
    margin-top: 20px;
}

#calculateBtn:hover {
    background-color: #218838;
}

.clear-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 10px 20px;
    background-color: #f44336;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.clear-btn:hover {
    background-color: #d32f2f;
}

/* Add this to your existing CSS file */
.form-row .form-group:last-child {
    flex-basis: 100%;
}

@media (min-width: 768px) {
    .form-row .form-group:last-child {
        flex-basis: auto;
    }
}