* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f3f4f6;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background: white;
    padding: 20px 0;
    margin-bottom: 30px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

header .container {
    padding: 0 20px;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: #3b82f6;
    text-decoration: none;
}

.lg-flex {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 30px;
}

@media (max-width: 768px) {
    .lg-flex {
        grid-template-columns: 1fr;
    }
    .sidebar {
        display: none;
    }
}

.card {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

h1 {
    font-size: 28px;
    color: #1f2937;
    margin-bottom: 10px;
}

h2 {
    font-size: 22px;
    color: #1f2937;
    margin-bottom: 20px;
    border-bottom: 2px solid #3b82f6;
    padding-bottom: 10px;
}

h3 {
    font-size: 18px;
    color: #1f2937;
    margin-bottom: 15px;
    margin-top: 20px;
}

h4 {
    font-size: 16px;
    color: #3b82f6;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 16px;
    color: #6b7280;
    margin-bottom: 20px;
}

.warning-box {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    color: #92400e;
}

.mode-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid #e5e7eb;
    flex-wrap: wrap;
}

.mode-tab {
    padding: 12px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    color: #6b7280;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
    margin-bottom: -2px;
}

.mode-tab:hover {
    color: #3b82f6;
}

.mode-tab.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
}

.mode-content {
    display: none;
}

.mode-content.active {
    display: block;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

@media (max-width: 600px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }
}

.input-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #374151;
    font-size: 14px;
}

input[type="number"] {
    width: 100%;
    padding: 12px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
}

input[type="number"]:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: #3b82f6;
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background: #2563eb;
    box-shadow: 0 4px 6px rgba(59, 130, 246, 0.3);
}

.btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
    width: 100%;
    margin-top: 10px;
}

.btn-secondary:hover {
    background: #e5e7eb;
}

.btn-danger {
    background: #ef4444;
    color: white;
    padding: 8px 16px;
    width: auto;
}

.btn-danger:hover {
    background: #dc2626;
}

.result-box {
    background: #f0f4ff;
    padding: 20px;
    border-radius: 6px;
    margin-top: 20px;
    border-left: 4px solid #3b82f6;
}

.result-box h4 {
    margin-bottom: 10px;
}

.result-value {
    font-size: 28px;
    font-weight: bold;
    color: #3b82f6;
}

.formula-display {
    background: #f3f4f6;
    padding: 15px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    margin-bottom: 15px;
    overflow-x: auto;
    border-left: 3px solid #3b82f6;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    background: white;
}

th {
    background: #3b82f6;
    color: white;
    padding: 12px;
    text-align: left;
    font-weight: 600;
}

td {
    padding: 12px;
    border-bottom: 1px solid #e5e7eb;
}

tr:hover {
    background: #f9fafb;
}

.cash-flow-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    margin-bottom: 10px;
    align-items: flex-end;
}

.cash-flow-item input {
    margin-bottom: 0;
}

/* EDUCATIONAL SECTION */
.education-section {
    margin-top: 40px;
    background: #f9fafb;
}

.education-category {
    margin-bottom: 40px;
}

.definition-box {
    background: white;
    padding: 20px;
    border-radius: 6px;
    margin-bottom: 20px;
    border-left: 4px solid #3b82f6;
}

.definition-box p {
    margin-bottom: 12px;
    color: #4b5563;
    line-height: 1.8;
}

.key-points {
    background: white;
    padding: 20px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.key-points ul {
    list-style: none;
}

.key-points li {
    padding: 10px 0 10px 30px;
    position: relative;
    color: #4b5563;
    line-height: 1.8;
}

.key-points li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #10b981;
    font-weight: bold;
}

.comparison-table {
    background: white;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 20px;
}

.comparison-table th {
    background: #3b82f6;
}

.example-box {
    background: white;
    padding: 20px;
    border-radius: 6px;
    margin-bottom: 20px;
    border-left: 4px solid #10b981;
}

.example-box h4 {
    color: #10b981;
}

.example-content {
    background: #f3f4f6;
    padding: 12px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 13px;
    margin-bottom: 12px;
    overflow-x: auto;
}

.example-explanation {
    color: #4b5563;
    line-height: 1.8;
}

.collapsible-header {
    background: white;
    padding: 15px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid #e5e7eb;
    margin-bottom: 15px;
    transition: all 0.3s;
}

.collapsible-header:hover {
    background: #f9fafb;
    border-color: #3b82f6;
}

.collapsible-header h4 {
    margin: 0;
}

.collapsible-arrow {
    color: #3b82f6;
    transition: transform 0.3s;
}

.collapsible-arrow.open {
    transform: rotate(180deg);
}

.collapsible-content {
    display: none;
    background: #f9fafb;
    padding: 20px;
    border: 1px solid #e5e7eb;
    border-top: none;
    border-radius: 0 0 6px 6px;
    margin-bottom: 15px;
}

.collapsible-content.open {
    display: block;
}

.collapsible-content ul {
    list-style: none;
}

.collapsible-content li {
    padding: 10px 0 10px 30px;
    position: relative;
    color: #4b5563;
}

.warning-highlight {
    background: #fee2e2;
    border-left: 4px solid #ef4444;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 15px;
}

.warning-highlight strong {
    color: #991b1b;
}

.warning-highlight p {
    margin-top: 8px;
    color: #7f1d1d;
}

.scenario-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .scenario-grid {
        grid-template-columns: 1fr;
    }
}

.scenario-card {
    background: white;
    padding: 15px;
    border-radius: 6px;
    border: 2px solid #e5e7eb;
}

.scenario-card h5 {
    color: #1f2937;
    margin-bottom: 10px;
    font-weight: 600;
}

.scenario-card p {
    color: #4b5563;
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 5px;
}

.icon-badge {
    display: inline-block;
    width: 24px;
    height: 24px;
    background: #dbeafe;
    color: #3b82f6;
    border-radius: 50%;
    text-align: center;
    line-height: 24px;
    margin-right: 8px;
    font-weight: bold;
    font-size: 12px;
}

footer {
    background: white;
    padding: 30px 0;
    margin-top: 60px;
    border-top: 1px solid #e5e7eb;
    font-size: 13px;
    color: #6b7280;
}