/* =====================================================
   FINANCIAL INSIGHTS
   Report-specific layout and presentation styles.

   Global colors, spacing, typography, radius and shadows
   are inherited from styles.css.
===================================================== */


/* =====================================================
   1. REPORT ACCORDIONS
===================================================== */

.financial-report-accordion {
    margin-bottom: var(--space-lg);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.accordion-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px;
    cursor: pointer;
    color: var(--color-text-white);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    transition: var(--transition-fast);
}

.accordion-summary:hover {
    filter: brightness(0.96);
}

.accordion-summary.on-track {
    background: var(--color-success);
}

.accordion-summary.needs-attention {
    background: var(--color-warning);
}

.accordion-summary.critical {
    background: var(--color-error);
}

.accordion-summary.not-started {
    background: #6B7280;
}

/* =====================================================
   2. REPORT CONTENT
===================================================== */

.accordion-content {
    padding: var(--space-lg);
    background: var(--color-surface);
}

.financial-report-summary {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.financial-report-summary p {
    margin: 0;
    line-height: var(--line-height-md);
}


/* =====================================================
   3. REPORT HEADER / NARRATIVE BOXES
===================================================== */

.report-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-sm);
}

.report-header h2 {
    margin: 0;
    color: var(--color-primary);
    font-size: 22px;
}

.report-header h3 {
    margin: 0;
}

.report-headline {
    background: var(--color-primary-light);
    color: var(--color-primary);
    border-left: 5px solid var(--color-primary);
    padding: 16px;
    border-radius: var(--radius-md);
    font-size: 18px;
    font-weight: var(--font-weight-semibold);
    line-height: 1.4;
    margin-bottom: var(--space-lg);
}

.report-section {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: 18px;
}

.report-summary {
    margin: 24px 0 28px;
    font-size: 17px;
    line-height: var(--line-height-lg);
    color: var(--color-text-secondary);
}

.strength-box {
    background: var(--color-success-bg);
    border-left: 5px solid var(--color-success);
}

.risk-box {
    background: var(--color-warning-bg);
    border-left: 5px solid var(--color-warning);
}

.report-action-box {
    background: var(--color-warning-bg);
    border-left: 5px solid var(--color-warning);
    padding: 18px;
    border-radius: var(--radius-lg);
}

.interpretation-box {
    background: var(--color-info-bg);
    border-left: 5px solid var(--color-secondary);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
}

.action-box {
    background: var(--color-warning-bg);
    border-left: 5px solid var(--color-warning);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
}


/* =====================================================
   4. STATUS PILLS
===================================================== */

.report-status {
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-white);
}

.report-status.on-track {
    background: var(--color-success);
    color: var(--color-text-white);
}

.report-status.needs-attention {
    background: var(--color-warning);
    color: var(--color-text-white);
}

.report-status.critical {
    background: var(--color-error);
    color: var(--color-text-white);
}

.report-status.not-started {
    background: var(--color-neutral);
    color: var(--color-text-white);
}

/* =====================================================
   5. METRIC CARDS
===================================================== */

.report-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--space-md);
    margin: var(--space-md) 0;
}

.report-metric {
    background: var(--color-surface-alt);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-lg);
    padding: 16px;
    min-height: 80px;
    transition: var(--transition-fast);
}

.report-metric:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.metric-label {
    color: var(--color-text-secondary);
    font-size: var(--font-size-xs);
    margin-bottom: 6px;
}

.metric-value {
    color: var(--color-primary);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    line-height: 1.25;
}

.metric-chip {
    display: inline-block;
    background: var(--color-primary-light);
    color: var(--color-primary);
    padding: 6px 12px;
    border-radius: var(--radius-pill);
    font-size: 13px;
    margin-right: 6px;
    margin-top: 6px;
}


/* =====================================================
   6. PROGRESS
===================================================== */

.progress-section {
    margin-top: var(--space-sm);
}

.progress-title {
    margin-bottom: var(--space-sm);
    font-weight: var(--font-weight-semibold);
}

.progress-bar {
    width: 100%;
    height: 10px;
    background: var(--color-border-light);
    border-radius: var(--radius-pill);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--color-success);
}

.progress-text {
    margin-top: 6px;
    color: var(--color-text-secondary);
    font-size: var(--font-size-xs);
}


/* =====================================================
   7. GOAL FUNDING
===================================================== */

.goal-funding-bar {
    margin-top: var(--space-md);
}

.goal-funding-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--space-sm);
}


/* =====================================================
   8. REPORT INSIGHTS
===================================================== */

.report-insights {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-xl);
    margin-top: var(--space-xl);
}


/* =====================================================
   9. CHARTS
===================================================== */

.chart-placeholder {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 220px;
    background: var(--color-surface-alt);
    border: 2px dashed var(--color-border-light);
    border-radius: var(--radius-xl);
    color: var(--color-text-secondary);
    font-size: 15px;
}

.portfolio-chart {
    width: 100%;
    height: 220px;
}


/* =====================================================
   10. FINANCIAL HEALTH REPORT
===================================================== */

.financial-health-summary {
    background: var(--color-surface);
    padding: 32px;
    margin-bottom: var(--space-xl);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
}

.financial-health-summary h4 {
    margin-top: 28px;
}

.health-grid,
.health-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

.summary-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.summary-tag {
    padding: 8px 14px;
    border-radius: var(--radius-pill);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
}

.summary-tag.good {
    background: var(--color-success-bg);
    color: var(--color-success);
}

.summary-tag.warning {
    background: var(--color-warning-bg);
    color: #E67E22;
}

.summary-tag.danger {
    background: var(--color-error-bg);
    color: var(--color-error);
}


/* =====================================================
   11. FINANCIAL TIMELINE
===================================================== */

.financial-timeline {
    margin: var(--space-xl) 0;
    padding: 25px;
    background: var(--color-surface);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
}

.financial-timeline-wrapper {
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
    margin-top: var(--space-xl);
}

.journey-timeline {
    position: relative;
    height: 180px;
    margin-top: 35px;
}

.journey-main-line {
    position: absolute;
    left: 0;
    right: 0;
    top: 70px;
    height: 4px;
    background: var(--color-border);
}

.journey-node {
    position: absolute;
    transform: translateX(-50%);
    width: 120px;
    text-align: center;
}

.journey-date {
    font-size: 13px;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-md);
}

.journey-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    margin: auto;
    margin-bottom: var(--space-md);
    border: 4px solid var(--color-surface);
    box-shadow: 0 0 0 3px currentColor;
    background: var(--color-surface);
}

.journey-title {
    font-weight: var(--font-weight-bold);
    line-height: 20px;
}

.journey-age {
    color: var(--color-text-secondary);
    margin-top: var(--space-xs);
    font-size: 13px;
}

.journey-dot.goal {
    color: #2563EB;
}

.journey-dot.retirement {
    color: #7C3AED;
}

.journey-dot.exhaustion {
    color: #EF4444;
}

.journey-dot.today {
    color: #0F766E;
}


/* =====================================================
   12. MASTER REPORT
===================================================== */

.financial-master-report {
    margin-top: var(--space-xl);
    padding: var(--space-xl);
    color: var(--color-text-white);
    border-radius: var(--radius-xl);
    background: linear-gradient(
        135deg,
        var(--color-primary),
        var(--color-secondary)
    );
    box-shadow: var(--shadow-md);
}

.financial-master-report h3 {
    margin-top: 0;
    color: var(--color-text-white);
}

.financial-master-report p {
    opacity: 0.9;
}

.financial-master-report .report-actions {
    border: none;
    padding-top: 0;
}

.financial-master-report select {
    background: var(--color-surface);
}

.journey-features {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
    margin: var(--space-lg) 0;
}

.journey-features span {
    padding: 8px 14px;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.15);
}


/* =====================================================
   13. REPORT ACTIONS
===================================================== */

.report-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: var(--space-md);
    margin-top: var(--space-lg);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--color-border-light);
}

.report-granularity {
    width: 170px;
}


/* =====================================================
   14. REPORT TABLES
===================================================== */

.report-cell {
    vertical-align: top;
    padding: 16px;
    line-height: 1.45;
}

.report-number {
    text-align: right;
    white-space: nowrap;
}

.report-comment {
    text-align: left;
    vertical-align: top;
    min-width: 450px;
}

.comment-month {
    font-weight: var(--font-weight-bold);
    color: var(--color-primary);
    margin-top: 6px;
    margin-bottom: 6px;
}

.comment-line {
    padding-left: 18px;
    line-height: 1.35;
    margin-bottom: 3px;
}

.comment-divider {
    border-top: 1px solid var(--color-border-light);
    margin: 10px 0;
}

.report-html strong {
    display: block;
    color: var(--color-primary);
    font-size: var(--font-size-sm);
    margin: 0 0 4px;
}

.report-html br {
    line-height: var(--line-height-md);
}

.results-table tbody tr {
    border-bottom: 1px solid var(--color-border-light);
}


/* =====================================================
   15. PORTFOLIO SUMMARY
===================================================== */

.portfolio-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin: 24px 0;
}

.portfolio-summary-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-xl);
    padding: 18px;
    box-shadow: var(--shadow-sm);
}

.summary-title {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    margin-bottom: 6px;
    font-weight: var(--font-weight-semibold);
}

.summary-subtitle {
    font-size: 13px;
    color: var(--color-text-muted);
    margin-bottom: 14px;
}

.summary-value {
    font-size: 28px;
    font-weight: var(--font-weight-bold);
    color: var(--color-text-primary);
}

/* =====================================================
   PORTFOLIO GROWTH - NOT STARTED
===================================================== */

.portfolio-growth-disabled {
    background: var(--color-surface-alt);
    border: 1px solid var(--color-border-light);
    opacity: 0.85;
}

.portfolio-growth-disabled .portfolio-growth-header {
    color: var(--color-text-secondary);
}

.portfolio-growth-disabled .portfolio-growth-header h3 {
    color: var(--color-text-secondary);
}

.report-disabled-message {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: var(--space-lg);
    padding: 16px 18px;
    background: var(--color-border-light);
    border-left: 4px solid var(--color-text-muted);
    border-radius: var(--radius-md);
    color: var(--color-text-secondary);
}

.report-disabled-message strong {
    color: var(--color-text-secondary);
    font-weight: var(--font-weight-semibold);
}

.report-disabled-message span {
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
    line-height: var(--line-height-md);
}

/* =====================================================
   16. ALLOCATIONS
===================================================== */

.allocation-row {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: var(--space-lg);
    align-items: start;
    margin-bottom: var(--space-lg);
}

.allocation-field {
    display: flex;
    flex-direction: column;
}

.allocation-actions {
    display: flex;
    align-items: flex-start;
    padding-top: 28px;
}


/* =====================================================
   17. RESPONSIVE
===================================================== */

@media (max-width: 900px) {

    .health-grid,
    .health-columns,
    .report-insights {
        grid-template-columns: 1fr;
    }

    .portfolio-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .allocation-row {
        grid-template-columns: 1fr;
    }

    .allocation-actions {
        padding-top: 0;
    }
}

@media (max-width: 768px) {

    .accordion-summary {
        font-size: var(--font-size-md);
    }

    .report-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-md);
    }

    .portfolio-summary-grid {
        grid-template-columns: 1fr;
    }

    .report-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .report-granularity {
        width: 100%;
    }

    .report-comment {
        min-width: 300px;
    }

    .financial-health-summary {
        padding: var(--space-lg);
    }
}
