/* ============================================================
   Yigit Aku Toplanti Sistemi - Marka Katmani
   Metronic 8 uzerine, logodan turetilmis renk sistemi.
   Ana kirmizi: #EC1C24  |  Murekkep siyahi: #0F1115
   ============================================================ */

:root,
[data-bs-theme="light"] {
  --ya-red: #EC1C24;
  --ya-red-600: #D0151D;
  --ya-red-700: #A81017;
  --ya-red-100: #FDE8E9;
  --ya-red-050: #FEF4F4;
  --ya-ink: #0F1115;
  --ya-ink-700: #1C1F27;
  --ya-ink-500: #3A404E;

  --bs-primary: #EC1C24;
  --bs-primary-rgb: 236, 28, 36;
  --bs-primary-active: #D0151D;
  --bs-primary-light: #FDE8E9;
  --bs-primary-inverse: #FFFFFF;
  --bs-primary-clarity: rgba(236, 28, 36, .2);
  --bs-primary-bg-subtle: #FEF4F4;
  --bs-primary-border-subtle: #F8C4C6;
  --bs-primary-text-emphasis: #A81017;

  --bs-link-color: #D0151D;
  --bs-link-hover-color: #A81017;

  --ya-surface: #FFFFFF;
  --ya-page: #F6F7F9;
  --ya-border: #ECEEF2;
}

[data-bs-theme="dark"] {
  --ya-red: #FF3B42;
  --ya-red-600: #EC1C24;
  --ya-red-100: #3A1416;
  --ya-ink: #0B0D12;

  --bs-primary: #FF3B42;
  --bs-primary-rgb: 255, 59, 66;
  --bs-primary-active: #EC1C24;
  --bs-primary-light: #2E1214;
  --bs-primary-inverse: #FFFFFF;
  --bs-primary-clarity: rgba(255, 59, 66, .22);

  --ya-surface: #16181F;
  --ya-page: #0F1115;
  --ya-border: #262A34;
}

/* ---------- Kenar cubugu: murekkep siyahi, premium ---------- */
.app-sidebar {
  background: linear-gradient(180deg, #14161D 0%, #0F1115 100%);
  border-right: 1px solid rgba(255, 255, 255, .06);
}
.app-sidebar .menu-title { color: #A5ACBC; font-weight: 500; }
.app-sidebar .menu-icon i { color: #6E7686; }
.app-sidebar .menu-item .menu-link.active {
  background: linear-gradient(90deg, rgba(236, 28, 36, .18) 0%, rgba(236, 28, 36, 0) 100%);
  border-left: 3px solid var(--ya-red);
  border-radius: 0 8px 8px 0;
}
.app-sidebar .menu-item .menu-link.active .menu-title { color: #FFFFFF; font-weight: 600; }
.app-sidebar .menu-item .menu-link.active .menu-icon i { color: var(--ya-red); }
.app-sidebar .menu-item .menu-link:hover:not(.active) { background: rgba(255, 255, 255, .04); }
.app-sidebar .menu-item .menu-link:hover:not(.active) .menu-title { color: #E6E9F0; }
.app-sidebar-heading { color: #565E70 !important; letter-spacing: .08em; }
.ya-sidebar-logo { padding: 26px 22px 18px; border-bottom: 1px solid rgba(255, 255, 255, .06); }
.ya-sidebar-logo img { height: 30px; width: auto; }
.ya-sidebar-foot {
  padding: 14px 22px; border-top: 1px solid rgba(255, 255, 255, .06);
  color: #6E7686; font-size: 11px; letter-spacing: .04em;
}

/* ---------- Ust bar ---------- */
.app-header {
  background: var(--ya-surface);
  border-bottom: 1px solid var(--ya-border);
  box-shadow: 0 1px 2px rgba(15, 17, 21, .04);
}

/* ---------- Kartlar: yumusak, katmanli ---------- */
.card {
  border: 1px solid var(--ya-border);
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(15, 17, 21, .04), 0 8px 24px -16px rgba(15, 17, 21, .12);
}
.card .card-header { border-bottom: 1px solid var(--ya-border); min-height: 62px; }
.card .card-title { font-weight: 650; letter-spacing: -.01em; }

/* ---------- Istatistik kutulari ---------- */
.ya-stat {
  position: relative; overflow: hidden;
  border-radius: 14px; padding: 20px 22px;
  background: var(--ya-surface); border: 1px solid var(--ya-border);
  transition: transform .18s ease, box-shadow .18s ease;
}
.ya-stat:hover { transform: translateY(-2px); box-shadow: 0 12px 32px -18px rgba(15, 17, 21, .3); }
.ya-stat::after {
  content: ''; position: absolute; inset: 0 auto 0 0; width: 3px;
  background: var(--ya-accent, var(--ya-red));
}
.ya-stat-value { font-size: 28px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.ya-stat-label { font-size: 12.5px; color: var(--bs-gray-600); font-weight: 500; margin-top: 4px; }
.ya-stat-icon {
  width: 42px; height: 42px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  background: var(--ya-accent-soft, var(--bs-primary-light));
}
.ya-stat-icon i { font-size: 20px; color: var(--ya-accent, var(--ya-red)); }

/* ---------- Marka rozetleri ---------- */
.ya-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; line-height: 1.4;
  border: 1px solid transparent;
}
.ya-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.ya-online { background: #12B76A; box-shadow: 0 0 0 3px rgba(18, 183, 106, .18); }
.ya-offline { background: #98A2B3; }

/* ---------- Avatar ---------- */
.ya-avatar {
  width: 38px; height: 38px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 650; font-size: 13.5px; letter-spacing: .02em;
  flex-shrink: 0;
}
.ya-avatar-sm { width: 30px; height: 30px; border-radius: 8px; font-size: 11.5px; }
.ya-avatar-lg { width: 56px; height: 56px; border-radius: 14px; font-size: 19px; }

/* ---------- Giris ekrani ---------- */
.ya-login {
  min-height: 100vh; display: grid; grid-template-columns: 1fr;
  background: var(--ya-page);
}
@media (min-width: 992px) { .ya-login { grid-template-columns: 1.05fr .95fr; } }
.ya-login-art {
  display: none; position: relative; overflow: hidden;
  background:
    radial-gradient(900px 480px at 12% 8%, rgba(236, 28, 36, .28), transparent 62%),
    radial-gradient(700px 420px at 88% 92%, rgba(236, 28, 36, .14), transparent 60%),
    linear-gradient(160deg, #171A22 0%, #0B0D12 100%);
  padding: 64px 56px; color: #fff;
}
@media (min-width: 992px) { .ya-login-art { display: flex; flex-direction: column; justify-content: space-between; } }
.ya-login-art::before {
  content: ''; position: absolute; right: -140px; bottom: -160px;
  width: 560px; height: 560px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .05);
}
.ya-login-art::after {
  content: ''; position: absolute; right: -60px; bottom: -80px;
  width: 380px; height: 380px; border-radius: 50%;
  border: 1px solid rgba(236, 28, 36, .18);
}
.ya-login-form { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.ya-login-card { width: 100%; max-width: 420px; }

/* ---------- Tablolar ---------- */
.table.ya-table > thead > tr > th {
  text-transform: uppercase; font-size: 11px; letter-spacing: .07em;
  color: var(--bs-gray-500); font-weight: 650;
  border-bottom: 1px solid var(--ya-border); padding: 12px 10px;
}
.table.ya-table > tbody > tr { border-bottom: 1px solid var(--ya-border); }
.table.ya-table > tbody > tr:last-child { border-bottom: 0; }
.table.ya-table > tbody > tr:hover { background: var(--bs-gray-100); }
.table.ya-table > tbody > tr > td { padding: 13px 10px; vertical-align: middle; }

/* ---------- Bos durum ---------- */
.ya-empty { text-align: center; padding: 56px 20px; }
.ya-empty i { font-size: 44px; color: var(--bs-gray-400); }
.ya-empty h4 { margin-top: 14px; font-weight: 650; color: var(--bs-gray-700); }
.ya-empty p { color: var(--bs-gray-500); margin-top: 4px; }

/* ---------- Not govdesi ---------- */
.ya-note-body {
  white-space: pre-wrap; line-height: 1.7; font-size: 14px;
  color: var(--bs-gray-800);
}
.ya-note-preview {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; color: var(--bs-gray-600); font-size: 13px; line-height: 1.55;
}

/* ---------- Kod / endpoint kutusu ---------- */
.ya-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px; background: var(--ya-ink); color: #E4E7EC;
  border-radius: 10px; padding: 14px 16px; overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, .07); line-height: 1.65;
}
.ya-code .k { color: #FF7A80; }
.ya-code .s { color: #86E1A0; }
.ya-key {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px; background: var(--bs-gray-100); border: 1px solid var(--ya-border);
  border-radius: 7px; padding: 5px 9px; word-break: break-all;
}

/* ---------- Yukleniyor ---------- */
.ya-skeleton {
  background: linear-gradient(90deg, var(--bs-gray-200) 25%, var(--bs-gray-100) 37%, var(--bs-gray-200) 63%);
  background-size: 400% 100%; animation: ya-shimmer 1.3s ease infinite;
  border-radius: 7px;
}
@keyframes ya-shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---------- Cizim onizleme ---------- */
.ya-drawing {
  border: 1px solid var(--ya-border); border-radius: 10px;
  background: #fff; max-width: 100%; cursor: zoom-in;
}

/* ---------- Kucuk yardimcilar ---------- */
.ya-scroll { max-height: 420px; overflow-y: auto; }
.ya-scroll::-webkit-scrollbar { width: 6px; }
.ya-scroll::-webkit-scrollbar-thumb { background: var(--bs-gray-300); border-radius: 3px; }
.cursor-pointer { cursor: pointer; }
.ya-fade-in { animation: ya-fade .25s ease; }
@keyframes ya-fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Zengin metin not gövdesi ---------- */
.ya-note-body.ya-rich { white-space: normal; }
.ya-rich > *:first-child { margin-top: 0; }
.ya-rich > *:last-child { margin-bottom: 0; }
.ya-rich p { margin: 0 0 0.7em; line-height: 1.7; }
.ya-rich h1 { font-size: 1.5em; font-weight: 700; margin: 1em 0 0.4em; letter-spacing: -.01em; }
.ya-rich h2 { font-size: 1.28em; font-weight: 700; margin: 1em 0 0.4em; letter-spacing: -.01em; }
.ya-rich h3 { font-size: 1.12em; font-weight: 600; margin: 0.9em 0 0.35em; }
.ya-rich h4 { font-size: 1em;    font-weight: 600; margin: 0.9em 0 0.35em; }
.ya-rich ul, .ya-rich ol { padding-left: 1.4em; margin: 0 0 0.7em; }
.ya-rich li { margin-bottom: 0.3em; line-height: 1.65; }
.ya-rich li p { margin: 0; }
.ya-rich blockquote {
  border-left: 3px solid var(--ya-red);
  margin: 0.8em 0; padding: 0.2em 0 0.2em 1em;
  color: var(--bs-gray-600);
}
.ya-rich mark { background: #FFE68A; color: #0F1115; padding: 0 3px; border-radius: 3px; }
.ya-rich code {
  background: var(--bs-gray-100); border: 1px solid var(--ya-border);
  padding: 1px 5px; border-radius: 5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
}
.ya-rich pre {
  background: var(--ya-ink); color: #E4E7EC;
  padding: 14px 16px; border-radius: 10px; overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px; line-height: 1.6;
}
.ya-rich pre code { background: none; border: 0; padding: 0; color: inherit; }
.ya-rich a { color: var(--bs-primary); text-decoration: underline; }
.ya-rich hr { border: 0; border-top: 1px solid var(--ya-border); margin: 1.2em 0; }
.ya-rich ul[data-type="taskList"] { list-style: none; padding-left: 0.2em; }
.ya-rich ul[data-type="taskList"] li { display: flex; align-items: flex-start; gap: 0.55em; }
.ya-rich ul[data-type="taskList"] input[type="checkbox"] {
  accent-color: var(--ya-red); width: 1.05em; height: 1.05em; margin-top: 0.25em;
}

/* Görev listesi: editör <input type=checkbox> üretir. Basitleştirilmiş
   biçimde (yalnızca data-checked) gelen kayıtlar için görsel yedek. */
.ya-rich ul[data-type="taskList"] li:not(:has(input))::before {
  content: "☐"; color: var(--bs-gray-500); font-size: 1.05em; line-height: 1.5;
}
.ya-rich ul[data-type="taskList"] li[data-checked="true"]:not(:has(input))::before {
  content: "☑"; color: var(--ya-red);
}
.ya-rich ul[data-type="taskList"] li[data-checked="true"] { color: var(--bs-gray-500); }
