body {
    font-family: Arial, sans-serif;
    max-width: 1000px;
    margin: 20px auto;
    padding: 0 20px;
    background-color: #f1f1f1;
} 

.page-header {
    text-align: center;
    margin: 30px 0;
}

.page-header h1 {
    color: #2c3e50;
    font-size: 2.5em;
    margin-bottom: 10px;
}

.page-header h2 {
    color: #34495e;
    font-size: 1.5em;
    font-weight: normal;
    margin-top: 0;
}

.page-header .main-info {
    font-size: 0.6em;
    margin-left: 10px;
    vertical-align: middle;
}

/* Theme Toggle */
.theme-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
}

.theme-toggle button {
    background: none;
    border: 2px solid #ccc;
    border-radius: 20px;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 1.2em;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.theme-toggle button:hover {
    transform: scale(1.05);
}

/* Dark mode styles */
[data-theme="dark"] body {
    background-color: #1a1a1a;
    color: #ffffff;
}

[data-theme="dark"] .page-header h1,
[data-theme="dark"] .page-header h2 {
    color: #ffffff;
}

[data-theme="dark"] .page-header .main-info {
    color: #ffffff;
}

[data-theme="dark"] .tab-container {
    background-color: #333;
}

[data-theme="dark"] .tab-buttons {
    background-color: #2d2d2d;
}

[data-theme="dark"] .tab-button {
    color: #fff;
}

[data-theme="dark"] .tab-button.active {
    background-color: #333;
    color: #fff;
    border-bottom-color: #4CAF50;
}

[data-theme="dark"] .tab-button.disabled {
    background: #2a2a2a;
    color: #555;
}

[data-theme="dark"] .calculation-details {
    background-color: #2d2d2d;
}

[data-theme="dark"] .summary-box {
    background-color: #2d2d2d;
    color: white;
}

[data-theme="dark"] .table-explanation {
    background-color: #333;
    border-color: #555;
    color: white;
}

[data-theme="dark"] .table-explanation h3 {
    color: #ffffff;
}

[data-theme="dark"] .normal-indicator {
    background-color: #444;
    border-color: #666;
}

[data-theme="dark"] .blue-indicator {
    background-color: #316fa9;
    border-color: #4a8bc2;
}

[data-theme="dark"] .key-insight {
    background-color: #2d4a2d;
    border-color: #4a6b4a;
    color: #ffffff;
}

[data-theme="dark"] th {
    background-color: #2d2d2d;
    color: white;
}

[data-theme="dark"] td {
    background-color: #333;
    color: white;
}

[data-theme="dark"] .earnings-over-limit {
    color: #8a8a8a;
}

[data-theme="dark"] .future-year td {
    background-color: #316fa9;
}

[data-theme="dark"] .scenario h3 {
    color: #ffffff;
}

[data-theme="dark"] .scenario {
    color: white;
    background-color: #1a2733;
}

[data-theme="dark"] .scenario-comparison {
    color: white;
    background-color: #444;
}

[data-theme="dark"] .current-info-section {
    background-color: #444;
}

[data-theme="dark"] .instructions-section {
    background-color: #2d4a2d;
    border-color: #4a6b4a;
}

[data-theme="dark"] .instructions-section h2 {
    color: #a8d8a8;
}

[data-theme="dark"] .format-examples {
    background-color: #333;
}

[data-theme="dark"] .sample-data {
    background-color: #2a2a2a;
    border-color: #555;
    color: #ffffff;
}

[data-theme="dark"] .complete-example {
    background-color: #2a3a4a;
    border-color: #4a6a8a;
}

[data-theme="dark"] .complete-example code {
    color: #ffffff;
}

[data-theme="dark"] .textarea-section textarea {
    background-color: #2a2a2a;
    border-color: #555;
    color: #ffffff;
}

[data-theme="dark"] .example-section {
    background-color: #333;
    border-color: #555;
}

[data-theme="dark"] .example-section .complete-example {
    background-color: #2a2a2a;
    border-color: #555;
}

[data-theme="dark"] .example-note {
    color: #aaa;
}

[data-theme="dark"] table {
    border-color: #444;
}

[data-theme="dark"] th,
[data-theme="dark"] td {
    border-color: #444;
}

[data-theme="dark"] .zero-earnings td {
    background-color: #7d3f3f;
}

/* Make the total earnings appear slightly dimmed in dark mode */
[data-theme="dark"] td:nth-child(2):not(.earnings-over-limit) {
    color: #8a8a8a;
}

.tab-container {
    border: 1px solid #ccc;
    border-radius: 4px;
    overflow: hidden;
}
.tab-buttons {
    background: #f1f1f1;
    border-bottom: 1px solid #ccc;
    display: flex;
}
.tab-button {
    background: inherit;
    border: none;
    padding: 12px 24px;
    cursor: pointer;
    transition: background-color 0.3s;
}
.tab-button:hover {
    background: #ddd;
}
.tab-button.active {
    background: white;
    border-bottom: 2px solid #4CAF50;
}
.tab-button.disabled {
    background: #f5f5f5;
    color: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}
.tab-content {
    display: none;
    padding: 20px;
}
.tab-content.active {
    display: block;
}
.input-section {
    margin: 20px 0;
}
.scenario .calculation-details table {
    font-size: 0.9em;
    margin: 10px 0;
}
.scenario .calculation-details th,
.scenario .calculation-details td {
    padding: 4px 8px;
}
.future-year {
    background-color: #f0f8ff; /* Light blue background */
}        
table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}
th, td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}
th {
    background-color: #f2f2f2;
}
.chart-container {
    margin: 30px 0;
    height: 400px;
}
button.calculate {
    padding: 10px 20px;
    background-color: #4CAF50;
    color: white;
    border: none;
    cursor: pointer;
}
button.calculate:hover {
    background-color: #45a049;
}
.earnings-over-limit {
    color: #999;
    font-style: italic;
}
.zero-earnings {
    background-color: #e76868;
}

.note {
    color: #666;
    font-style: italic;
    margin-bottom: 10px;
}
.results-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}
.calculation-details {
    background: #f8f8f8;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}
.current-info-section {
    background: #f8f8f8;
    padding: 20px;
    border-radius: 4px;
    margin-bottom: 20px;
}

/* Instructions section */
.instructions-section {
    background: #e8f5e8;
    border: 1px solid #c3e6c3;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 25px;
}

.instructions-section h2 {
    color: #2d5a2d;
    margin-top: 0;
    margin-bottom: 15px;
}

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

.step {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.step-number {
    background: #4CAF50;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9em;
    flex-shrink: 0;
}

.step-content {
    font-size: 0.95em;
    line-height: 1.4;
}

/* Format examples */
.format-examples {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 15px 0;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 6px;
}

.format-example {
    padding: 10px;
}

.sample-data {
    background: white;
    padding: 10px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    margin-top: 8px;
    border: 1px solid #ddd;
}

.complete-example {
    background: #f0f8ff;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #b3d9ff;
    margin: 10px 0;
}

.complete-example code {
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    display: block;
    line-height: 1.3;
}

/* Input area layout */
.input-area {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin: 20px 0;
    align-items: start;
}

.textarea-section textarea {
    width: 100%;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    resize: vertical;
}

.example-section {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.example-section .complete-example {
    background: #ffffff;
    border: 1px solid #ddd;
    margin: 10px 0;
}

.example-note {
    font-size: 0.85em;
    color: #666;
    font-style: italic;
    margin: 10px 0 0 0;
}

/* Responsive design for input area */
@media (max-width: 768px) {
    .input-area {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}
.input-group {
    margin: 10px 0;
}
.input-group label {
    display: inline-block;
    width: 250px;
    margin-right: 10px;
}
.input-group input {
    padding: 5px;
    width: 150px;
}
.scenario-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 20px 0;
}
.scenario {
    background: #f8f8f8;
    padding: 15px;
    border-radius: 4px;
}
.scenario h3 {
    margin-top: 0;
    color: #333;
}

.summary-box {
    background-color: #f0f7ff;
    border: 1px solid #cce0ff;
    border-radius: 4px;
    padding: 15px 20px;
    margin-bottom: 20px;
    font-size: 1.1em;
    line-height: 1.5;
}

.summary-box p {
    margin: 0;
}

/* Table explanation styles */
.table-explanation {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.table-explanation h3 {
    margin: 0 0 15px 0;
    color: #333;
}

.explanation-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.explanation-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.color-indicator {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    flex-shrink: 0;
    margin-top: 2px;
}

.red-indicator {
    background-color: #e76868;
}

.blue-indicator {
    background-color: #f0f8ff;
    border: 1px solid #b3d9ff;
}

.normal-indicator {
    background-color: #f2f2f2;
    border: 1px solid #ddd;
}

.explanation-text {
    font-size: 0.95em;
    line-height: 1.4;
}

.key-insight {
    background: #e8f5e8;
    border: 1px solid #c3e6c3;
    border-radius: 6px;
    padding: 12px;
    margin: 15px 0 0 0;
    font-size: 0.95em;
}

/* Break-even analysis styles */
.comparison-controls {
    background: #f8f8f8;
    padding: 20px;
    border-radius: 4px;
    margin-bottom: 20px;
}

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

.control-group h3 {
    margin-bottom: 10px;
    color: #333;
}

/* Top settings horizontal layout */
.top-settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 20px;
}

.basic-settings {
    padding-right: 15px;
    border-right: 1px solid #ddd;
}

.investment-section {
    padding-left: 15px;
}

.basic-settings h2,
.investment-section h2 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
    font-size: 1.5em;
}

/* Responsive design for smaller screens */
@media (max-width: 768px) {
    .top-settings-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .basic-settings {
        padding-right: 0;
        border-right: none;
        border-bottom: 1px solid #ddd;
        padding-bottom: 15px;
    }
    
    .investment-section {
        padding-left: 0;
        padding-top: 15px;
    }
    
    [data-theme="dark"] .basic-settings {
        border-right: none;
        border-bottom-color: #555;
    }
}

.age-inputs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 10px;
}

.age-input-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.age-input-group label {
    font-weight: bold;
    font-size: 0.9em;
    width: auto;
}

.age-input-group input {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    width: 100%;
}

.break-even-results {
    margin-top: 20px;
}

/* Dark mode styles for comparison tab */
[data-theme="dark"] .comparison-controls {
    background-color: #444;
}

[data-theme="dark"] .control-group h3 {
    color: #ffffff;
}

[data-theme="dark"] .basic-settings {
    border-right-color: #555;
}

[data-theme="dark"] .basic-settings h2,
[data-theme="dark"] .investment-section h2 {
    color: #ffffff;
}

[data-theme="dark"] .age-input-group label {
    color: #ffffff;
}

[data-theme="dark"] .age-input-group input {
    background-color: #333;
    color: #ffffff;
    border-color: #555;
}

/* Investment controls styles */
.investment-controls {
    margin-top: 10px;
}

.investment-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
    cursor: pointer;
    margin-bottom: 15px;
}

.investment-toggle input[type="checkbox"] {
    width: auto;
}

.investment-inputs {
    margin-top: 15px;
    padding-left: 20px;
    border-left: 3px solid #4CAF50;
}

.investment-inputs .input-group {
    margin-bottom: 10px;
}

.investment-inputs .input-group:last-child {
    margin-bottom: 0;
}

/* Dark mode styles for investment controls */
[data-theme="dark"] .investment-toggle {
    color: #ffffff;
}

[data-theme="dark"] .investment-inputs {
    border-left-color: #4CAF50;
}

/* Chart maximize button */
.chart-container {
    position: relative;
}

.maximize-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 8px;
    cursor: pointer;
    font-size: 16px;
    z-index: 10;
    transition: all 0.2s ease;
}

.maximize-btn:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.05);
}

.maximize-icon {
    display: block;
    line-height: 1;
}

/* Full screen chart modal */
.chart-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(3px);
}

.chart-modal-content {
    position: relative;
    margin: 2% auto;
    width: 95%;
    height: 95%;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
}

.chart-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    background-color: #f8f9fa;
    border-radius: 8px 8px 0 0;
}

.chart-modal-header h3 {
    margin: 0;
    color: #333;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.close-btn:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

.chart-modal-body {
    flex: 1;
    padding: 20px;
    position: relative;
}

.chart-modal-body canvas {
    width: 100% !important;
    height: 100% !important;
}

/* Chart info panel */
.chart-info-panel {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    min-width: 300px;
    max-width: 400px;
    z-index: 10;
    font-size: 0.9em;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.chart-info-panel h4 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 1.1em;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

.chart-info-panel .info-section {
    margin-bottom: 12px;
}

.chart-info-panel .info-section:last-child {
    margin-bottom: 0;
}

.chart-info-panel .info-label {
    font-weight: bold;
    color: #555;
    margin-bottom: 3px;
}

.chart-info-panel .info-value {
    margin-left: 10px;
    color: #333;
}

.chart-info-panel .benefit-breakdown {
    margin-left: 10px;
    font-size: 0.85em;
    color: #666;
}

/* Dark mode styles for info panel */
[data-theme="dark"] .chart-info-panel {
    background: rgba(26, 26, 26, 0.95);
    border-color: #555;
}

[data-theme="dark"] .chart-info-panel h4 {
    color: #ffffff;
    border-bottom-color: #444;
}

[data-theme="dark"] .chart-info-panel .info-label {
    color: #cccccc;
}

[data-theme="dark"] .chart-info-panel .info-value {
    color: #ffffff;
}

[data-theme="dark"] .chart-info-panel .benefit-breakdown {
    color: #aaaaaa;
}

/* Dark mode styles for modal */
[data-theme="dark"] .maximize-btn {
    background: rgba(0, 0, 0, 0.9);
    border-color: #555;
    color: white;
}

[data-theme="dark"] .maximize-btn:hover {
    background: rgba(0, 0, 0, 1);
}

[data-theme="dark"] .chart-modal-content {
    background-color: #1a1a1a;
}

[data-theme="dark"] .chart-modal-header {
    background-color: #2d2d2d;
    border-bottom-color: #444;
}

[data-theme="dark"] .chart-modal-header h3 {
    color: #ffffff;
}

[data-theme="dark"] .close-btn {
    color: #ffffff;
}

[data-theme="dark"] .close-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Detailed data table styles */
.detailed-data-table {
    margin-top: 30px;
    overflow-x: auto;
}

.detailed-data-table h3 {
    margin-bottom: 15px;
    color: #333;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
    margin: 10px 0;
}

.data-table th,
.data-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: center;
}

.data-table th {
    background-color: #f2f2f2;
    font-weight: bold;
    position: sticky;
    top: 0;
    z-index: 1;
}

.data-table .age-group-header {
    background-color: #e9ecef;
    font-weight: bold;
    font-size: 1.1em;
}

.data-table .year-cell {
    background-color: #f8f9fa;
    font-weight: bold;
}

.data-table .monetary-value {
    text-align: right;
    font-family: 'Courier New', monospace;
}

.data-table .total-value {
    background-color: #d4edda;
    font-weight: bold;
}

.data-table .investment-value {
    background-color: #fff3cd;
}

/* Dark mode styles for data table */
[data-theme="dark"] .detailed-data-table h3 {
    color: #ffffff;
}

[data-theme="dark"] .data-table th {
    background-color: #2d2d2d;
    color: white;
}

[data-theme="dark"] .data-table td {
    background-color: #333;
    color: white;
    border-color: #444;
}

[data-theme="dark"] .data-table th {
    border-color: #444;
}

[data-theme="dark"] .data-table .age-group-header {
    background-color: #404040;
}

[data-theme="dark"] .data-table .year-cell {
    background-color: #2a2a2a;
}

[data-theme="dark"] .data-table .total-value {
    background-color: #1e4620;
}

[data-theme="dark"] .data-table .investment-value {
    background-color: #4a3c1a;
}

/* Export controls styles */
.export-controls {
    margin-top: 15px;
    text-align: center;
}

.export-btn {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.export-btn:hover {
    background-color: #218838;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

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

/* Dark mode styles for export button */
[data-theme="dark"] .export-btn {
    background-color: #198754;
}

[data-theme="dark"] .export-btn:hover {
    background-color: #157347;
}

/* Analysis context styles */
.analysis-context {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 20px;
    font-size: 0.9em;
}

.analysis-context h4 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 1.1em;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 8px;
}

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

.context-section {
    line-height: 1.6;
}

.context-section strong {
    color: #495057;
    display: block;
    margin-bottom: 5px;
}

.context-section br {
    margin-bottom: 3px;
}

/* Dark mode styles for analysis context */
[data-theme="dark"] .analysis-context {
    background-color: #2d2d2d;
    border-color: #444;
}

[data-theme="dark"] .analysis-context h4 {
    color: #ffffff;
    border-bottom-color: #444;
}

[data-theme="dark"] .context-section strong {
    color: #cccccc;
}

[data-theme="dark"] .analysis-context {
    color: #ffffff;
}

/* Info icon styles */
.info-icon {
    display: inline-block;
    margin-left: 8px;
    cursor: pointer;
    font-size: 0.9em;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.info-icon:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* Info modal styles */
.info-modal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(3px);
}

.info-modal-content {
    position: relative;
    margin: 5% auto;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    overflow-y: auto;
}

.info-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px 15px 25px;
    border-bottom: 1px solid #eee;
    background-color: #f8f9fa;
    border-radius: 8px 8px 0 0;
}

.info-modal-header h3 {
    margin: 0;
    color: #333;
}

.info-modal-body {
    padding: 25px;
    line-height: 1.6;
}

.info-modal-body h4 {
    color: #333;
    margin: 20px 0 10px 0;
    font-size: 1.1em;
}

.info-modal-body h4:first-child {
    margin-top: 0;
}

.info-modal-body ul {
    margin: 10px 0;
    padding-left: 20px;
}

.info-modal-body li {
    margin-bottom: 8px;
}

.info-modal-body strong {
    color: #2c3e50;
}

/* Dark mode styles for info modal */
[data-theme="dark"] .info-modal-content {
    background-color: #1a1a1a;
}

[data-theme="dark"] .info-modal-header {
    background-color: #2d2d2d;
    border-bottom-color: #444;
}

[data-theme="dark"] .info-modal-header h3 {
    color: #ffffff;
}

[data-theme="dark"] .info-modal-body {
    color: #ffffff;
}

[data-theme="dark"] .info-modal-body h4 {
    color: #ffffff;
}

[data-theme="dark"] .info-modal-body strong {
    color: #4fc3f7;
}
