/* 
   Base Style Definitions 
   These variables define the main color scheme and visual elements
*/
:root {
    --primary-color: #e11b22;      /* Red for Canadian theme */
    --primary-dark: #c30c13;
    --secondary-color: #f8f8f8;
    --accent-color: #0072c6;
    --text-color: #333;
    --light-gray: #e0e0e0;
    --medium-gray: #999;
    --dark-gray: #666;
    --success-color: #2ecc71;
    --warning-color: #f39c12;
    --border-radius: 5px;
    --box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--secondary-color);
}

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

/* Header Styles */
header {
    background-color: white;
    color: var(--text-color);
    padding: 20px 0;
    box-shadow: var(--box-shadow);
}

/*
.header-content {
    display: flex;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
	
.canada-flag {
    height: 50px;
    margin-right: 20px;
}
*/

.header-content {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    text-align: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px 0;
}

.canada-flag {
    height: 50px;
    margin-bottom: 10px;
}

/* New Navigation Styles */
.nav-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin: 0 auto;
    padding: 15px 0;
    max-width: 1200px;
    background-color: var(--secondary-color);
    border-top: 1px solid var(--light-gray);
    border-bottom: 1px solid var(--light-gray);
}

.nav-item {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: var(--transition);
}

.nav-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.nav-item a {
    display: block;
    padding: 10px 20px;
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.nav-item a:hover {
    color: var(--primary-color);
}

/* Media query adjustments */
@media (max-width: 768px) {
    .nav-container {
        padding: 10px;
    }
    
    .nav-item a {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
}

.reset-button-container {
    text-align: center;
    margin-top: 10px;
}

.reset-button {
    background-color: var(--dark-gray);
    color: white;
    border: none;
    padding: 8px 16px;
    font-size: 0.9rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
}

.reset-button:hover {
    background-color: #555;
}

h1, h2, h3, h4 {
    margin-bottom: 15px;
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
    color: var(--accent-color);
    border-bottom: 2px solid var(--light-gray);
    padding-bottom: 10px;
}


h3 {
    font-size: 1.5rem;
    color: var(--accent-color);
}

h4 {
    font-size: 1.2rem;
    color: var(--text-color);
}

p {
    margin-bottom: 15px;
}

/* Introduction Section */
.intro {
    background-color: white;
    padding: 30px;
    margin-bottom: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.disclaimer {
    margin-top: 20px;
    padding: 15px;
    background-color: #f8f4e5;
    border-left: 4px solid var(--warning-color);
    border-radius: var(--border-radius);
}

.disclaimer h3 {
    color: var(--warning-color);
}

/* Key Considerations Section */
.key-considerations {
    margin-top: 20px;
    padding: 15px;
    background-color: #f1f9ff;
    border-left: 4px solid var(--accent-color);
    border-radius: var(--border-radius);
}

.key-considerations h3 {
    color: var(--accent-color);
}

.key-considerations ul {
    margin-left: 20px;
}

.key-considerations li {
    margin-bottom: 8px;
}

/* Future Enhancements Section */
.future-enhancements {
    background-color: white;
    padding: 30px;
    margin-bottom: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.future-enhancements ul {
    margin-left: 20px;
}

.future-enhancements li {
    margin-bottom: 8px;
}

/* Calculator Section */
.calculator {
    background-color: white;
    padding: 30px;
    margin-bottom: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

/* Calculator header with reset button */
.calculator-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.calculator-header h2 {
    margin-bottom: 0;
}

.form-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.form-section {
    border: 1px solid var(--light-gray);
    border-radius: var(--border-radius);
    padding: 20px;
    background-color: #f9f9f9;
}

.form-group {
    margin-bottom: 15px;
    position: relative;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

input, select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--light-gray);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
}

input:focus, select:focus {
    border-color: var(--accent-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 114, 198, 0.2);
}

.button-container {
    text-align: center;
}

.calculate-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 1.1rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--box-shadow);
}

.calculate-button:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Tooltip Styles */
.tooltip {
    display: inline-block;
    position: absolute;
    right: 10px;
    top: 10px;
}

.tooltip-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: var(--accent-color);
    color: white;
    font-size: 0.8rem;
    font-weight: bold;
    cursor: pointer;
}

.tooltip-text {
    visibility: hidden;
    width: 200px;
    background-color: var(--dark-gray);
    color: white;
    text-align: center;
    border-radius: var(--border-radius);
    padding: 10px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: var(--transition);
    font-size: 0.9rem;
    box-shadow: var(--box-shadow);
}

.tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: var(--dark-gray) transparent transparent transparent;
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* Results Section */
.results {
    background-color: white;
    padding: 30px;
    margin-bottom: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.result-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.result-box {
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: var(--box-shadow);
}

.result-box h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.result-box p {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--accent-color);
    margin-bottom: 5px;
}

.result-box p.note {
    font-size: 0.9rem;
    font-weight: normal;
    color: var(--medium-gray);
}

.result-box.highlight {
    background-color: #f1f9ff;
    border: 2px solid var(--accent-color);
}

.result-box.highlight p {
    color: var(--primary-color);
    font-size: 1.8rem;
}

.result-details {
    margin-bottom: 30px;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.chart-container {
    margin-bottom: 30px;
    padding: 20px;
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.table-container {
    overflow-x: auto;
}

.table-wrapper {
    max-height: 400px;
    overflow-y: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--light-gray);
}

th {
    background-color: #f2f2f2;
    position: sticky;
    top: 0;
}

tr:nth-child(even) {
    background-color: #f9f9f9;
}

tr:hover {
    background-color: #f1f9ff;
}

/* Highlight rows in the yearly breakdown table */
tr.coast-fire-row {
    background-color: #d4edda;
    font-weight: bold;
}

tr.retirement-row {
    background-color: #f8d7da;
    font-weight: bold;
}

/* Retirement Income Breakdown Styles */
.retirement-income-section {
    margin-bottom: 30px;
    padding: 20px;
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.income-breakdown {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.income-table {
    overflow-x: auto;
}

.income-table table {
    width: 100%;
    border-collapse: collapse;
}

.income-table th {
    background-color: #f2f2f2;
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    border-bottom: 1px solid var(--light-gray);
}

.income-table td {
    padding: 10px 15px;
    border-bottom: 1px solid var(--light-gray);
}

.income-table tr.highlight {
    background-color: #f1f9ff;
    font-weight: 600;
}

.income-table tr.portfolio-withdrawal {
    background-color: #ffebf2;
    font-weight: 600;
}

.income-table tr.total {
    background-color: #333;
    color: white;
    font-weight: bold;
}

.income-notes {
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: var(--border-radius);
}

.income-notes ul {
    margin-top: 10px;
    padding-left: 20px;
}

.income-notes li {
    margin-bottom: 8px;
}

/* Footer Styles */
footer {
    background-color: #333;
    color: white;
    text-align: center;
    padding: 20px 0;
    margin-top: 30px;
}

/* Responsive Styles */
@media (min-width: 992px) {
    .income-breakdown {
        flex-direction: row;
    }
    
    .income-table {
        flex: 2;
    }
    
    .income-notes {
        flex: 1;
    }
}

@media (max-width: 768px) {
    .form-container {
        grid-template-columns: 1fr;
    }
    
    .result-summary {
        grid-template-columns: 1fr;
    }
    
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .canada-flag {
        margin-right: 0;
        margin-bottom: 10px;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .calculator-header {
        flex-direction: column;
        gap: 15px;
    }
}