/* LyDian COSMION — AI Farkındalık Premium Enterprise Styles
 * Used by: nabiz, kelebek-etkisi, karne, zaman-aynasi, umut-kalkan, ikiz-beyin, agoram
 * Design: Glassmorphism, KPI grid, tab bar, gauges, progress bars, cards
 * Compatible with: strategic-intel.css, dashboard.css, design-system.css
 */

/* ── Container ─────────────────────────────────────────────── */
.af-container { padding: 24px; max-width: 1400px; margin: 0 auto; }

/* ── Header ────────────────────────────────────────────────── */
.af-header { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.af-icon-box {
    width: 48px; height: 48px; border-radius: 14px; display: flex; align-items: center; justify-content: center;
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,0.06);
}
.af-title { margin: 0; font-size: 22px; font-weight: 700; color: var(--text-primary, var(--gray-100)); }
.af-subtitle { margin: 2px 0 0; font-size: 13px; color: var(--text-muted, var(--gray-400)); }
.af-status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.af-status-dot--on { background: var(--emerald-500); box-shadow: 0 0 6px #22c55e88; }
.af-status-dot--off { background: var(--red-500); box-shadow: 0 0 6px #E9745188; }

/* ── KPI Grid ──────────────────────────────────────────────── */
.af-kpi-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px; margin-bottom: 20px;
}
.af-kpi-card {
    background: rgba(255,255,255,0.03); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.06); border-radius: 12px; padding: 16px; text-align: center;
    transition: transform 0.2s ease, border-color 0.2s ease;
}
.af-kpi-card:hover { transform: translateY(-2px); border-color: rgba(255,255,255,0.12); }
.af-kpi-value {
    font-size: 28px; font-weight: 700; font-family: var(--font-mono, 'JetBrains Mono', monospace);
    line-height: 1.2;
}
.af-kpi-label { font-size: 11px; color: var(--text-muted, var(--gray-400)); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.5px; }
.af-kpi-sub { font-size: 10px; color: var(--text-muted, #666); margin-top: 2px; }
.af-kpi-spark { margin-top: 8px; display: flex; justify-content: center; }

/* ── Tab Bar ───────────────────────────────────────────────── */
.af-tab-bar {
    display: flex; gap: 0; border-bottom: 1px solid rgba(255,255,255,0.06);
    margin-bottom: 20px; overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.af-tab {
    padding: 10px 18px; font-size: 13px; font-weight: 500; color: var(--text-muted, var(--gray-400));
    border: none; background: none; cursor: pointer; white-space: nowrap;
    border-bottom: 2px solid transparent; transition: all 0.2s ease;
}
.af-tab:hover { color: var(--text-secondary, var(--gray-200)); }
.af-tab--active { color: var(--text-primary, var(--gray-100)); border-bottom-color: var(--af-accent, var(--purple-500)); }
.af-tab-content { display: none; }
.af-tab-content--active { display: block; animation: af-fadeIn 0.25s ease; }
@keyframes af-fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* ── Glass Card ────────────────────────────────────────────── */
.af-card {
    background: rgba(255,255,255,0.025); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.06); border-radius: 12px; padding: 20px;
    transition: border-color 0.2s ease;
}
.af-card:hover { border-color: rgba(255,255,255,0.1); }
.af-card-title {
    margin: 0 0 14px; font-size: 14px; font-weight: 600; color: var(--text-primary, var(--gray-100));
    display: flex; align-items: center; gap: 8px;
}
.af-card-title svg { flex-shrink: 0; }

/* ── Section Grid ──────────────────────────────────────────── */
.af-grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; }
.af-grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.af-grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.af-full-width { grid-column: 1 / -1; }

/* ── Distribution Bar ──────────────────────────────────────── */
.af-dist-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; }
.af-dist-label { flex: 0 0 100px; font-size: 12px; color: var(--text-muted, var(--gray-400)); text-align: right; }
.af-dist-track { flex: 1; height: 6px; background: rgba(255,255,255,0.05); border-radius: 3px; overflow: hidden; }
.af-dist-fill { height: 100%; border-radius: 3px; transition: width 0.6s ease; }
.af-dist-count { flex: 0 0 36px; font-size: 12px; font-weight: 600; color: var(--text-secondary, var(--gray-200)); text-align: right; }
.af-dist-pct { flex: 0 0 36px; font-size: 11px; color: var(--text-muted, var(--gray-400)); }

/* ── SVG Gauge ─────────────────────────────────────────────── */
.af-gauge { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; position: relative; }
.af-gauge-svg { width: 80px; height: 80px; }
.af-gauge-text {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    font-size: 16px; font-weight: 700; font-family: var(--font-mono, 'JetBrains Mono', monospace);
}
.af-gauge-label { font-size: 11px; color: var(--text-muted, var(--gray-400)); text-align: center; }

/* ── Timeline / Feed ───────────────────────────────────────── */
.af-timeline { display: flex; flex-direction: column; gap: 0; }
.af-tl-row {
    display: flex; gap: 12px; padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.af-tl-dot-col { display: flex; flex-direction: column; align-items: center; width: 12px; flex-shrink: 0; }
.af-tl-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.af-tl-line { width: 1px; flex: 1; background: rgba(255,255,255,0.06); }
.af-tl-body { flex: 1; min-width: 0; }
.af-tl-title { font-size: 13px; font-weight: 500; color: var(--text-primary, var(--gray-100)); }
.af-tl-sub { font-size: 11px; color: var(--text-muted, var(--gray-400)); margin-top: 2px; }
.af-tl-time { flex: 0 0 auto; font-size: 11px; color: var(--text-muted, #666); white-space: nowrap; }

/* ── Data Table ────────────────────────────────────────────── */
.af-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.af-table th {
    text-align: left; padding: 10px 12px; font-weight: 600; font-size: 11px;
    text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted, var(--gray-400));
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.af-table td {
    padding: 10px 12px; border-bottom: 1px solid rgba(255,255,255,0.04);
    color: var(--text-secondary, var(--gray-200));
}
.af-table tr:hover td { background: rgba(255,255,255,0.02); }

/* ── Badge ─────────────────────────────────────────────────── */
.af-badge { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 600; }
.af-badge--critical { background: rgba(233,116,81,0.15); color: var(--red-500); }
.af-badge--high { background: rgba(249,115,22,0.15); color: #f97316; }
.af-badge--medium { background: rgba(234,179,8,0.15); color: #eab308; }
.af-badge--low { background: rgba(34,197,94,0.15); color: var(--emerald-500); }
.af-badge--info { background: rgba(59,130,246,0.15); color: var(--blue-500); }
.af-badge--accent { background: rgba(var(--af-accent-rgb, 139,92,246), 0.15); color: var(--af-accent, var(--purple-500)); }

/* ── Progress Bar ──────────────────────────────────────────── */
.af-progress { height: 6px; background: rgba(255,255,255,0.05); border-radius: 3px; overflow: hidden; }
.af-progress-fill { height: 100%; border-radius: 3px; transition: width 0.6s ease; }

/* ── Empty State ───────────────────────────────────────────── */
.af-empty {
    padding: 32px; text-align: center; color: var(--text-muted, #666);
    font-size: 13px; border: 1px dashed rgba(255,255,255,0.08); border-radius: 10px;
}
.af-empty-icon { font-size: 32px; margin-bottom: 8px; opacity: 0.4; }

/* ── Spinner ───────────────────────────────────────────────── */
.af-spinner {
    display: inline-block; width: 16px; height: 16px;
    border: 2px solid rgba(var(--af-accent-rgb, 139,92,246), 0.25);
    border-top-color: var(--af-accent, var(--purple-500)); border-radius: 50%;
    animation: af-spin 0.6s linear infinite;
}
@keyframes af-spin { to { transform: rotate(360deg); } }
.af-loading { padding: 40px; text-align: center; color: var(--text-muted, var(--gray-400)); font-size: 14px; }

/* ── Sparkline (inline SVG) ────────────────────────────────── */
.af-sparkline svg { display: block; }

/* ── Action Button ─────────────────────────────────────────── */
.af-btn {
    display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px;
    border: 1px solid rgba(255,255,255,0.1); border-radius: 8px; font-size: 12px; font-weight: 500;
    color: var(--text-secondary, var(--gray-200)); background: rgba(255,255,255,0.03);
    cursor: pointer; transition: all 0.2s ease;
}
.af-btn:hover { background: rgba(255,255,255,0.07); border-color: rgba(255,255,255,0.15); }
.af-btn--accent {
    background: rgba(var(--af-accent-rgb, 139,92,246), 0.12);
    border-color: rgba(var(--af-accent-rgb, 139,92,246), 0.3);
    color: var(--af-accent, var(--purple-500));
}
.af-btn--accent:hover {
    background: rgba(var(--af-accent-rgb, 139,92,246), 0.2);
}

/* ── Radar Chart (SVG) ─────────────────────────────────────── */
.af-radar { display: flex; justify-content: center; }
.af-radar svg { max-width: 260px; max-height: 260px; }

/* ── Key-Value List ────────────────────────────────────────── */
.af-kv-list { display: flex; flex-direction: column; gap: 0; }
.af-kv-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.04);
}
.af-kv-key { font-size: 12px; color: var(--text-muted, var(--gray-400)); }
.af-kv-val { font-size: 13px; font-weight: 500; color: var(--text-primary, var(--gray-100)); }

/* ── Cross-link Bar ────────────────────────────────────────── */
.af-crosslink { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.af-crosslink a {
    display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px;
    border-radius: 6px; font-size: 11px; color: var(--text-muted, var(--gray-400));
    background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.06);
    text-decoration: none; transition: all 0.15s ease;
}
.af-crosslink a:hover { color: var(--text-secondary, var(--gray-200)); border-color: rgba(255,255,255,0.12); }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 768px) {
    .af-container { padding: 16px; }
    .af-kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .af-grid-2, .af-grid-3, .af-grid-4 { grid-template-columns: 1fr; }
    .af-tab { padding: 8px 12px; font-size: 12px; }
    .af-dist-label { flex: 0 0 70px; }
}
@media (max-width: 480px) {
    .af-kpi-grid { grid-template-columns: 1fr; }
    .af-header { flex-direction: column; align-items: flex-start; gap: 10px; }
}
