/* SoftAI Studio tasarım sistemi (v2) — renk tokenları Components/App.razor içindeki Tailwind config ile aynıdır. */
:root {
    --ink: #172033;
    --ink-soft: #3B4558;
    --muted: #657084;
    --faint: #98A1B2;
    --line: #E5E8EC;
    --line-strong: #D3D8DF;
    --surface: #FFFFFF;
    --surface-2: #F1F4F8;
    --canvas: #F6F7F9;
    --subtle: #F1F4F8;
    --primary: #2563EB;
    --primary-hover: #1D4FD8;
    --primary-soft: #EFF6FF;
    --primary-ring: #BFD5FB;
    --brand: #2563EB;
    --ai: #7C5CFC;
    --ai-soft: #F3F0FF;
    --success: #16A36A;
    --warning: #D97706;
    --danger: #DC3C30;
    --danger-soft: #FEF2F2;
    --danger-ink: #B42A20;
    --shadow-card: 0 1px 2px rgba(16,24,40,.04), 0 1px 3px rgba(16,24,40,.03);
    --shadow-card-hover: 0 4px 12px -2px rgba(16,24,40,.08), 0 2px 4px -2px rgba(16,24,40,.04);
}

body {
    font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    font-size: 14.5px;
    line-height: 22px;
    font-feature-settings: 'cv11', 'ss01';
}
code, pre, kbd, .font-mono {
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Consolas, monospace;
}

/* Kaydırma çubuğu: nötr ve ince */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: #D5D8DD;
    border-radius: 9999px;
    border: 3px solid transparent;
    background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: #B8BDC4; background-clip: content-box; }
* { scrollbar-color: #D5D8DD transparent; scrollbar-width: thin; }

/* Odak halkası: klavye ile gezinmede görünür, fareyle tıklamada değil */
:focus-visible { outline: 2px solid var(--primary-ring); outline-offset: 1px; }

/* ---------- Tipografi ---------- */
.t-page    { font-size: 24px; line-height: 32px; font-weight: 600; letter-spacing: -0.015em; color: var(--ink); }
.t-section { font-size: 17px; line-height: 24px; font-weight: 600; color: var(--ink); }
.t-sub     { font-size: 15px; line-height: 22px; font-weight: 600; color: var(--ink); }
.t-card    { font-size: 15px; line-height: 22px; font-weight: 600; color: var(--ink); }
.t-helper  { font-size: 13px; line-height: 19px; color: var(--muted); }
.t-body    { font-size: 14.5px; line-height: 22px; color: var(--ink-soft); }
.t-table   { font-size: 13.5px; line-height: 20px; }
.t-meta    { font-size: 12.5px; line-height: 18px; color: var(--muted); }
.t-label   { font-size: 12.5px; line-height: 18px; font-weight: 500; color: var(--muted); }
.num       { font-variant-numeric: tabular-nums; }

/* ---------- Tablo sözleşmesi ----------
   <div class="tbl-wrap"><table class="tbl">…</table></div>
   Sayı sütunu: class="num-col" (sağa dayalı, tabular). Satır menüsü sütunu: class="act-col". */
.tbl-wrap {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow-card);
    overflow: auto;
}
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; line-height: 20px; color: var(--ink); }
.tbl thead th {
    position: sticky; top: 0; z-index: 1;
    background: #F9FAFB;
    color: var(--muted);
    font-size: 12.5px; line-height: 18px; font-weight: 500;
    text-align: left; white-space: nowrap;
    padding: 9px 14px;
    border-bottom: 1px solid var(--line);
}
.tbl tbody td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: #F8FAFC; }
.tbl tbody tr.is-selected td { background: var(--subtle); }
.tbl tbody tr.is-selected td:first-child { box-shadow: inset 2px 0 0 var(--primary); }
.tbl tbody tr.is-clickable { cursor: pointer; }
.tbl .num-col { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl .act-col { width: 44px; text-align: right; padding-right: 8px; }
.tbl .muted { color: var(--muted); }
.tbl-compact tbody td { padding: 7px 12px; }
.tbl-compact thead th { padding: 7px 12px; }

/* ---------- Form kontrolleri ----------
   Tüm metin girişleri aynı yükseklik: md 36px, sm 32px. */
.field-input {
    display: block; width: 100%;
    height: 36px; padding: 0 11px;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    font-size: 14px; color: var(--ink);
    transition: border-color .12s, box-shadow .12s;
}
.field-input::placeholder { color: var(--faint); }
.field-input:hover { border-color: #BFC6CF; }
.field-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.field-input:disabled { background: var(--subtle); color: var(--muted); cursor: not-allowed; }
.field-input.is-invalid { border-color: var(--danger); }
.field-input.is-invalid:focus { box-shadow: 0 0 0 3px var(--danger-soft); }
.field-input.sm { height: 32px; font-size: 13.5px; padding: 0 10px; }
textarea.field-input { height: auto; min-height: 84px; padding: 8px 11px; line-height: 21px; resize: vertical; }
select.field-input {
    appearance: none; padding-right: 32px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23657084' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 10px center;
}
.field-check { width: 16px; height: 16px; border-radius: 4px; accent-color: var(--primary); cursor: pointer; }

/* Monaco kapsayıcısı */
.editor-wrapper {
    min-height: 420px;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
}

/* ---------- SoftAI markdown ---------- */
.softai-markdown { color: var(--ink); font-size: 14.5px; line-height: 23px; }
.softai-markdown pre {
    background-color: #1F2328;
    border: 1px solid #2D333B;
    border-radius: 8px;
    padding: 14px 16px;
    overflow-x: auto;
    color: #E6E8EB;
    font-size: 13px;
    line-height: 20px;
}
.softai-markdown code {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.88em;
    background-color: var(--subtle);
    color: var(--ink);
    padding: 1px 5px;
    border-radius: 4px;
    border: 1px solid var(--line);
}
.softai-markdown pre code {
    background-color: transparent;
    color: inherit;
    padding: 0;
    border: none;
    font-size: inherit;
}

/* Kod ara: eşleşen satır vurgusu */
.softdev-hit-line { background: rgba(250, 204, 21, 0.28); }

/* ---------- Kart ve hareket sistemi ----------
   Animasyonlar işlevseldir: sayfa girişi, kart hover, katman açılışı, çalışan ajan nabzı, akış çizgisi. */
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow-card);
}
.card-hover { transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease; }
.card-hover:hover { transform: translateY(-2px); box-shadow: var(--shadow-card-hover); border-color: var(--line-strong); }

@keyframes sh-page-enter { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
/* "backwards": animasyon bitince transform kalmaz; kalsaydı içerideki position:fixed pencereler (Dialog) sayfa kapsayıcısına göre konumlanıp yarım açılırdı. */
.page-enter { animation: sh-page-enter .2s ease-out backwards; }

@keyframes sh-layer-enter { from { opacity: 0; transform: scale(.98); } to { opacity: 1; transform: none; } }
.layer-enter { animation: sh-layer-enter .2s ease-out backwards; }
@keyframes sh-fade { from { opacity: 0; } to { opacity: 1; } }
.scrim-enter { animation: sh-fade .2s ease-out both; }

/* Çalışan durum: çok hafif nabız (halka) */
@keyframes sh-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(37,99,235,.28); } 50% { box-shadow: 0 0 0 5px rgba(37,99,235,0); } }
.pulse-soft { animation: sh-pulse 1.8s ease-in-out infinite; }
@keyframes sh-dot { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.dot-live { animation: sh-dot 1.6s ease-in-out infinite; }

/* Akış bağlantısı: veri akarken kesikli çizgi kayar */
@keyframes sh-dash { to { stroke-dashoffset: -22; } }
.flow-dash { stroke-dasharray: 6 5; animation: sh-dash .6s linear infinite; }
/* Akış topları (SVG animateMotion); tam ekranda arka plan düz kalsın */
.flow-box:fullscreen { background: var(--canvas, #F6F7F9); padding: 8px; }
.flow-ball { filter: drop-shadow(0 0 2px rgba(37,99,235,.35)); }

@media (prefers-reduced-motion: reduce) {
    .flow-ball { display: none !important; }
    .page-enter, .layer-enter, .scrim-enter, .pulse-soft, .dot-live, .flow-dash, .animate-fade-in, .animate-pulse {
        animation: none !important;
    }
    .card-hover, .card-hover:hover { transition: none; transform: none; }
    * { scroll-behavior: auto !important; }
}
