/* ozturksahin.com — mesaj paneli. Portfolyoyla aynı tasarım dili; harici kaynak yok. */
:root {
  --bg: #0b0d17;
  --surface: rgba(255, 255, 255, 0.05);
  --surface-2: rgba(255, 255, 255, 0.09);
  --hover: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.12);
  --text: #eceefb;
  --muted: #9aa0c0;
  --accent: #7c83ff;
  --accent-2: #22d3ee;
  --accent-text: #0b0d17;
  --ok: #34d399;
  --danger: #f87171;
  --grad: linear-gradient(120deg, #7c83ff, #22d3ee);
  --shadow: 0 14px 40px rgba(0, 0, 0, 0.4);
  color-scheme: dark;
}
[data-theme='light'] {
  --bg: #f4f5fc;
  --surface: rgba(255, 255, 255, 0.85);
  --surface-2: #ffffff;
  --hover: rgba(60, 70, 160, 0.07);
  --border: rgba(30, 34, 80, 0.13);
  --text: #171a33;
  --muted: #5b6183;
  --accent: #4f56e8;
  --accent-2: #0891b2;
  --accent-text: #ffffff;
  --ok: #059669;
  --danger: #dc2626;
  --shadow: 0 12px 34px rgba(50, 60, 140, 0.14);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  /* no-repeat + fixed: içerik ekrandan uzunsa (kısa ekran, mobilde klavye açık) gradyan ikinci kez döşenip dikiş oluşturmasın */
  background: radial-gradient(900px 500px at 15% -10%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 60%) no-repeat fixed, var(--bg);
  color: var(--text); font: 15px/1.55 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
a { color: var(--accent-2); }
h1, h2, h3, h4, p { margin: 0; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; border-radius: 8px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.center { min-height: 100%; display: grid; place-items: center; padding: 20px; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--border); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.logo { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 13px; background: var(--grad); color: #fff; font-weight: 800; font-size: 20px; box-shadow: 0 8px 22px color-mix(in srgb, var(--accent) 40%, transparent); }
.logo.sm { width: 32px; height: 32px; border-radius: 10px; font-size: 16px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 22px; box-shadow: var(--shadow); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.login { width: 100%; max-width: 380px; padding: 30px; display: grid; gap: 14px; justify-items: start; }
.login h1 { font-size: 26px; letter-spacing: -0.02em; }
.login label { display: grid; gap: 6px; width: 100%; font-weight: 600; font-size: 14px; }
.login .btn { width: 100%; }
.error { color: var(--danger); font-size: 14px; min-height: 1.3em; }

input, textarea {
  width: 100%; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 11px 14px;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); }
textarea { resize: vertical; line-height: 1.6; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 18px; border-radius: 999px; font-weight: 700; border: 1px solid var(--border); background: var(--surface); text-decoration: none; color: var(--text); transition: transform .15s, background .15s; }
.btn:hover:not(:disabled) { transform: translateY(-2px); background: var(--surface-2); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 8px 24px color-mix(in srgb, var(--accent) 40%, transparent); }
.btn.small { padding: 6px 14px; font-size: 13.5px; }
.btn.danger { color: var(--danger); }
.icon-btn { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); font-size: 17px; display: grid; place-items: center; }
.icon-btn:hover { background: var(--surface-2); }

/* ---------- Panel ---------- */
.shell { height: 100%; display: grid; grid-template-rows: auto 1fr; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px max(16px, 3vw); border-bottom: 1px solid var(--border); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); background: color-mix(in srgb, var(--bg) 70%, transparent); }
.brand { display: flex; align-items: center; gap: 10px; font-size: 17px; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.badge { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 99px; background: var(--accent); color: var(--accent-text); font-size: 12px; font-weight: 800; display: inline-grid; place-items: center; }
.layout { display: grid; grid-template-columns: 380px 1fr; min-height: 0; }
.list-pane { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--border); }
.tools { padding: 14px; display: grid; gap: 10px; }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 3px; gap: 3px; width: fit-content; }
.seg button { padding: 6px 14px; border-radius: 9px; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.seg button.on { background: var(--surface-2); color: var(--text); box-shadow: var(--shadow); }
.list { list-style: none; margin: 0; padding: 4px 12px 24px; overflow-y: auto; display: grid; gap: 10px; align-content: start; flex: 1; }
.item { width: 100%; text-align: left; display: grid; gap: 4px; padding: 13px 15px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); transition: transform .12s, border-color .15s; }
.item:hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); }
.item.unread { border-left: 4px solid var(--accent); }
.item.active { outline: 2px solid var(--accent); outline-offset: 1px; }
.item .row { display: flex; align-items: center; gap: 8px; }
.item .name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item.unread .name { font-weight: 800; }
.item .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); flex: none; }
.item .prev { color: var(--muted); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.item .mail { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spacer { flex: 1; }
.tick { color: var(--ok); font-weight: 800; }
.empty { display: grid; place-items: center; align-content: center; gap: 6px; text-align: center; color: var(--muted); padding: 40px 20px; }
.empty.big { height: 100%; }
.empty .emoji { font-size: 48px; }

.detail-pane { overflow-y: auto; min-height: 0; padding: 22px max(18px, 3vw) 40px; }
.msg { max-width: 760px; display: grid; gap: 14px; }
.msg-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.msg h2 { font-size: 26px; letter-spacing: -0.02em; }
.msg-meta { color: var(--muted); font-size: 13.5px; }
.msg-meta .ok { color: var(--ok); font-weight: 700; }
.body { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.7; padding: 16px 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); }
.replies { display: grid; gap: 10px; }
.replies h3, .compose h3 { font-size: 12.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.reply { display: grid; gap: 6px; }
.reply.failed .body { border-color: var(--danger); }
.compose { display: grid; gap: 10px; }
.compose .actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.back { display: none; }

.toasts { position: fixed; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); transform: translateX(-50%); display: grid; gap: 8px; width: min(92vw, 420px); z-index: 30; pointer-events: none; }
.toast { background: #232634; color: #fff; padding: 11px 16px; border-radius: 12px; box-shadow: 0 8px 28px rgba(0, 0, 0, .35); font-size: 14px; animation: pop .18s ease-out; }
.toast.err { background: #7f1d1d; }
@keyframes pop { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Telefon: tek panel, geri düğmesiyle gezinme ---------- */
@media (max-width: 820px) {
  .layout { grid-template-columns: 1fr; }
  .list-pane, .detail-pane { display: none; border-right: 0; }
  .layout[data-view='list'] .list-pane { display: flex; }
  .layout[data-view='detail'] .detail-pane { display: block; }
  .back { display: inline-flex; }
  .top .btn.small { padding: 6px 11px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
