* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #3b82f6;
    --primary-dark: #2563eb;
    --secondary-color: #8b5cf6;
    --success-color: #10b981;
    --success-dark: #059669;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --warning-dark: #d97706;
    --light-bg: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background: #f5f7fa;
    color: var(--text-primary);
    line-height: 1.6;
    padding: 20px;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

header {
    background: #2563eb;
    color: white;
    padding: 40px 40px;
    text-align: center;
}

header h1 {
    font-size: 2.2rem;
    margin-bottom: 10px;
    font-weight: 600;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 400;
}

.info-banner {
    background: #f59e0b;
    color: white;
    padding: 25px 40px;
    margin: 0;
}

.info-banner h3 {
    margin-bottom: 15px;
    font-size: 1.3rem;
    font-weight: 600;
}

.tax-brackets {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 10px;
}

.tax-brackets li {
    background: rgba(255, 255, 255, 0.2);
    padding: 10px 15px;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bracket {
    font-weight: 500;
}

.rate {
    font-weight: 700;
    font-size: 1.2rem;
}

form {
    padding: 40px;
}

.form-section {
    background: #f9fafb;
    padding: 25px;
    margin-bottom: 20px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.form-section h2 {
    color: #1e293b;
    margin-bottom: 20px;
    font-size: 1.4rem;
    font-weight: 600;
    padding-bottom: 12px;
    border-bottom: 2px solid #e5e7eb;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
}

.form-group input[type="number"],
.form-group input[type="text"],
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
    background: white;
}

.form-group input[type="number"]:focus,
.form-group input[type="text"]:focus,
.form-group select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group input[type="checkbox"] {
    width: 22px;
    height: 22px;
    margin-right: 12px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.suggestion-box {
    background: #fef3c7;
    border-left: 3px solid var(--warning-color);
    padding: 12px;
    margin-top: 10px;
    border-radius: 6px;
    font-size: 0.9rem;
}

.suggestion-box strong {
    color: var(--warning-color);
    display: block;
    margin-bottom: 8px;
}

.suggestion-box span {
    display: block;
    margin: 8px 0;
    color: var(--text-primary);
}

.use-suggestion-btn {
    background: var(--success-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
    transition: background 0.2s ease;
    font-size: 0.875rem;
}

.use-suggestion-btn:hover {
    background: var(--success-dark);
}

.use-suggestion-btn:active {
    background: #047857;
}


.info-box {
    background: #dbeafe;
    border-left: 4px solid var(--primary-color);
    padding: 15px;
    margin-top: 15px;
    border-radius: 8px;
}

.info-box h4 {
    margin-bottom: 10px;
    color: var(--primary-color);
}

.info-box ul {
    margin-left: 20px;
    margin-bottom: 10px;
}

.income-criteria {
    font-weight: 600;
    color: var(--warning-color);
    margin-top: 10px;
}

.calculate-btn {
    width: 100%;
    padding: 14px;
    background: #059669;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.calculate-btn:hover {
    background: #047857;
}

.calculate-btn:active {
    background: #065f46;
}

.results {
    padding: 30px;
    background: var(--light-bg);
    border-top: 4px solid var(--success-color);
}

.results h2 {
    color: var(--primary-color);
    margin-bottom: 25px;
    font-size: 2rem;
    text-align: center;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.result-card {
    background: white;
    padding: 20px;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border-left: 4px solid var(--primary-color);
    transition: box-shadow 0.2s ease;
}

.result-card:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.result-card.highlight {
    border-left-color: var(--warning-color);
    background: #fffbeb;
}

.result-card.success {
    border-left-color: var(--success-color);
}

.result-card.highlight-success {
    border-left-color: var(--success-color);
    background: #d1fae5;
}

.result-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.result-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.result-value.large {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--success-color);
}

.breakdown-section,
.deductions-section,
.eligibility-section {
    background: white;
    padding: 25px;
    border-radius: 12px;
    margin-top: 25px;
    box-shadow: var(--shadow);
}

.breakdown-section h3,
.deductions-section h3,
.eligibility-section h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 1.3rem;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
}

#detailedBreakdown table {
    width: 100%;
    border-collapse: collapse;
}

#detailedBreakdown th,
#detailedBreakdown td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

#detailedBreakdown th {
    background: var(--light-bg);
    font-weight: 600;
    color: var(--text-primary);
}

#detailedBreakdown tr:hover {
    background: var(--light-bg);
}

.deduction-item {
    padding: 12px;
    margin-bottom: 10px;
    background: var(--light-bg);
    border-radius: 8px;
    border-left: 3px solid var(--success-color);
}

.deduction-item strong {
    color: var(--success-color);
}

.eligibility-item {
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.eligibility-item.eligible {
    background: #d1fae5;
    border-left: 3px solid var(--success-color);
}

.eligibility-item.not-eligible {
    background: #fee2e2;
    border-left: 3px solid var(--danger-color);
}

.eligibility-item .icon {
    font-size: 1.5rem;
}

/* Explanation Section */
.explanation-section {
    padding: 30px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-top: 3px solid var(--primary-color);
}

.explanation-section h2 {
    color: var(--primary-color);
    margin-bottom: 30px;
    font-size: 1.8rem;
    text-align: center;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.step-card {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border-left: 4px solid var(--primary-color);
    position: relative;
    transition: box-shadow 0.2s ease;
}

.step-card:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.step-number {
    position: absolute;
    top: -1px;
    right: 20px;
    background: var(--primary-color);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.step-card h3 {
    color: var(--primary-color);
    margin-bottom: 12px;
    font-size: 1.2rem;
}

.step-card p {
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.step-card ul {
    list-style: none;
    margin-left: 0;
    color: var(--text-secondary);
}

.step-card ul li {
    margin-bottom: 8px;
    padding-left: 5px;
}

.example-box {
    background: var(--light-bg);
    padding: 15px;
    border-radius: 8px;
    margin-top: 12px;
    font-size: 0.9rem;
    border-left: 3px solid var(--success-color);
}

.important-note {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    border: 2px solid var(--warning-color);
}

.important-note h3 {
    color: var(--warning-color);
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.note-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.note-item {
    background: var(--light-bg);
    padding: 20px;
    border-radius: 8px;
}

.note-item strong {
    color: var(--primary-color);
    display: block;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.note-item p {
    color: var(--text-secondary);
    line-height: 1.6;
}

.note-item em {
    color: var(--text-primary);
    font-weight: 600;
    font-style: normal;
}

/* Calculation Flow Section */
.calculation-flow-section {
    background: white;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 25px;
    box-shadow: var(--shadow);
}

.calculation-flow-section h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 1.3rem;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
}

.flow-step {
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 8px;
    display: flex;
    align-items: flex-start;
    gap: 15px;
    border-left: 3px solid var(--border-color);
    background: var(--light-bg);
}

.flow-step.highlight {
    border-left-color: var(--success-color);
    background: #f0fdf4;
}

.flow-step-icon {
    width: 35px;
    height: 35px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

.flow-step.highlight .flow-step-icon {
    background: var(--success-color);
}

.flow-step-content {
    flex: 1;
}

.flow-step-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.flow-step-details {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.flow-step-amount {
    font-weight: 700;
    color: var(--success-color);
    font-size: 1.1rem;
    margin-top: 5px;
}

.flow-arrow {
    text-align: center;
    color: var(--primary-color);
    font-size: 1.5rem;
    margin: -10px 0;
}

/* Examples Section */
.examples-section {
    padding: 30px;
    background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
}

.examples-section h2 {
    color: var(--primary-color);
    margin-bottom: 30px;
    font-size: 1.8rem;
    text-align: center;
}

.example-card {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 25px;
    border-top: 4px solid #8b5cf6;
}

.example-card h3 {
    color: #8b5cf6;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.example-card h4 {
    color: var(--primary-color);
    margin: 15px 0 10px 0;
    font-size: 1.1rem;
}

.example-content p {
    color: var(--text-secondary);
    margin-bottom: 15px;
    font-size: 1rem;
}

.calculation-steps {
    background: var(--light-bg);
    padding: 20px;
    border-radius: 8px;
}

.calc-step {
    display: flex;
    justify-content: space-between;
    padding: 10px 15px;
    border-bottom: 1px solid var(--border-color);
}

.calc-step:last-child {
    border-bottom: none;
}

.calc-step.sub-step {
    padding-left: 35px;
    font-size: 0.95rem;
    background: rgba(255, 255, 255, 0.5);
}

.calc-step.highlight {
    background: #dbeafe;
    font-weight: 600;
    margin: 5px -5px;
    padding: 10px 20px;
    border-radius: 6px;
}

.calc-step.final {
    background: #d1fae5;
    font-weight: 700;
    margin: 10px -5px 5px -5px;
    padding: 15px 20px;
    border-radius: 6px;
    font-size: 1.1rem;
    border: 2px solid var(--success-color);
}

.step-label {
    color: var(--text-primary);
}

.step-value {
    color: var(--success-color);
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

footer {
    background: #1e293b;
    color: white;
    padding: 30px 40px;
    text-align: center;
}

footer p {
    margin-bottom: 10px;
    opacity: 0.9;
}

footer p:last-child {
    margin-bottom: 0;
    font-size: 0.875rem;
    opacity: 0.7;
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    header h1 {
        font-size: 1.8rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .tax-brackets {
        grid-template-columns: 1fr;
    }

    form {
        padding: 20px;
    }

    .form-section {
        padding: 20px;
    }

    .result-grid {
        grid-template-columns: 1fr;
    }

    .result-value.large {
        font-size: 2rem;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.results {
    animation: fadeIn 0.5s ease;
}

