/* ═══════════════════════════════════════════
   CTC CALCULATOR — Tool-Specific Styles
   ═══════════════════════════════════════════ */

/* ── Canvas Pie Chart ── */
.chart-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    margin: 30px 0;
    gap: 36px;
}

.chart-canvas-wrapper {
    position: relative;
    flex-shrink: 0;
}

#salaryChart {
    cursor: pointer;
    transition: transform 0.3s ease;
    border-radius: 50%;
}

#salaryChart:hover {
    transform: scale(1.03);
}

.pie-tooltip {
    position: fixed;
    background: var(--bg-elevated);
    color: var(--text-bright);
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 1000;
    white-space: nowrap;
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.pie-tooltip.show {
    opacity: 1;
}

.chart-legend-detailed {
    font-size: 0.88rem;
    min-width: 0;
    flex: 1;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    transition: background 0.2s;
    cursor: default;
}

.legend-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 12px;
    flex-shrink: 0;
}

.legend-item div {
    display: flex;
    flex-direction: column;
    min-width: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.legend-item strong {
    color: var(--text-bright);
    font-size: 0.88rem;
    white-space: nowrap;
}

.legend-item small {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 2px;
}

/* ── Breakdown Table ── */
.breakdown-table {
    width: 100%;
    margin-top: 24px;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
}

.breakdown-table th,
.breakdown-table td {
    padding: 12px 16px;
    text-align: left;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border);
}

.breakdown-table th {
    background: var(--bg-elevated);
    color: var(--text-bright);
    font-weight: 700;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.breakdown-table td {
    color: var(--text-muted);
    background: var(--bg-surface);
}

.breakdown-table td:last-child {
    text-align: right;
    font-weight: 600;
    color: var(--text-main);
    font-variant-numeric: tabular-nums;
}

.breakdown-table tr:last-child td {
    border-bottom: none;
}

.breakdown-table .total-row td {
    background: rgba(99, 102, 241, 0.08);
    color: var(--text-bright);
    font-weight: 700;
    font-size: 0.95rem;
}

/* ── CTC Responsive ── */
@media (max-width: 768px) {
    .chart-container {
        flex-direction: column;
    }

    #salaryChart {
        max-width: 200px;
        max-height: 200px;
    }

    .breakdown-table th,
    .breakdown-table td {
        padding: 10px 12px;
        font-size: 0.82rem;
    }
}

@media (max-width: 480px) {
    .legend-item {
        padding: 6px 8px;
    }

    .legend-item strong {
        font-size: 0.82rem;
    }

    .legend-item small {
        font-size: 0.75rem;
    }
}