/* ── Compound Interest Calculator Specific Styles ───────────────────────
   Loaded after shared/styles.css for overrides and additions.
   ──────────────────────────────────────────────────────────────────── */

/* ── Future Value Banner ─────────────────────────────────────────── */

.compound-banner {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-gradient-dark) 100%);
    color: white;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 20px;
}

.compound-banner-label {
    font-size: 0.95rem;
    opacity: 0.85;
    margin-bottom: 6px;
}

.compound-banner-value {
    font-size: 2.4rem;
    font-weight: bold;
}

.compound-banner-subtitle {
    font-size: 0.85rem;
    opacity: 0.7;
    margin-top: 6px;
}

/* ── Chart Header ───────────────────────────────────────────────── */

.chart-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

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

.chart-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.chart-toggle input[type="checkbox"] {
    width: 15px;
    height: 15px;
    margin: 0;
    accent-color: var(--color-primary);
}

/* ── Breakdown Table ─────────────────────────────────────────────── */

.breakdown-table-wrapper {
    overflow: auto;
    max-height: 520px;
}

.breakdown-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.9rem;
    table-layout: fixed;
}

/* ── Sticky header row ─────────────────────────────────────────── */

.breakdown-table thead th {
    background: var(--surface-card);
    padding: 10px 12px;
    text-align: right;
    font-weight: 600;
    font-size: 0.82rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-bottom: 2px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 2;
}

.breakdown-table thead th:first-child {
    text-align: center;
    width: 60px;
    position: sticky;
    left: 0;
    z-index: 3;
}

/* ── Sticky first column ───────────────────────────────────────── */

.breakdown-table tbody td {
    padding: 8px 12px;
    text-align: right;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
}

.breakdown-table tbody td:first-child {
    text-align: center;
    font-weight: 600;
    color: var(--color-primary);
    background: var(--surface-card, #ffffff);
    position: sticky;
    left: 0;
    z-index: 1;
}

.breakdown-table tbody tr:hover {
    background: var(--color-light-tint, #f2f9ef);
}

.breakdown-table tbody tr:hover td:first-child {
    background: var(--color-light-tint, #f2f9ef);
}

.breakdown-table tbody tr.crossover-row {
    background: var(--color-primary);
    color: #ffffff;
}

.breakdown-table tbody tr.crossover-row td {
    color: #ffffff;
    font-weight: 600;
}

.breakdown-table tbody tr.crossover-row td:first-child {
    background: var(--color-primary);
    color: #ffffff;
}

.breakdown-table tbody tr.crossover-row:hover {
    background: var(--color-gradient-dark);
}

.breakdown-table tbody tr.crossover-row:hover td:first-child {
    background: var(--color-gradient-dark);
}

/* ── Collapsible Section Toggle ──────────────────────────────────── */

.section-toggle {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 28px;
}

.section-toggle::after {
    content: '\25B2';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.7em;
    color: var(--text-muted);
    transition: transform 0.2s;
}

.section-toggle.collapsed::after {
    transform: translateY(-50%) rotate(180deg);
}

.collapsed:not(.section-toggle) {
    display: none;
}

/* ── Responsive ──────────────────────────────────────────────────── */

@media (max-width: 768px) {
    .compound-banner {
        position: sticky;
        top: 0;
        z-index: 10;
        border-radius: 0;
        margin: 0 -15px;
        padding: 12px 15px;
    }

    .compound-banner-value {
        font-size: 1.8rem;
    }

    .breakdown-table-wrapper {
        max-height: 400px;
    }

    .breakdown-table {
        font-size: 0.82rem;
        width: auto;
        min-width: 560px;
    }

    .breakdown-table thead th,
    .breakdown-table tbody td {
        padding: 6px 8px;
    }
}
