/* Font Families */
body {
    font-family: 'Merriweather', 'Playfair Display', serif;
    margin: 20px;
}

h1 {
    font-size: 22px; /* Adjusts the heading size */
    color: #0d7dd4;
    margin-bottom: 20px;
    letter-spacing: 0; /* Removes gaps between letters */
}

h2 {
    color: #0d7dd4;
    margin-bottom: 20px;
}

div {
    margin-bottom: 15px;
}

label, input, select, button {
    display: block;
    margin-bottom: 10px;
    width: 100%;
    max-width: 300px;
}

label {
    color: #000000;
}

input#loanAmount, input#loanTermYears, input#loanTermMonths, input#interestRate {
    border: 1px solid #0d7dd4;
    border-radius: 50px;
}

/* Dropdown menu styles and animation */
select {
    padding: 14px;
    font-size: 14px;
    border: 1px solid #0d7dd4;
    box-shadow: none;
    border-radius: 50px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background-color: white;
}

select:focus {
    border-color: #0d7dd4;
    outline: none;
    box-shadow: 0px 4px 15px rgba(0, 0, 0, 0.2);
}

select option {
    background-color: #ffffff;
    color: black;
}

select option {
    animation: dropdownOpen 0.3s ease-in-out;
}

@keyframes dropdownOpen {
    from {
        transform: translateY(-10px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Flexbox for compound and payback frequency fields */
.flex-container {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.flex-item {
    width: 48%;
}

/* Add hover and active animations for the buttons */
button {
    cursor: pointer;
    background-color: #0d7dd4;
    color: white;
    border: 1px solid #0d7dd4;
}

button:hover {
    background-color: #0a65a8;
    transform: scale(1.05);
    box-shadow: 0px 4px 15px rgba(0, 0, 0, 0.2);
}

button:active {
    transform: scale(0.95);
}

button:focus, button:focus-visible {
    background-color: #0d7dd4;
    color: white;
    border: 1px solid #0d7dd4;
    outline: none;
}

input:focus, select:focus, button:focus {
    border-color: #0d7dd4;
    outline: none;
}

input:hover, select:hover {
    border-color: #0d7dd4;
}

select option:hover, select option:focus {
    background-color: #0d7dd4;
    color: white;
}

/* Result section design and animation */
#results {
    margin-top: 20px;
    padding: 20px;
    border-radius: 15px;
    background-color: #f0fdf9;
    border: 2px solid #0d7dd4;
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out;
    box-shadow: 0px 4px 15px rgba(0, 0, 0, 0.1);
}

#results.show {
    opacity: 1;
    transform: scale(1);
}

#results h2 {
    margin-bottom: 15px;
}

#results p {
    margin: 5px 0;
    color: #333;
}

.input-group {
    margin-bottom: 15px;
}

.term-container {
    display: flex;
    gap: 10px;
}

.button-group {
    display: flex;
    justify-content: space-between;
}

.button-group button {
    width: 48%;
}
