:root {
    --primary-color: #204080;
    --secondary-color: #5AC8FA;
    --dark-color: #0056CC;
    --light-color: #E3F2FD;
    --success-color: #48bb78;
    --education-color: #7C3AED;
    --teacher-color: #059669;
    --deduction-color: #F59E0B;
    --error-color: #e53e3e;
    --text-primary: #1a202c;
    --text-secondary: #4a5568;
    --border-color: #e2e8f0;
    --shadow-light: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-medium: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-heavy: 0 10px 25px rgba(0,0,0,0.15);
    --gradient-primary: linear-gradient(135deg, #204080 0%, #5AC8FA 100%);
    --gradient-education: linear-gradient(135deg, #7C3AED 0%, #A855F7 100%);
    --gradient-teacher: linear-gradient(135deg, #059669 0%, #10B981 100%);
    --gradient-deduction: linear-gradient(135deg, #F59E0B 0%, #FBBF24 100%);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: #ffffff;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Hero Section */
.hero-section {
    background: var(--gradient-education);
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.hero-section h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-section p {
    font-size: 1.2rem;
    opacity: 0.9;
    max-width: 700px;
    margin: 0 auto;
}

/* Calculator Section */
.calculator-section {
    padding: 4rem 0;
    background-color: #f8fafc;
}

.calculator-card {
    background: white;
    border-radius: 16px;
    padding: 3rem;
    box-shadow: var(--shadow-heavy);
    margin-bottom: 3rem;
    border: 1px solid var(--border-color);
}

.calculator-card h2 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 2rem;
    color: var(--education-color);
    text-align: center;
}

/* Form Styling */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

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

.input-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.input-label.required::after {
    content: ' *';
    color: var(--error-color);
    font-weight: 700;
}

.input-field, .select-field {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    background-color: white;
}

.input-field:focus, .select-field:focus {
    outline: none;
    border-color: var(--education-color);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.input-field.error, .select-field.error {
    border-color: var(--error-color);
    box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.1);
}

.help-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.error-message {
    color: var(--error-color);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Expense Categories */
.expense-categories {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 16px;
    padding: 2rem;
    margin: 2rem 0;
    border: 2px solid var(--border-color);
}

.expense-categories h4 {
    font-size: 1.4rem;
    margin-bottom: 1.5rem;
    color: var(--education-color);
    text-align: center;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.expense-category {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow-light);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.expense-category:hover {
    box-shadow: var(--shadow-medium);
    transform: translateY(-2px);
}

.expense-category h5 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--teacher-color);
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--light-color);
}

.expense-items {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.expense-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.expense-item label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
}

.expense-input {
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background-color: white;
}

.expense-input:focus {
    outline: none;
    border-color: var(--teacher-color);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
}

.expense-input:valid {
    border-color: var(--success-color);
}

/* Expense Total */
.expense-total {
    background: var(--gradient-teacher);
    color: white;
    padding: 1.5rem;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.2rem;
    font-weight: 700;
    box-shadow: var(--shadow-medium);
}

/* Calculate Button */
.calculate-btn {
    width: 100%;
    background: var(--gradient-education);
    color: white;
    border: none;
    padding: 1.25rem 2rem;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-medium);
}

.calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-heavy);
}

.calculate-btn:active {
    transform: translateY(0);
}

/* Results Section */
.results-section {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    margin-top: 2rem;
    box-shadow: var(--shadow-medium);
    border: 1px solid var(--border-color);
    display: none;
}

.results-section.show {
    display: block;
    animation: fadeInUp 0.5s ease;
}

.results-section h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--education-color);
    text-align: center;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 1rem;
}

.result-item:last-child {
    border-bottom: none;
}

.result-value {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--education-color);
}

.result-value.teacher {
    color: var(--teacher-color);
}

.result-value.deduction {
    color: var(--deduction-color);
}

.result-value.success {
    color: var(--success-color);
}

.result-item.highlight {
    background: linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 100%);
    padding: 1.25rem;
    border-radius: 8px;
    border: none;
    margin: 1rem 0;
}

/* Info Section */
.info-section {
    padding: 4rem 0;
    background: white;
}

.info-section h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 3rem;
    color: var(--education-color);
    text-align: center;
}

.info-section h3 {
    font-size: 1.4rem;
    font-weight: 600;
    margin: 2rem 0 1rem;
    color: var(--education-color);
}

.info-section p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.info-section ul, .info-section ol {
    margin: 1rem 0 2rem 1.5rem;
    color: var(--text-secondary);
}

.info-section li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

/* Deduction Box */
.deduction-box {
    background: linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 100%);
    border-left: 4px solid var(--education-color);
    padding: 2rem;
    border-radius: 12px;
    margin: 2rem 0;
}

.deduction-box h4 {
    color: var(--education-color);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

/* Info Grid */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

.info-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow-light);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.info-card:hover {
    box-shadow: var(--shadow-medium);
    transform: translateY(-2px);
}

.info-card h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: var(--education-color);
}

.info-card p {
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Qualified Expenses */
.qualified-expenses {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.expense-group {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow-light);
    border: 1px solid var(--border-color);
}

.expense-group h4 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: var(--teacher-color);
}

.expense-group ul {
    margin: 0;
    padding-left: 1.5rem;
}

.expense-group li {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

/* Limit Grid */
.limit-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.limit-card {
    background: var(--gradient-deduction);
    color: white;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow-medium);
    transition: all 0.3s ease;
}

.limit-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-heavy);
}

.limit-card h4 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.limit-amount {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 1rem 0;
}

.limit-card p {
    opacity: 0.9;
    font-size: 0.95rem;
}

/* Record Keeping */
.record-keeping {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border-left: 4px solid var(--teacher-color);
    padding: 2rem;
    border-radius: 12px;
    margin: 2rem 0;
}

.record-keeping h4 {
    color: var(--teacher-color);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.record-keeping ul {
    margin: 1rem 0;
}

/* Special Situations */
.special-situations {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.situation-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow-light);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.situation-card:hover {
    box-shadow: var(--shadow-medium);
    transform: translateY(-2px);
}

.situation-card h4 {
    color: var(--education-color);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

/* Tax Impact */
.tax-impact {
    background: linear-gradient(135deg, #e3f2fd 0%, #f0f9ff 100%);
    border-left: 4px solid var(--secondary-color);
    padding: 2rem;
    border-radius: 12px;
    margin: 2rem 0;
}

.tax-impact h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.tax-impact ul {
    margin: 1rem 0;
}

/* Mistake Grid */
.mistake-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.mistake-card {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border-left: 4px solid var(--error-color);
    border-radius: 12px;
    padding: 2rem;
    transition: all 0.3s ease;
}

.mistake-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-light);
}

.mistake-card h4 {
    color: var(--error-color);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

/* Maximizing Tips */
.maximizing-tips {
    background: linear-gradient(135deg, #fff7ed 0%, #fed7aa 100%);
    border-left: 4px solid var(--deduction-color);
    padding: 2rem;
    border-radius: 12px;
    margin: 2rem 0;
}

.maximizing-tips h4 {
    color: var(--deduction-color);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.maximizing-tips ol {
    margin: 1rem 0;
}

/* Highlight Box */
.highlight-box {
    background: linear-gradient(135deg, #e3f2fd 0%, #f0f9ff 100%);
    border-left: 4px solid var(--secondary-color);
    padding: 2rem;
    border-radius: 12px;
    margin: 2rem 0;
}

.highlight-box h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

/* Educator Box */
.educator-box {
    background: var(--gradient-teacher);
    color: white;
    border-radius: 16px;
    padding: 2rem;
    margin: 2rem 0;
    text-align: center;
    box-shadow: var(--shadow-medium);
}

.educator-box h4 {
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

/* Related Calculators */
.related-calculators {
    padding: 4rem 0;
    background-color: #f8fafc;
}

.related-calculators h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 3rem;
    color: var(--education-color);
    text-align: center;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.related-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow-light);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
}

.related-card:hover {
    box-shadow: var(--shadow-medium);
    transform: translateY(-4px);
    text-decoration: none;
    color: inherit;
}

.related-card h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--education-color);
}

.related-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* FAQ Section */
.faq-section {
    padding: 4rem 0;
    background: white;
}

.faq-section h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 3rem;
    color: var(--education-color);
    text-align: center;
}

.faq-container {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    background: white;
    border-radius: 12px;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-light);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.faq-question {
    width: 100%;
    background: none;
    border: none;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.faq-question:hover {
    background: #f8fafc;
}

.faq-icon {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--education-color);
    transition: all 0.3s ease;
}

.faq-answer {
    padding: 0 1.5rem 1.5rem;
    color: var(--text-secondary);
    line-height: 1.6;
    display: none;
}

.faq-answer.show {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: white;
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-heavy);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    color: var(--education-color);
    margin: 0;
    font-size: 1.3rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    text-align: right;
}

.modal-button {
    background: var(--gradient-education);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.modal-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .hero-section p {
        font-size: 1rem;
    }
    
    .calculator-card {
        padding: 2rem 1.5rem;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .category-grid {
        grid-template-columns: 1fr;
    }
    
    .container {
        padding: 0 15px;
    }
    
    .qualified-expenses {
        grid-template-columns: 1fr;
    }
    
    .limit-grid {
        grid-template-columns: 1fr;
    }
    
    .special-situations,
    .mistake-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .hero-section {
        padding: 3rem 0;
    }
    
    .calculator-section,
    .info-section,
    .related-calculators,
    .faq-section {
        padding: 3rem 0;
    }
    
    .result-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .expense-total {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    .limit-amount {
        font-size: 2rem;
    }
    
    .faq-question {
        padding: 1rem;
    }
    
    .faq-answer {
        padding: 0 1rem 1rem;
    }
} 