:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --background-color: #f8fafc;
    --card-background: #ffffff;
    --text-color: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --border-subtle: #f1f5f9;
    --button-text: #ffffff;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.dark-mode {
    --primary-color: #60a5fa;
    --primary-hover: #93c5fd;
    --success-color: #34d399;
    --danger-color: #f87171;
    --background-color: #0f172a;
    --card-background: #1e293b;
    --text-color: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --border-subtle: #1e293b;
    --button-text: #1e293b;
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.1);
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    margin: 0;
    display: flex;
    justify-content: center;
    padding: 2rem 1rem;
    line-height: 1.5;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    background-color: var(--card-background);
    padding: 2.5rem;
    border-radius: 1rem;
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 600px;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

h1 {
    font-size: 1.875rem;
    font-weight: 700;
    margin-bottom: 2rem;
    text-align: center;
    color: var(--text-color);
}

h2, h3 {
    font-weight: 600;
    color: var(--text-color);
}

.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-muted);
}

input[type="number"] {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: border-color 0.2s, ring 0.2s;
}

input[type="number"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

button {
    width: 100%;
    padding: 0.875rem 1.5rem;
    background-color: var(--primary-color);
    color: var(--button-text);
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: background-color 0.2s, transform 0.1s, box-shadow 0.2s;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

button:hover {
    background-color: var(--primary-hover);
}

button:active {
    transform: scale(0.98);
}

.budget-list li:hover {
    background-color: var(--background-color);
}

.results {
    margin-top: 3rem;
    border-top: 1px solid var(--border-color);
    padding-top: 2rem;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.result-item span:first-child {
    color: var(--text-muted);
}

.result-item strong {
    font-size: 1.125rem;
}

.results hr {
    border: 0;
    border-top: 1px solid var(--border-color);
    margin: 1.5rem 0;
}

.results h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

/* Specific colors for results */
.net-salary {
    color: var(--success-color);
}

.total-to-state {
    color: var(--danger-color);
}

.chart-container {
    width: 100%;
    margin: 2.5rem 0;
    max-width: 450px;
    margin-left: auto;
    margin-right: auto;
}

.budget-list {
    list-style: none;
    padding: 0;
    margin-top: 1.5rem;
}

.budget-list li {
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 0.25rem;
    transition: background-color 0.2s;
}

.budget-list li span {
    margin-right: 1.5rem;
}

.budget-list li strong {
    color: var(--primary-color);
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

.theme-toggle {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: auto;
    padding: 0.5rem 0.75rem;
    background: var(--card-background);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s, color 0.2s;
    z-index: 100;
}

.theme-toggle:hover {
    background-color: var(--background-color);
}
