/* --- Basic Reset & Font --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    background-color: #f4f7f6; /* Light grey background */
    color: #333;
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Align container to the top */
    min-height: 100vh;
    padding: 20px; /* Padding around the container */
}

/* --- Container --- */
.container {
    background-color: #ffffff; /* White card */
    padding: 30px 40px;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    max-width: 600px;
    width: 100%;
    margin-top: 30px; /* Space from top */
    margin-bottom: 30px; /* Space from bottom */
}

/* --- Header --- */
header {
    text-align: center;
    margin-bottom: 30px;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 20px;
}

header h1 {
    color: #2c3e50; /* Dark blue */
    margin-bottom: 8px;
    font-weight: 700;
}

header p {
    color: #555;
    font-size: 0.95rem;
}

/* --- Form Styling --- */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #444;
}

.form-group input[type="number"] {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input[type="number"]:focus {
    border-color: #3498db; /* Blue focus */
    outline: none;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

/* --- Button Styling --- */
button[type="submit"] {
    display: block;
    width: 100%;
    padding: 12px 20px;
    background-color: #3498db; /* Blue button */
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.1s ease;
    margin-top: 10px; /* Space above button */
}

button[type="submit"]:hover {
    background-color: #2980b9; /* Darker blue */
}

button[type="submit"]:active {
    transform: scale(0.98);
}

button[type="submit"]:disabled {
    background-color: #bdc3c7; /* Grey disabled */
    cursor: not-allowed;
}

/* --- Result Area --- */
#result-area {
    margin-top: 30px;
    padding: 20px;
    background-color: #ecf0f1; /* Light grey background for result */
    border-radius: 8px;
    border: 1px solid #dcdcdc;
}

#result-area h2 {
    margin-bottom: 15px;
    color: #2c3e50;
    font-weight: 500;
    text-align: center;
}

/* --- Table Styling --- */
#results-table {
    width: 100%;
    border-collapse: collapse; /* Removes gaps between cells */
    margin-bottom: 15px;
}

#results-table tbody tr {
    border-bottom: 1px solid #dcdcdc; /* Light line between rows */
}

#results-table tbody tr:last-child {
    border-bottom: none; /* No line after the last row */
}

#results-table td {
    padding: 10px 8px;
    vertical-align: middle; /* Align text vertically centered */
}

#results-table td:first-child {
    /* Title column */
    width: 65%; /* Adjust as needed */
    font-weight: 500;
    color: #333;
    text-align: left; /* <<< ALIGNMENT: Left for titles */
}

#results-table td:last-child {
    /* Value column */
    width: 35%; /* Adjust as needed */
    font-weight: 700;
    color: #2c3e50;
    text-align: right; /* <<< ALIGNMENT: Right for values */
}

/* Optional: Styling for specific rows (add classes via JS if needed) */
#results-table tr.net-salary-row td {
     font-weight: bold;
     color: #27ae60; /* Green color for net salary value */
}
#results-table tr.net-salary-row td:first-child {
     font-weight: bold;
     color: #333; /* Reset title color if needed */
}

#results-table tr.total-row td {
     font-weight: bold;
     border-top: 2px solid #bdc3c7; /* Separator line above total */
     padding-top: 12px; /* Extra space for total row */
}


/* Placeholder row styling */
#results-table td[colspan="2"] {
    text-align: center;
    font-style: italic;
    color: #777;
    width: 100%;
}

/* --- Styling for the Tax Work Analogy Paragraph --- */
#tax-work-analogy {
    background-color: #e4eaf1; /* A light blue-grey background */
    border: 1px solid #c8d0d8; /* A slightly darker border */
    border-left: 5px solid #3498db; /* Accent border on the left (theme color) */
    border-radius: 6px;        /* Soften corners */
    padding: 12px 18px;       /* Add comfortable padding */
    margin: 25px 0 20px 0;   /* Add vertical spacing (top/bottom) */

    font-size: 0.95rem;       /* Increase font size slightly */
    font-weight: 500;         /* Medium font weight for emphasis */
    color: #2c3e50;           /* Dark blue text for better contrast */
    text-align: center;       /* Keep text centered */
    font-style: normal;       /* Remove italic style inherited from .details potentially */
    line-height: 1.5;         /* Improve readability for potentially longer text */

    /* Optional: Subtle shadow for depth */
    /* box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05); */
}

/* --- Ensure .details doesn't conflict too much --- */
/* (The ID selector above is specific enough, but this clarifies base style) */
.details {
    font-size: 0.85rem;
    color: #666;
    margin-top: 10px;
    text-align: center;
}

#error-message {
    color: #e74c3c; /* Red for errors */
    font-weight: 500;
    margin-top: 15px;
    min-height: 1.2em; /* Reserve space */
    text-align: center;
}


/* --- Footer --- */
footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
    font-size: 0.8rem;
    color: #777;
}

/* --- Responsive Design --- */
@media (max-width: 768px) {
    .container {
        padding: 25px 30px;
        margin-top: 20px;
    }

    header h1 {
        font-size: 1.8rem;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    .container {
        padding: 20px;
    }

    header h1 {
        font-size: 1.6rem;
    }

    .form-group input[type="number"] {
        padding: 10px 12px;
    }

    button[type="submit"] {
        padding: 10px 15px;
        font-size: 1rem;
    }

    /* Responsive table adjustments */
     #results-table td {
        padding: 8px 5px; /* Adjust padding */
     }
     #results-table td:first-child {
        width: 60%;
        font-weight: normal; /* Maybe reduce boldness on small screens */
     }
     #results-table td:last-child {
        width: 40%;
        font-weight: 600;
     }
}