/* playground.css — /playground dashboard styles (dark theme, card grid) */

:root {
    --bg-primary: #0a0a14;
    --bg-card: rgba(20, 20, 35, 0.95);
    --bg-card-hover: rgba(25, 25, 45, 0.98);
    --border: rgba(255, 255, 255, 0.08);
    --text-primary: #e0e0e0;
    --text-secondary: rgba(255, 255, 255, 0.5);
    --text-muted: rgba(255, 255, 255, 0.3);
    --accent: #4fc3f7;
    --accent-dim: rgba(79, 195, 247, 0.15);
    --green: #66bb6a;
    --yellow: #ffd54f;
    --red: #ef5350;
    --orange: #ffa726;
    --purple: #ce93d8;
    --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
    --mono: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
    width: 100%; height: 100%;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font);
    overflow-x: hidden;
}

/* ── Header ─────────────────────────────── */
.pg-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: rgba(15, 15, 25, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.pg-header h1 {
    font-size: 18px;
    font-weight: 600;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 8px;
}

.pg-header .subtitle {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 400;
}

.pg-header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.pg-refresh-indicator {
    font-size: 11px;
    color: var(--text-muted);
    font-family: var(--mono);
}

.pg-back-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    transition: color 0.2s;
}

.pg-back-link:hover { color: var(--accent); }

/* ── Main Layout ────────────────────────── */
.pg-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
}

.pg-section { margin-bottom: 32px; }

.pg-section-title {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    padding-left: 4px;
}

.pg-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

/* ── Cards ──────────────────────────────── */
.pg-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    transition: background 0.2s, border-color 0.2s;
}

.pg-card:hover {
    background: var(--bg-card-hover);
    border-color: rgba(255, 255, 255, 0.12);
}

.pg-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.pg-card-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
}

.pg-card-icon { font-size: 18px; }

/* ── Metric Values ──────────────────────── */
.pg-metric-value {
    font-size: 32px;
    font-weight: 700;
    font-family: var(--mono);
    line-height: 1;
    margin-bottom: 4px;
}

.pg-metric-sub {
    font-size: 12px;
    color: var(--text-secondary);
    font-family: var(--mono);
}

.pg-metric-value.accent { color: var(--accent); }
.pg-metric-value.green  { color: var(--green); }
.pg-metric-value.red    { color: var(--red); }
.pg-metric-value.yellow { color: var(--yellow); }
.pg-metric-value.orange { color: var(--orange); }
.pg-metric-value.purple { color: var(--purple); }

/* ── Flight Breakdown ───────────────────── */
.pg-breakdown {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
}

.pg-breakdown-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pg-breakdown-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.pg-breakdown-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.pg-breakdown-dot.commercial { background: var(--text-primary); }
.pg-breakdown-dot.military   { background: var(--red); }
.pg-breakdown-dot.private    { background: var(--purple); }

.pg-breakdown-value {
    font-size: 14px;
    font-weight: 600;
    font-family: var(--mono);
    color: var(--text-primary);
}

/* ── Status Indicator ───────────────────── */
.pg-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 20px;
}

.pg-status.healthy  { color: var(--green);  background: rgba(102, 187, 106, 0.1); }
.pg-status.degraded { color: var(--yellow); background: rgba(255, 213, 79, 0.1); }
.pg-status.down     { color: var(--red);    background: rgba(239, 83, 80, 0.1); }

.pg-status-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: currentColor;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ── Data Sources ───────────────────────── */
.pg-sources { width: 100%; margin-top: 8px; }

.pg-source-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.pg-source-row:last-child { border-bottom: none; }

.pg-source-name { font-size: 13px; color: var(--text-primary); }

.pg-source-detail {
    font-size: 11px;
    color: var(--text-muted);
    font-family: var(--mono);
}

/* ── Guardrail Scanners ─────────────────── */
.pg-guard-scanners {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.pg-scanner-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0;
}

.pg-scanner-name { font-size: 13px; color: var(--text-primary); }

.pg-scanner-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
}

.pg-scanner-badge.loaded      { color: var(--green);      background: rgba(102, 187, 106, 0.1); }
.pg-scanner-badge.lazy        { color: var(--yellow);     background: rgba(255, 213, 79, 0.1); }
.pg-scanner-badge.unavailable { color: var(--text-muted); background: rgba(255, 255, 255, 0.05); }

/* ── Recent Blocks ──────────────────────── */
.pg-blocks-list {
    margin-top: 12px;
    max-height: 300px;
    overflow-y: auto;
}

.pg-block-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 12px;
}

.pg-block-item:last-child { border-bottom: none; }

.pg-block-time {
    color: var(--text-muted);
    font-family: var(--mono);
    white-space: nowrap;
    flex-shrink: 0;
}

.pg-block-scanner {
    color: var(--red);
    font-weight: 500;
    flex-shrink: 0;
}

.pg-block-text {
    color: var(--text-secondary);
    word-break: break-word;
}

/* ── Wide Card (full row) ───────────────── */
.pg-card-wide { grid-column: 1 / -1; }

/* ── Empty / Not Available ──────────────── */
.pg-empty {
    text-align: center;
    padding: 32px 16px;
    color: var(--text-muted);
    font-size: 13px;
}

.pg-empty-icon {
    font-size: 32px;
    margin-bottom: 8px;
    opacity: 0.5;
}

/* ── Scrollbar ──────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.2); }

/* ── Responsive ─────────────────────────── */
@media (max-width: 768px) {
    .pg-container { padding: 16px; }
    .pg-grid { grid-template-columns: 1fr; }
    .pg-header { padding: 12px 16px; }
    .pg-metric-value { font-size: 24px; }
}


/* ── Section Badge ──────────────────────── */
.pg-section-badge {
    font-size: 10px;
    font-weight: 500;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 8px;
    text-transform: none;
    letter-spacing: 0;
}

/* ── LangFuse Link ──────────────────────── */
.pg-langfuse-link {
    display: inline-block;
    color: var(--accent);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 10px 20px;
    border: 1px solid var(--accent);
    border-radius: 8px;
    transition: background 0.2s, color 0.2s;
}

.pg-langfuse-link:hover {
    background: var(--accent);
    color: var(--bg-primary);
}

/* ── Heatmap Grid ───────────────────────── */
.pg-heatmap-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
}

.pg-heatmap-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 8px;
    border-radius: 8px;
    text-align: center;
    transition: transform 0.15s;
}

.pg-heatmap-cell:hover {
    transform: scale(1.05);
}

.pg-heatmap-name {
    font-size: 11px;
    color: var(--text-primary);
    font-weight: 500;
    word-break: break-all;
    margin-bottom: 4px;
}

.pg-heatmap-count {
    font-size: 18px;
    font-weight: 700;
    font-family: var(--mono);
    color: var(--text-primary);
}
