/* ============================================
   PATRIOT TECH SYSTEMS - CHART STYLES
   Chart containers, legends, and theme integration
   ============================================ */

/* ---- CHART CONTAINERS ---- */
.pt-chart-container {
    position: relative;
    width: 100%;
    padding: var(--pt-space-4);
    background: var(--pt-card-bg);
    border: 1px solid var(--pt-card-border);
    border-radius: var(--pt-card-radius);
}

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

.pt-chart-title {
    font-size: var(--pt-text-md);
    font-weight: var(--pt-font-semibold);
    color: var(--pt-text-primary);
}

.pt-chart-actions {
    display: flex;
    align-items: center;
    gap: var(--pt-space-2);
}

.pt-chart-wrapper {
    position: relative;
    height: 300px;
}

.pt-chart-wrapper.sm { height: 200px; }
.pt-chart-wrapper.lg { height: 400px; }

.pt-chart-wrapper canvas {
    max-width: 100%;
}

/* ---- CHART LEGEND ---- */
.pt-chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: var(--pt-space-4);
    margin-top: var(--pt-space-4);
    padding-top: var(--pt-space-3);
    border-top: 1px solid var(--pt-border-default);
}

.pt-legend-item {
    display: flex;
    align-items: center;
    gap: var(--pt-space-2);
    font-size: var(--pt-text-sm);
    color: var(--pt-text-secondary);
}

.pt-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ---- CHART PERIOD SWITCHER ---- */
.pt-chart-periods {
    display: flex;
    background: var(--pt-bg-surface);
    border-radius: var(--pt-radius-md);
    padding: 2px;
    gap: 2px;
}

.pt-chart-period {
    padding: 0.25rem 0.75rem;
    border-radius: var(--pt-radius-sm);
    font-size: var(--pt-text-sm);
    font-weight: var(--pt-font-medium);
    color: var(--pt-text-muted);
    cursor: pointer;
    transition: all var(--pt-transition-fast);
    border: none;
    background: transparent;
    font-family: inherit;
}

.pt-chart-period:hover {
    color: var(--pt-text-primary);
}

.pt-chart-period.active {
    background: var(--pt-interactive-primary);
    color: var(--pt-color-white);
}

/* ---- CHART TOOLTIP (custom overlay) ---- */
.pt-chart-tooltip {
    position: absolute;
    pointer-events: none;
    background: var(--pt-bg-elevated);
    border: 1px solid var(--pt-border-default);
    border-radius: var(--pt-radius-md);
    padding: var(--pt-space-3);
    box-shadow: var(--pt-shadow-lg);
    z-index: var(--pt-z-dropdown);
    font-size: var(--pt-text-sm);
    max-width: 240px;
}

.pt-chart-tooltip-title {
    font-weight: var(--pt-font-semibold);
    color: var(--pt-text-primary);
    margin-bottom: var(--pt-space-2);
}

.pt-chart-tooltip-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--pt-space-4);
    padding: 2px 0;
}

.pt-chart-tooltip-label {
    display: flex;
    align-items: center;
    gap: var(--pt-space-2);
    color: var(--pt-text-secondary);
}

.pt-chart-tooltip-value {
    font-weight: var(--pt-font-semibold);
    color: var(--pt-text-primary);
}

/* ---- MINI SPARKLINE CONTAINERS ---- */
.pt-sparkline {
    width: 80px;
    height: 32px;
    display: inline-block;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 575.98px) {
    .pt-chart-wrapper { height: 220px; }
    .pt-chart-wrapper.lg { height: 280px; }
    .pt-chart-header { flex-direction: column; align-items: flex-start; gap: var(--pt-space-2); }
}
