/* java rehber — site + asistan paneli */

:root {
  --bg: #0a0d12;
  --panel-bg: #0e131a;
  --panel-2: #151d29;
  --line: #1d2634;
  --line-2: #2a3646;
  --text: #e8eef6;
  --text-2: #b9c5d4;
  --muted: #7d8b9e;
  --accent: #ff9e2c;
  --accent-2: #ffb864;
  --accent-dim: rgba(255, 158, 44, 0.1);
  --teal: #4ec9b0;

  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", Menlo, Consolas, monospace;

  --shell: 900px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.locked { overflow: hidden; }

::selection { background: rgba(255, 158, 44, 0.28); }

/* ================= topbar ================= */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 13, 18, 0.82);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
}

.topbar-inner {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 13px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: var(--text);
  user-select: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: linear-gradient(160deg, var(--accent), #d97810);
  font-size: 14px;
  line-height: 1;
}

.brand-name {
  font-family: var(--mono);
  font-size: 14.5px;
  letter-spacing: -0.02em;
  font-weight: 600;
}
.brand-name span { color: var(--accent); }

.topnav { display: flex; gap: 22px; }
.topnav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  transition: color 0.15s;
}
.topnav a:hover { color: var(--text); }

/* ================= doc ================= */

.doc {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 22px 80px;
}

.doc-hero {
  padding: 72px 0 54px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 20px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  opacity: 0.8;
}

.doc-hero h1 {
  margin: 0 0 18px;
  font-size: clamp(30px, 4.6vw, 44px);
  line-height: 1.12;
  letter-spacing: -0.035em;
  font-weight: 640;
  background: linear-gradient(180deg, #ffffff 25%, #9fadc0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lede {
  max-width: 640px;
  margin: 0 0 26px;
  font-size: 15.5px;
  line-height: 1.7;
  color: var(--muted);
}

.meta-row { display: flex; flex-wrap: wrap; gap: 8px; }

.pill {
  padding: 4px 10px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}

.block { padding: 48px 0 0; }

.block-title {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 0 0 22px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text);
}

.block-title .num {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  opacity: 0.65;
  letter-spacing: 0.08em;
}

.cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.card {
  padding: 18px 19px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.022), rgba(255, 255, 255, 0));
  transition: border-color 0.18s ease;
}
.card:hover { border-color: var(--line-2); }

.card h3 {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
}
.card h3 em {
  font-family: var(--mono);
  font-size: 10px;
  font-style: normal;
  letter-spacing: 0.06em;
  color: var(--accent);
  opacity: 0.7;
}

.card p {
  margin: 0 0 12px;
  font-size: 13.2px;
  line-height: 1.62;
  color: var(--muted);
}

.card pre, .code-panel pre {
  margin: 0;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #070a0e;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.6;
  color: #cfdae7;
}

.note-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.note {
  padding: 16px 18px;
  border-left: 2px solid var(--accent-dim);
  border-radius: 0 10px 10px 0;
  background: rgba(255, 255, 255, 0.018);
}
.note h3 {
  margin: 0 0 7px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-2);
}
.note p { margin: 0; font-size: 13px; line-height: 1.62; color: var(--muted); }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }

table { border-collapse: collapse; width: 100%; font-size: 13px; }
thead th {
  text-align: left;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.025);
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}
tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--text-2);
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(255, 255, 255, 0.015); }

.code-head {
  display: flex;
  align-items: center;
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 10px 10px 0 0;
  background: rgba(255, 255, 255, 0.025);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}
.code-panel pre { border-radius: 0 0 10px 10px; }

.bullets {
  margin: 18px 0 0;
  padding-left: 20px;
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--muted);
}
.bullets li { margin: 6px 0; }
.bullets li::marker { color: var(--line-2); }

.errors { border-top: 1px solid var(--line); }

details {
  border-bottom: 1px solid var(--line);
  padding: 14px 2px;
}
details summary {
  cursor: pointer;
  font-size: 13.5px;
  color: var(--text-2);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 9px;
}
details summary::-webkit-details-marker { display: none; }
details summary::before {
  content: "+";
  font-family: var(--mono);
  color: var(--accent);
  font-size: 14px;
  width: 12px;
}
details[open] summary::before { content: "−"; }
details p {
  margin: 10px 0 4px 21px;
  font-size: 13px;
  line-height: 1.68;
  color: var(--muted);
}

/* ortak code */

code {
  font-family: var(--mono);
  font-size: 0.88em;
  padding: 1.5px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.055);
  color: #ffcb8a;
}
pre code { background: none; padding: 0; color: inherit; }

/* footer */

.footer {
  border-top: 1px solid var(--line);
  margin-top: 30px;
}
.footer-inner {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 20px 22px 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-family: var(--mono);
  font-size: 11px;
  color: #4d5a6b;
}
.footer-right { display: flex; align-items: center; gap: 14px; }

.ghostmark {
  color: #2b3442;
  user-select: none;
  transition: color 0.4s ease;
}
.ghostmark:hover { color: #4d5a6b; }

.kbd-hint {
  color: #323d4d;
  border: 1px solid #1c2531;
  border-radius: 5px;
  padding: 2px 6px;
  font-size: 10px;
  user-select: none;
  cursor: default;
  transition: color 0.25s, border-color 0.25s;
}
.kbd-hint:hover { color: var(--muted); border-color: var(--line-2); }

/* ================= panel ================= */

.scrim {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(4, 6, 9, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  animation: fade 0.18s ease forwards;
}
@keyframes fade { to { opacity: 1; } }

.panel {
  position: fixed;
  z-index: 61;
  top: 50%;
  left: 50%;
  width: min(920px, calc(100vw - 32px));
  height: min(88dvh, 900px);
  transform: translate(-50%, -46%);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line-2);
  border-radius: 18px;
  background: var(--panel-bg);
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.72), 0 0 0 1px rgba(255, 255, 255, 0.02) inset;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease, transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.18s;
}

.panel.open {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%);
}

.panel-head {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 13px 11px 17px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.014);
}

.panel-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--text-2);
}
.panel-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 8px rgba(78, 201, 176, 0.75);
}

.panel-actions { display: flex; align-items: center; gap: 7px; }

.icon-btn {
  display: grid;
  place-items: center;
  width: 30px; height: 30px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.icon-btn:hover { color: var(--text); border-color: #3a4a5e; background: var(--panel-2); }

.model-select {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: transparent;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
  transition: border-color 0.15s, color 0.15s;
}
.model-select:hover, .model-select:focus-visible {
  border-color: #3a4a5e; color: var(--text-2); outline: none;
}

.ms-kicker {
  font-size: 9.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #4d5a6b;
  padding-right: 6px;
  border-right: 1px solid var(--line-2);
  margin-right: 2px;
}

.model-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 250px;
  max-height: min(360px, 60vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px;
  border: 1px solid var(--line-2);
  border-radius: 11px;
  background: #0c1119;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  display: none;
  z-index: 70;
}
.model-menu.open { display: block; }

.model-menu button {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-2);
  text-align: left;
  font-family: inherit;
  font-size: 12.5px;
  cursor: pointer;
}
.model-menu button:hover { background: var(--panel-2); color: var(--text); }
.model-menu button[aria-selected="true"] { background: var(--accent-dim); color: var(--accent-2); }
.model-menu .mm-hint { font-size: 10.5px; color: var(--muted); font-family: var(--mono); }

.panel-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 26px 16px;
  scrollbar-width: thin;
  scrollbar-color: #23303f transparent;
}
.panel-body::-webkit-scrollbar { width: 9px; }
.panel-body::-webkit-scrollbar-thumb { background: #1c2733; border-radius: 5px; border: 2px solid var(--panel-bg); }

/* hero (panel içi) */

.hero { padding: 48px 0 8px; text-align: center; }
.hero.hidden { display: none; }

.hero h1 {
  margin: 0 0 16px;
  font-size: clamp(24px, 3.6vw, 33px);
  line-height: 1.15;
  letter-spacing: -0.035em;
  font-weight: 640;
  background: linear-gradient(180deg, #ffffff 25%, #a3b1c4 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero h1 span { color: var(--accent); -webkit-text-fill-color: var(--accent); }

.hero-sub {
  max-width: 520px;
  margin: 0 auto 30px;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--muted);
}

.suggestions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  text-align: left;
}

.sug {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.018);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.16s, background 0.16s, transform 0.16s;
}
.sug:hover {
  border-color: rgba(255, 158, 44, 0.38);
  background: rgba(255, 158, 44, 0.06);
  transform: translateY(-1px);
}
.sug-tag {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--accent);
  opacity: 0.8;
}
.sug-title { font-size: 12.8px; color: var(--text-2); font-weight: 500; }

/* thread */

.thread { display: flex; flex-direction: column; gap: 24px; padding-top: 10px; }

.msg {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 12px;
  animation: rise 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.msg-avatar {
  width: 28px; height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  border: 1px solid var(--line-2);
  background: var(--panel-2);
  color: var(--text-2);
}
.msg.assistant .msg-avatar {
  background: linear-gradient(160deg, var(--accent), #d97810);
  border-color: transparent;
  color: #12161c;
  font-weight: 700;
}

.msg-body { min-width: 0; }
.msg-role {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #5b6879;
  margin-bottom: 7px;
}
.msg.assistant .msg-role { color: var(--accent); opacity: 0.7; }

.msg-content { font-size: 14px; line-height: 1.72; color: var(--text-2); overflow-wrap: anywhere; }

.msg.user .msg-content {
  display: inline-block;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--panel-2);
  color: var(--text);
  white-space: pre-wrap;
}

/* markdown */

.msg-content > *:first-child { margin-top: 0; }
.msg-content > *:last-child { margin-bottom: 0; }
.msg-content p { margin: 0 0 12px; }
.msg-content h2, .msg-content h3 {
  margin: 22px 0 9px;
  color: var(--text);
  font-weight: 620;
  letter-spacing: -0.015em;
}
.msg-content h2 { font-size: 16px; }
.msg-content h3 { font-size: 14.5px; }
.msg-content ul, .msg-content ol { margin: 0 0 12px; padding-left: 21px; }
.msg-content li { margin: 5px 0; }
.msg-content li::marker { color: #556276; }
.msg-content a { color: var(--accent-2); }
.msg-content strong { color: var(--text); font-weight: 600; }
.msg-content hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }

.codeblock {
  margin: 13px 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #070a0e;
}
.codeblock-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 11px;
  background: #0b1017;
  border-bottom: 1px solid var(--line);
}
.codeblock-lang {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #5b6879;
}
.copy-btn {
  padding: 3px 7px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: #5b6879;
  font-family: var(--mono);
  font-size: 10px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}
.copy-btn:hover { color: var(--text-2); background: rgba(255, 255, 255, 0.05); }
.copy-btn.done { color: var(--teal); }

.codeblock pre {
  margin: 0;
  padding: 12px 14px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.65;
  color: #d6e0ec;
  tab-size: 4;
}

.tok-kw { color: #cf8ee8; }
.tok-type { color: #6fd3c4; }
.tok-str { color: #9ddc8a; }
.tok-num { color: #f0b26b; }
.tok-com { color: #5c6b80; font-style: italic; }
.tok-ann { color: #e8c46a; }

.table-wrap { overflow-x: auto; margin: 13px 0; border: 1px solid var(--line); border-radius: 9px; }
.msg-content table { font-size: 12.5px; }
.msg-content th, .msg-content td { padding: 7px 11px; text-align: left; border-bottom: 1px solid var(--line); }
.msg-content th { background: var(--panel-2); color: var(--text); font-weight: 600; }
.msg-content tr:last-child td { border-bottom: 0; }

.cursor {
  display: inline-block;
  width: 7px; height: 14px;
  margin-left: 2px;
  vertical-align: -2px;
  background: var(--accent);
  border-radius: 1px;
  animation: blink 1s steps(2, start) infinite;
}
@keyframes blink { 0%, 50% { opacity: 1; } 50.01%, 100% { opacity: 0; } }

.thinking {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel-2);
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
}
.thinking i {
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.2s ease-in-out infinite;
}
.thinking i:nth-child(2) { animation-delay: 0.15s; }
.thinking i:nth-child(3) { animation-delay: 0.3s; }
@keyframes pulse {
  0%, 100% { opacity: 0.25; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-2px); }
}

.fallback-note {
  display: inline-block;
  margin-bottom: 10px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.02);
  font-family: var(--mono);
  font-size: 10.5px;
  color: #6b7a8d;
}

.err-box {
  padding: 11px 13px;
  border: 1px solid rgba(242, 112, 122, 0.35);
  border-radius: 9px;
  background: rgba(242, 112, 122, 0.07);
  color: #f5a0a7;
  font-size: 13px;
}

/* composer */

.composer-wrap {
  flex: none;
  padding: 12px 20px 12px;
  border-top: 1px solid var(--line);
  background: var(--panel-bg);
}

.composer {
  display: flex;
  align-items: flex-end;
  gap: 9px;
  padding: 8px 8px 8px 15px;
  border: 1px solid var(--line-2);
  border-radius: 13px;
  background: #0b1017;
  transition: border-color 0.16s, box-shadow 0.16s;
}
.composer:focus-within {
  border-color: rgba(255, 158, 44, 0.45);
  box-shadow: 0 0 0 3px rgba(255, 158, 44, 0.08);
}

.composer textarea {
  flex: 1;
  min-height: 22px;
  max-height: 160px;
  padding: 7px 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.55;
  resize: none;
  outline: none;
}
.composer textarea::placeholder { color: #56637a; }

.send {
  flex: none;
  display: grid;
  place-items: center;
  width: 32px; height: 32px;
  border: 0;
  border-radius: 9px;
  background: var(--accent);
  color: #12161c;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s, transform 0.1s;
}
.send:hover:not(:disabled) { background: var(--accent-2); }
.send:active:not(:disabled) { transform: scale(0.94); }
.send:disabled { background: #212b38; color: #56637a; cursor: not-allowed; }

.send.busy svg { display: none; }
.send.busy::after {
  content: "";
  width: 12px; height: 12px;
  border: 2px solid rgba(18, 22, 28, 0.35);
  border-top-color: #12161c;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.composer-hint {
  margin: 8px 0 0;
  text-align: center;
  font-size: 10.5px;
  color: #4d5a6b;
  font-family: var(--mono);
}

/* ================= responsive ================= */

@media (max-width: 820px) {
  .cards, .note-grid { grid-template-columns: 1fr; }
  .topnav { display: none; }
  .suggestions { grid-template-columns: 1fr 1fr; }
  .doc-hero { padding: 48px 0 38px; }
}

@media (max-width: 640px) {
  .panel {
    top: 0; left: 0;
    width: 100vw;
    height: 100dvh;
    transform: none;
    border-radius: 0;
    border: 0;
  }
  .panel.open { transform: none; }
  .panel-body { padding: 0 15px 12px; }
  .composer-wrap { padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); }
  .hero { padding-top: 28px; }
  .suggestions { grid-template-columns: 1fr; }
  .doc { padding: 0 16px 60px; }
  .doc-hero h1 { font-size: 27px; }
  .footer-inner { padding: 18px 16px 26px; }
  .msg { grid-template-columns: 24px minmax(0, 1fr); gap: 10px; }
  .msg-avatar { width: 24px; height: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}
