/* TDS 105 - Klavye Yazım Teknikleri — ortak tasarım dili */
:root {
  /* Göz yormayan palet: saf beyaz ve saf siyah kullanılmaz */
  --brand: #4c5bd4;
  --brand-2: #6c55d6;
  --brand-3: #8b6fe0;
  --brand-soft: #e1e5fa;
  --grad: linear-gradient(135deg, #4c5bd4 0%, #6c55d6 55%, #8b6fe0 100%);
  --ink: #1f2a44;
  --ink-2: #3a4664;
  --muted: #65708a;
  --line: #d2d9e6;
  --bg: #e4e9f2;
  --card: #f4f6fb;
  --card-hi: #f9fafd;
  --card-2: #eaeef6;
  --ok: #15803d;
  --ok-soft: #d9f2e1;
  --bad: #c8293f;
  --bad-soft: #fbe1e5;
  --warn: #b45309;
  --warn-soft: #fbedcf;
  --info: #0369a1;
  --side: #36427a;
  --side-2: #44528f;
  --side-ink: #eef0fb;
  --side-muted: #bcc4e8;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(31, 42, 68, .05), 0 8px 24px -12px rgba(31, 42, 68, .18);
  --shadow-lg: 0 30px 70px -24px rgba(36, 44, 100, .35);
  --font: 'Plus Jakarta Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --display: 'Outfit', 'Plus Jakarta Sans', 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', 'Cascadia Mono', Consolas, monospace;
  color-scheme: light;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--brand); }
::selection { background: rgba(99, 102, 241, .22); }
:focus-visible { outline: 3px solid rgba(99, 102, 241, .45); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ------------------------------------------------------------------ */
/* Düğme ve form öğeleri                                               */
/* ------------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-weight: 700;
  font-size: 14px;
  line-height: 1.2;
  white-space: nowrap;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease, opacity .2s ease;
  text-decoration: none;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 10px 22px -10px rgba(79, 70, 229, .7); }
.btn-primary:hover:not(:disabled) { box-shadow: 0 14px 28px -10px rgba(79, 70, 229, .8); transform: translateY(-1px); }
.btn-ghost { background: var(--card); color: var(--ink-2); border-color: var(--line); }
.btn-ghost:hover:not(:disabled) { background: var(--card-2); border-color: #bcc5d8; }
.btn-soft { background: var(--brand-soft); color: var(--brand); }
.btn-soft:hover:not(:disabled) { background: #d4daf8; }
.btn-danger { background: var(--bad); color: #fff; box-shadow: 0 10px 22px -12px rgba(225, 29, 72, .8); }
.btn-danger:hover:not(:disabled) { background: #a81f33; }
.btn-success { background: linear-gradient(135deg, #22c55e, #059669); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 10px; }
.btn-icon { width: 38px; height: 38px; padding: 0; border-radius: 11px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 12.5px; font-weight: 700; color: var(--ink-2); letter-spacing: .01em; }
.input, .select, .textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--card-hi);
  font-size: 14.5px;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(99, 102, 241, .14); }
.textarea { resize: vertical; min-height: 120px; font-family: var(--mono); font-size: 13.5px; line-height: 1.55; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: var(--card-2);
  color: var(--ink-2);
  white-space: nowrap;
}
.chip-ok { background: var(--ok-soft); color: #166534; }
.chip-bad { background: var(--bad-soft); color: #9f1239; }
.chip-warn { background: var(--warn-soft); color: #92400e; }
.chip-info { background: #dcecf8; color: #075985; }
.chip-brand { background: var(--brand-soft); color: #3730a3; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }
.dot-live { background: #22c55e; box-shadow: 0 0 0 0 rgba(34, 197, 94, .6); animation: live-ping 1.8s ease-out infinite; }

/* Avatar */
.av {
  --s: 36px;
  width: var(--s);
  height: var(--s);
  flex: none;
  display: inline-grid;
  place-items: center;
  border-radius: calc(var(--s) * .32);
  background: linear-gradient(135deg, hsl(var(--h) 75% 58%), hsl(calc(var(--h) + 40) 70% 48%));
  color: #fff;
  font: 800 calc(var(--s) * .38) / 1 var(--display);
  letter-spacing: .02em;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .12);
  text-shadow: 0 1px 2px rgba(0, 0, 0, .15);
}

/* ------------------------------------------------------------------ */
/* Bildirim                                                            */
/* ------------------------------------------------------------------ */
.toasts {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(400px, calc(100vw - 36px));
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 14px;
  border-radius: 16px;
  background: #2f3a6e;
  color: #e6e9f8;
  box-shadow: 0 20px 50px -16px rgba(36, 44, 100, .55);
  animation: toast-in .4s cubic-bezier(.34, 1.56, .64, 1);
  font-size: 14px;
  line-height: 1.45;
  border: 1px solid rgba(255, 255, 255, .06);
}
.toast.out { animation: toast-out .25s ease forwards; }
.toast-ic {
  width: 26px;
  height: 26px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: #48548f;
  color: #fff;
  font-weight: 800;
  font-size: 14px;
}
.toast-success .toast-ic { background: #16a34a; }
.toast-error .toast-ic { background: #e11d48; }
.toast-warn .toast-ic { background: #d97706; }
.toast-info .toast-ic { background: #4f46e5; }
.toast-celebrate { background: linear-gradient(135deg, #3f4cb8, #7048c8); }
.toast-celebrate .toast-ic { background: rgba(255, 255, 255, .18); font-size: 16px; }
.toast-body { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.toast-body b { color: #fff; }
.toast-x { border: none; background: none; color: #b7bfe2; font-size: 18px; line-height: 1; padding: 2px 4px; }
.toast-x:hover { color: #fff; }

/* ------------------------------------------------------------------ */
/* Pencere                                                             */
/* ------------------------------------------------------------------ */
.mdl {
  position: fixed;
  inset: 0;
  z-index: 9500;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(40, 48, 90, .42);
  backdrop-filter: blur(6px);
  animation: fade-in .18s ease;
}
.mdl.out { animation: fade-out .2s ease forwards; }
.mdl-card {
  width: min(460px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 26px;
  border-radius: 24px;
  background: var(--card);
  box-shadow: var(--shadow-lg);
  animation: pop-in .4s cubic-bezier(.34, 1.56, .64, 1);
}
.mdl-icon { font-size: 40px; margin-bottom: 10px; }
.mdl-card h3 { font: 800 20px/1.3 var(--display); margin-bottom: 8px; }
.mdl-body { color: var(--ink-2); line-height: 1.6; font-size: 14.5px; }
.mdl-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

.confetti-canvas { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 9800; }

/* ------------------------------------------------------------------ */
/* Animasyonlar                                                        */
/* ------------------------------------------------------------------ */
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(18px) scale(.95); } to { opacity: 1; transform: none; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(30px); } }
@keyframes live-ping { 0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, .55); } 80%, 100% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shake-x { 10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(4px); } 30%, 50%, 70% { transform: translateX(-6px); } 40%, 60% { transform: translateX(6px); } }
@keyframes float-y { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
