/* ── Analytics Controls ── */
.analytics-charts-wrap { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow: hidden; }
.analytics-controls { display: flex; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; flex-shrink: 0; align-items: center; }
.analytics-controls .glow-btn.active { color: #000; font-weight: 700; }
.analytics-controls .glow-btn.active::after { background: var(--glow); }

/* ── Charts Grid & Cards ── */
.chart-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}
.chart-grid--compact {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}
.chart-grid--compact .chart-card--compact {
    min-height: 300px;
}
.chart-card--compact {
    padding: 12px 14px !important;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}
.chart-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-shrink: 0;
}
.chart-card-header h4 {
    font-size: 0.85rem;
    margin: 0;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chart-card--compact canvas {
    flex: 1;
    min-height: 0;
    width: 100% !important;
}

/* ── Chart Action Buttons (Zoom/Print) ── */
.chart-action-btn {
    background: transparent;
    border: none;
    color: var(--glow);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    opacity: 0.8;
}
.chart-action-btn:hover {
    opacity: 1;
    background: rgba(var(--glow-rgb), 0.15);
    transform: scale(1.05);
}

.chart-zoom-content {
    background: var(--bg-card);
    width: 90vw;
    height: 85vh;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    padding: 24px;
    position: relative;
    border: 1px solid var(--border);
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}

.chart-zoom-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.chart-zoom-header h3 {
    margin: 0;
    color: #fff;
}

.chart-zoom-body {
    flex: 1;
    min-height: 0;
    position: relative;
}

/* ── Mobile Landscape Zoom ── */
@media (max-width: 768px) {
    .chart-grid { grid-template-columns: 1fr; }
    
    .chart-zoom-content {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
        padding: 15px;
    }

    /* Force landscape via rotation if needed, or just let users rotate */
    /* Implementation choice: Let's make it fixed landscape for the best chart view */
    body.chart-zoomed-mobile {
        overflow: hidden;
        position: fixed;
        width: 100%;
        height: 100%;
    }
    
    /* When zoomed on mobile, we rotate the content if in portrait */
    @media (orientation: portrait) {
        .chart-zoom-content {
            transform: rotate(90deg);
            transform-origin: center;
            width: 100vh;
            height: 100vw;
            position: fixed;
            top: 50%;
            left: 50%;
            margin-top: -50vw;
            margin-left: -50vh;
        }
    }
}
