body, html {
    margin: 0;
    padding: 0;
    font-family: 'Arial', sans-serif;
    background-color: #f4f4f9;
    transition: background-color 0.3s, color 0.3s; /* Smooth transition for color and background changes */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 960px;
    margin: 20px auto;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
    transition: background-color 0.3s, box-shadow 0.3s;
    width: calc(100% - 40px); /* Subtract padding from width */
    box-sizing: border-box; /* Include padding and border in the width calculation */
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 10px;
    transition: color 0.3s; /* Transition effect for color change */
}

.tagline {
    text-align: center;
    color: #666;
    font-size: 1.1em;
    margin-bottom: 20px;
    font-weight: 300;
    transition: color 0.3s;
}

h2 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.3em;
    transition: color 0.3s;
}

.content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    box-sizing: border-box; /* Include padding and borders in width calculation */
}

.input-section, .output-section {
    flex: 0 1 48%; /* Take up less than half the parent width, adjusting with flexibility */
    box-sizing: border-box; /* Include padding and borders in the width calculation */
}

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

label {
    display: block;
    margin-bottom: 5px;
    color: #666;
    transition: color 0.3s; /* Transition effect for color change */
}

input[type="text"], input[type="number"], select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box; /* Padding and border included in width */
    transition: background-color 0.3s, color 0.3s, border-color 0.3s; /* Transition effects for various properties */
}

input[type="text"]:focus, input[type="number"]:focus, select:focus {
    border-color: #0056b3;
    outline: none;
}

button.calculate-btn {
    width: 100%;
    padding: 12px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s; /* Smooth transition for background color change */
}

button.calculate-btn:hover {
    background-color: #0056b3;
}

.results {
    margin-top: 20px;
}

#outputResults p {
    background-color: #e9ecef;
    padding: 10px;
    border-left: 5px solid #007bff;
    margin-top: 10px;
    transition: background-color 0.3s, border-left 0.3s; /* Transition effects for background and border */
}

.footer {
    background-color: #fff;
    padding: 40px 20px 20px;
    box-shadow: 0 -2px 15px rgba(0,0,0,0.1);
    transition: background-color 0.3s, color 0.3s;
    width: 100%;
    box-sizing: border-box;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    gap: 30px;
}

.footer-section {
    flex: 1;
    min-width: 250px;
}

.footer-section h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.1em;
    transition: color 0.3s;
}

.footer-section p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 10px;
    transition: color 0.3s;
}

.footer-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-section ul li {
    color: #666;
    margin-bottom: 8px;
    transition: color 0.3s;
}

.footer-bottom {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.footer-bottom p {
    color: #666;
    margin: 0;
    transition: color 0.3s;
}

.footer a {
    color: #007bff;
    text-decoration: none;
    transition: text-decoration 0.3s;
}

.footer a:hover {
    text-decoration: underline;
}

/* Dark mode styles */
.dark-mode-toggle {
    position: fixed;
    top: 10px;
    right: 10px;
}

.dark-mode-toggle input {
    display: none;
}

.dark-mode-label {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    cursor: pointer;
    background-color: #ccc;
    border-radius: 20px;
    width: 60px;
    height: 30px;
    transition: background-color 0.3s; /* Transition effect for background color change */
}

.dark-mode-label::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 3px;
    width: 24px;
    height: 24px;
    background-color: #fff;
    border-radius: 50%;
    transition: transform 0.3s, top 0.3s, background-color 0.3s; /* Transition effects for position and background */
    transform: translateY(-50%);
}

#darkModeSwitch:checked + .dark-mode-label::before {
    transform: translate(30px, -50%);
    background-color: #333;
}

body.dark-mode {
    background-color: #333;
    color: #fff;
}

body.dark-mode .container {
    background-color: #444;
    box-shadow: 0 2px 15px rgba(0,0,0,0.5);
}

body.dark-mode input[type="text"], 
body.dark-mode input[type="number"], 
body.dark-mode select {
    background-color: #555;
    color: #fff;
    border: 1px solid #888;
}

body.dark-mode input[type="text"]:focus, 
body.dark-mode input[type="number"]:focus, 
body.dark-mode select:focus {
    border-color: #bbb;
}

body.dark-mode button.calculate-btn {
    background-color: #0066cc;
}

body.dark-mode button.calculate-btn:hover {
    background-color: #004c99;
}

body.dark-mode #outputResults p {
    background-color: #555;
    border-left: 5px solid #0066cc;
}

body.dark-mode h1,
body.dark-mode h2,
body.dark-mode label {
    color: #fff;
}

body.dark-mode .tagline {
    color: #ccc;
}

body.dark-mode .footer {
    background-color: #444;
    color: #fff;
}

body.dark-mode .footer-section h3 {
    color: #fff;
}

body.dark-mode .footer-section p,
body.dark-mode .footer-section ul li,
body.dark-mode .footer-bottom p {
    color: #ccc;
}

body.dark-mode .footer-bottom {
    border-top-color: #555;
}

/* Responsive design for mobile and desktop */
@media (max-width: 480px) {
    .container {
        margin: 5px auto; /* Adjust margin to 5px top and bottom, auto on left and right for centering */
        padding: 10px; /* Reduced padding */
        max-width: calc(100% - 10px); /* Full width minus the padding for smaller screens */
        width: auto; /* Auto width to accommodate smaller device widths */
        box-sizing: border-box; /* Ensures padding is included in the width */
    }

      select {
        font-size: 18px; /* Even larger font size on small screens */
        padding: 15px; /* Slightly more padding to make each option easier to select */
    }
  
    .content {
        flex-direction: column;
    }

    .input-section, .output-section {
        flex: 1 1 100%; /* Each section takes full width on smaller screens */
        margin: 0; /* Adjust margin as needed for mobile */
        margin-bottom: 10px; /* Added space between sections */
    }

    input[type="text"], input[type="number"], select {
        padding: 8px; /* Slightly smaller padding */
    }
    
    .footer-content {
        flex-direction: column;
        gap: 20px;
    }
    
    .footer-section {
        min-width: auto;
        text-align: center;
    }
}
