* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #020402 0%, #0d2818 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #020402 0%, #0d2818 100%);
    color: white;
    padding: 40px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 700;
}

.subtitle {
    font-size: 1.1em;
    opacity: 0.9;
}

main {
    padding: 40px;
}

.input-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 30px;
    border: 2px solid #e9ecef;
}

.input-section h2 {
    color: #020402;
    margin-bottom: 25px;
    font-size: 1.8em;
    border-bottom: 3px solid #52c878;
    padding-bottom: 10px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #495057;
    font-size: 1em;
}

.form-group input[type="number"],
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    font-size: 1em;
    transition: all 0.3s ease;
    background: white;
}

.form-group input[type="number"]:focus,
.form-group select:focus {
    outline: none;
    border-color: #52c878;
    box-shadow: 0 0 0 3px rgba(82, 200, 120, 0.2);
}

.radio-group {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: normal;
}

.radio-label input[type="radio"] {
    width: auto;
    cursor: pointer;
}

.help-text {
    display: block;
    margin-top: 5px;
    font-size: 0.85em;
    color: #6c757d;
    font-style: italic;
}

.output-section {
    background: #ffffff;
    border-radius: 8px;
    padding: 30px;
    border: 2px solid #52c878;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.output-section h2 {
    color: #020402;
    margin-bottom: 25px;
    font-size: 1.8em;
    border-bottom: 3px solid #52c878;
    padding-bottom: 10px;
}

.recommendations {
    background: linear-gradient(135deg, #020402 0%, #0d2818 100%);
    color: white;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 25px;
    font-size: 1.2em;
    line-height: 1.8;
    min-height: 80px;
}

.recommendations .placeholder {
    opacity: 0.7;
    font-style: italic;
}

.tax-savings-display {
    text-align: right;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid rgba(255, 255, 255, 0.3);
}

.recommendations .recommendation-item {
    margin: 8px 0;
    font-weight: 500;
}

.recommendations .recommendation-item strong {
    font-size: 1.3em;
    color: #ffd700;
}

.tax-rate {
    background: #f0f9f2;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    border-left: 5px solid #52c878;
}

.tax-rate .placeholder {
    color: #6c757d;
    font-style: italic;
}

.tax-rate h3 {
    color: #495057;
    margin-bottom: 10px;
    font-size: 1.1em;
}

.tax-rate .rate-value {
    font-size: 2em;
    font-weight: 700;
    color: #020402;
}

.input-summary {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #e9ecef;
}

.input-summary h3 {
    color: #495057;
    margin-bottom: 20px;
    font-size: 1.3em;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.summary-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    transition: all 0.3s ease;
}

.summary-item:hover {
    border-color: #52c878;
    box-shadow: 0 2px 4px rgba(82, 200, 120, 0.2);
}

.summary-item label {
    display: block;
    font-size: 0.9em;
    color: #6c757d;
    margin-bottom: 5px;
    font-weight: 600;
}

.summary-item input {
    width: 100%;
    padding: 8px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 1em;
    background: white;
}

.summary-item input:focus {
    outline: none;
    border-color: #52c878;
    box-shadow: 0 0 0 2px rgba(82, 200, 120, 0.2);
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    header {
        padding: 25px 20px;
    }

    header h1 {
        font-size: 2em;
    }

    main {
        padding: 20px;
    }

    .input-section,
    .output-section {
        padding: 20px;
    }

    .summary-grid {
        grid-template-columns: 1fr;
    }

    .radio-group {
        flex-direction: column;
        gap: 10px;
    }

    .pie-chart-container {
        flex-direction: column;
        align-items: center;
    }

    .pie-chart-legend {
        width: 100%;
        max-width: 300px;
    }
}

/* Tax Breakdown Section */
.tax-breakdown {
    margin-top: 30px;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.tax-breakdown h3 {
    color: #495057;
    margin-bottom: 20px;
    font-size: 1.3em;
}

.pie-chart-container {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: center;
    gap: 30px;
    margin-bottom: 25px;
}

.pie-chart-legend {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 200px;
    padding: 10px;
}

.pie-chart-legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95em;
}

.pie-chart-legend-color {
    width: 20px;
    height: 20px;
    border-radius: 3px;
    border: 1px solid #ddd;
    flex-shrink: 0;
}

.pie-chart-legend-label {
    color: #495057;
    font-weight: 500;
}

.pie-chart-legend-percentage {
    color: #6c757d;
    font-size: 0.9em;
    margin-left: auto;
}

.breakdown-text {
    display: grid;
    gap: 12px;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: white;
    border-radius: 6px;
    border-left: 4px solid #52c878;
}

.breakdown-item.total {
    border-left-color: #f39c12;
    font-weight: 600;
    margin-top: 10px;
}

.breakdown-item.net {
    border-left-color: #52c878;
    font-weight: 600;
    margin-top: 5px;
}

.breakdown-item.savings {
    border-left-color: #52c878;
    background: #e8f5e9;
}

.breakdown-item.net-savings {
    border-left-color: #52c878;
    background: #e8f5e9;
    font-weight: 600;
    margin-top: 5px;
    border-width: 5px;
}

.breakdown-values {
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: right;
}

.breakdown-values .amount {
    font-weight: 600;
    min-width: 100px;
    text-align: right;
}

.breakdown-values .percentage {
    color: #6c757d;
    font-size: 0.9em;
    min-width: 70px;
    text-align: right;
}

/* Loading/Updating state */
.updating {
    opacity: 0.6;
    pointer-events: none;
}

.updating::after {
    content: ' (updating...)';
    font-size: 0.8em;
    color: #52c878;
}

