/* General Body & Container Styles */
body {
    font-family: 'Lato', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f4f7f6;
    margin: 0;
    padding: 20px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

h1 {
    text-align: center;
    color: #2c3e50;
}

/* Form Specific Styles */
.calculator-form {
    display: grid;
    grid-template-columns: 1fr; /* Default to single column for mobile */
    gap: 1.5rem;
}

/* Use two columns on larger screens */
@media (min-width: 768px) {
    .calculator-form {
        grid-template-columns: 1fr 1fr;
    }
}

.form-section {
    border: 1px solid #dfe6e9;
    padding: 1rem 1.5rem;
    border-radius: 8px;
}

.form-section legend {
    font-weight: bold;
    font-size: 1.2rem;
    padding: 0 0.5rem;
    color: #2d3436;
}

.full-width {
    grid-column: 1 / -1;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #636e72;
}

.form-group input[type="number"],
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #b2bec3;
    border-radius: 5px;
    font-size: 1rem;
    box-sizing: border-box; /* Important for padding */
}

.form-group input[type="checkbox"] {
    margin-right: 0.5rem;
}

button[type="submit"] {
    width: 100%;
    padding: 1rem;
    font-size: 1.2rem;
    font-weight: bold;
    color: #fff;
    background-color: #2A7DE1;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

button[type="submit"]:hover {
    background-color: #216ac4;
}

/* Results Table Styles */
#results-summary {
    margin-top: 2rem;
}

.results-table {
    width: 100%;
    margin-top: 1rem;
    border-collapse: collapse;
}

.results-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #eee;
}

.results-table td:last-child {
    text-align: right;
    font-weight: bold;
    font-family: monospace, sans-serif;
    font-size: 1.1rem;
}

.net-pay-row td {
    font-size: 1.3rem;
    font-weight: bold;
    color: #27ae60;
    border-top: 2px solid #333;
    border-bottom: none;
}

/* AI Feature Styles */
#analyze-paycheck-btn {
    padding: 0.8rem 1.5rem;
    font-size: 1.1rem;
    font-weight: bold;
    color: #fff;
    background-color: #8e44ad;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#analyze-paycheck-btn:hover {
    background-color: #732d91;
}

#ai-analysis-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background-color: #f4f0f8;
    border: 1px solid #d8c2e8;
    border-radius: 8px;
}

#ai-analysis-section h3 {
    margin-top: 0;
    color: #8e44ad;
}

.loader {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #8e44ad;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 1rem auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
