/* style.css — Orion AGI UI */
@import url('https://fonts.googleapis.com/css2?family=Geist:wght@300;400;500;600&family=Geist+Mono:wght@400;500&display=swap');

:root {
  --bg:          #0d0d0d;
  --sidebar:     #111111;
  --surface:     #1a1a1a;
  --border:      #2a2a2a;
  --border-soft: #1f1f1f;
  --text:        #ececec;
  --text-dim:    #8a8a8a;
  --text-faint:  #555555;
  --accent:      #10a37f;
  --accent-dim:  #0d8a6b;
  --user-bubble: #1a2f25;
  --danger:      #e55353;
  --warn:        #e5a223;
  --radius:      10px;
  --font:        'Geist', system-ui, sans-serif;
  --mono:        'Geist Mono', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  height: 100vh;
  display: flex;
  overflow: hidden;
}

/* ── Sidebar ──────────────────────────────────────────────── */
#sidebar {
  width: 260px;
  min-width: 260px;
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100vh;
}

#sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--border-soft);
}

#sidebar-logo img {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  object-fit: cover;
}

.logo-name {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.3px;
  background: linear-gradient(135deg, #00d4aa, #7c4dff, #ff3d9a);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

#new-chat-btn {
  margin: 10px 10px 4px;
  padding: 9px 12px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.15s;
}
#new-chat-btn:hover { background: var(--surface); }

#history-label {
  padding: 12px 14px 6px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

#history-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.history-item {
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-dim);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.12s, color 0.12s;
  margin-bottom: 2px;
}
.history-item:hover  { background: var(--surface); color: var(--text); }
.history-item.active { background: var(--surface); color: var(--text); }

/* ── Sidebar Footer ─────────────────────────────────────── */
#sidebar-footer {
  border-top: 1px solid var(--border-soft);
  padding: 8px;
}

.footer-btn {
  width: 100%;
  padding: 9px 10px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--text-dim);
  font-family: var(--font);
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 9px;
  transition: background 0.12s, color 0.12s;
  text-align: left;
}
.footer-btn:hover { background: var(--surface); color: var(--text); }
.footer-btn.danger:hover { color: var(--danger); }

#user-info {
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-avatar {
  width: 28px; height: 28px;
  background: linear-gradient(135deg, #00d4aa, #7c4dff);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; color: white;
  flex-shrink: 0;
}
.user-name-text  { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-email-text { font-size: 11px; color: var(--text-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Ana ────────────────────────────────────────────────── */
#main {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

#header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 53px;
}
#header-title { font-size: 14px; font-weight: 500; color: var(--text-dim); }

#status-badge {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-faint);
}
.status-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent);
}

/* ── Mesajlar ───────────────────────────────────────────── */
#messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px 0;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.msg-row {
  max-width: 720px;
  margin: 0 auto;
  padding: 6px 20px;
  animation: fadeUp 0.2s ease;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.msg-row.user  { display: flex; justify-content: flex-end; }
.msg-row.orion { display: flex; flex-direction: column; }

.msg-bubble {
  padding: 10px 14px;
  border-radius: var(--radius);
  line-height: 1.65;
  font-size: 14px;
  max-width: 85%;
  word-break: break-word;
}

.msg-row.user .msg-bubble {
  background: var(--user-bubble);
  border: 1px solid #2a4a3a;
  border-bottom-right-radius: 3px;
}

.msg-row.orion .msg-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.msg-row.orion .msg-bubble {
  background: transparent;
  padding: 0;
  font-size: 14.5px;
  line-height: 1.75;
}

.msg-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }

.badge {
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  font-family: var(--mono);
}
.badge.guclu  { background:#1a3320; color:#4ade80; border:1px solid #2a5530; }
.badge.orta   { background:#2a2010; color:#facc15; border:1px solid #4a3510; }
.badge.tek    { background:#1a1a2a; color:#818cf8; border:1px solid #2a2a4a; }
.badge.sure   { background:transparent; color:var(--text-faint); border:none; }
.badge.mat    { background:#1a2030; color:#60a5fa; border:1px solid #2a3550; }
.badge.web    { background:#1a2820; color:#34d399; border:1px solid #2a4030; }

.kaynaklar { margin-top:8px; display:flex; flex-direction:column; gap:4px; }
.kaynak-link {
  font-size:12px; color:var(--accent); text-decoration:none;
  display:flex; align-items:center; gap:5px; opacity:0.8;
  transition:opacity 0.15s; overflow:hidden;
  text-overflow:ellipsis; white-space:nowrap; max-width:420px;
}
.kaynak-link:hover { opacity:1; text-decoration:underline; }

/* Düşünüyor */
.thinking { display:flex; align-items:center; gap:6px; padding:8px 0; color:var(--text-faint); font-size:13px; }
.thinking-dots { display:flex; gap:4px; }
.thinking-dots span {
  width:5px; height:5px; border-radius:50%;
  background:var(--text-faint);
  animation:bounce 1.2s infinite;
}
.thinking-dots span:nth-child(2) { animation-delay:0.2s; }
.thinking-dots span:nth-child(3) { animation-delay:0.4s; }
@keyframes bounce {
  0%,60%,100% { transform:translateY(0); opacity:0.4; }
  30% { transform:translateY(-5px); opacity:1; }
}

/* Boş durum */
#empty-state {
  display:flex; flex-direction:column;
  align-items:center; justify-content:center;
  height:100%; gap:16px; color:var(--text-faint);
}
#empty-state img {
  width:80px; height:80px;
  border-radius:22px;
  filter: drop-shadow(0 0 24px rgba(180,100,255,0.5));
  animation: pulse 3s ease-in-out infinite;
}
@keyframes pulse {
  0%,100% { filter: drop-shadow(0 0 24px rgba(180,100,255,0.5)) brightness(1); }
  50%      { filter: drop-shadow(0 0 40px rgba(0,230,180,0.6)) brightness(1.08); }
}
#empty-state h2 { font-size:20px; font-weight:600; color:var(--text); }
#empty-state p  { font-size:14px; text-align:center; max-width:320px; line-height:1.6; }

.quick-btns { display:flex; flex-wrap:wrap; gap:8px; justify-content:center; margin-top:8px; }
.quick-btn {
  padding:8px 14px; border:1px solid var(--border); border-radius:20px;
  background:transparent; color:var(--text-dim); font-family:var(--font);
  font-size:13px; cursor:pointer; transition:all 0.15s;
}
.quick-btn:hover { border-color:var(--accent); color:var(--accent); background:rgba(16,163,127,0.05); }

/* ── Input ──────────────────────────────────────────────── */
#input-area { padding:12px 20px 20px; border-top:1px solid var(--border-soft); }

#input-wrap {
  max-width:720px; margin:0 auto; position:relative;
  background:var(--surface); border:1px solid var(--border);
  border-radius:12px; transition:border-color 0.15s;
}
#input-wrap:focus-within { border-color:#3a3a3a; }

#input {
  width:100%; padding:12px 52px 12px 16px;
  background:transparent; border:none; outline:none;
  color:var(--text); font-family:var(--font); font-size:14px;
  resize:none; max-height:160px; line-height:1.5;
}
#input::placeholder { color:var(--text-faint); }

#send-btn {
  position:absolute; right:10px; bottom:10px;
  width:32px; height:32px;
  background:var(--accent); border:none; border-radius:8px;
  cursor:pointer; display:flex; align-items:center; justify-content:center;
  transition:background 0.15s, transform 0.1s; color:white;
}
#send-btn:hover { background:var(--accent-dim); transform:scale(1.05); }
#send-btn:disabled { background:var(--surface); cursor:not-allowed; transform:none; opacity:0.4; }

#resim-btn {
  position:absolute; right:48px; bottom:10px;
  width:32px; height:32px;
  background:transparent; border:1px solid var(--border); border-radius:8px;
  cursor:pointer; display:flex; align-items:center; justify-content:center;
  transition:all 0.15s; color:var(--text-dim);
}
#resim-btn:hover { border-color:var(--accent); color:var(--accent); background:rgba(16,163,127,0.05); }
#resim-btn.aktif { border-color:var(--accent); color:var(--accent); background:rgba(16,163,127,0.1); }

/* Üretilen görsel */
.msg-gorsel {
  max-width:400px; border-radius:12px;
  border:1px solid var(--border); margin-top:8px;
  display:block; cursor:zoom-in;
}
.badge.gorsel-u { background:#2a1a30; color:#d87fff; border:1px solid #4a2a50; }
.badge.gorsel-a { background:#1a2a30; color:#7fffff; border:1px solid #2a4a50; }

/* Görsel büyütme overlay */
#gorsel-overlay {
  display:none; position:fixed; inset:0;
  background:rgba(0,0,0,0.85); z-index:300;
  align-items:center; justify-content:center; cursor:zoom-out;
}
#gorsel-overlay.acik { display:flex; }
#gorsel-overlay img { max-width:90vw; max-height:90vh; border-radius:12px; }

#input-hint { max-width:720px; margin:8px auto 0; font-size:11px; color:var(--text-faint); text-align:center; }

/* ── Modallar ───────────────────────────────────────────── */
.modal-overlay {
  display:none; position:fixed; inset:0;
  background:rgba(0,0,0,0.7); backdrop-filter:blur(4px);
  z-index:100; align-items:center; justify-content:center;
}
.modal-overlay.open { display:flex; }

.modal {
  background:var(--surface); border:1px solid var(--border);
  border-radius:14px; padding:28px; width:380px; max-width:92vw;
  animation:modalIn 0.2s ease;
}
@keyframes modalIn {
  from { opacity:0; transform:scale(0.96) translateY(10px); }
  to   { opacity:1; transform:scale(1) translateY(0); }
}

.modal h2 { font-size:18px; font-weight:600; margin-bottom:20px; }

.modal-tabs {
  display:flex; gap:2px; margin-bottom:20px;
  background:var(--bg); padding:4px; border-radius:10px;
}
.modal-tab {
  flex:1; padding:7px; border:none; border-radius:7px;
  background:transparent; color:var(--text-dim);
  font-family:var(--font); font-size:13px; cursor:pointer; transition:all 0.15s;
}
.modal-tab.active { background:var(--surface); color:var(--text); }

.form-group { margin-bottom:14px; }
.form-group label { display:block; font-size:12px; color:var(--text-dim); margin-bottom:6px; font-weight:500; }
.form-group input {
  width:100%; padding:9px 12px;
  background:var(--bg); border:1px solid var(--border);
  border-radius:8px; color:var(--text); font-family:var(--font);
  font-size:13px; outline:none; transition:border-color 0.15s;
}
.form-group input:focus { border-color:var(--accent); }

.modal-btns { display:flex; gap:10px; margin-top:20px; }

.btn-primary {
  flex:1; padding:9px;
  background:var(--accent); border:none; border-radius:8px;
  color:white; font-family:var(--font); font-size:13px; font-weight:500;
  cursor:pointer; transition:background 0.15s;
}
.btn-primary:hover { background:var(--accent-dim); }

.btn-secondary {
  padding:9px 16px;
  background:transparent; border:1px solid var(--border); border-radius:8px;
  color:var(--text-dim); font-family:var(--font); font-size:13px;
  cursor:pointer; transition:all 0.15s;
}
.btn-secondary:hover { border-color:#3a3a3a; color:var(--text); }

.form-error   { color:var(--danger); font-size:12px; margin-top:6px; display:none; }
.form-success { color:var(--accent); font-size:12px; margin-top:6px; display:none; }

.warn-banner {
  background:rgba(229,162,35,0.08); border:1px solid rgba(229,162,35,0.2);
  border-radius:8px; padding:10px 12px;
  display:flex; align-items:flex-start; gap:8px;
  font-size:12px; color:var(--warn); margin-bottom:20px; line-height:1.5;
}

.settings-section { margin-bottom:20px; }
.settings-section-title {
  font-size:11px; font-weight:500; color:var(--text-faint);
  text-transform:uppercase; letter-spacing:0.8px; margin-bottom:12px;
}
.settings-divider { border:none; border-top:1px solid var(--border-soft); margin:18px 0; }

/* Bildirim */
.bildirim {
  position:fixed; bottom:80px; right:20px; z-index:200;
  background:var(--surface); border:1px solid var(--border);
  border-radius:10px; padding:12px 16px; font-size:13px; color:var(--text);
  box-shadow:0 4px 20px rgba(0,0,0,0.4); cursor:pointer;
  max-width:280px; animation:fadeUp 0.2s ease;
}

/* ── Mobil Düzenlemeler ─────────────────────────────── */
@media (max-width:768px) {
  /* Sidebar gizle */
  #sidebar { display:none !important; }

  /* Main tam genişlik */
  #main { width:100%; height:100dvh; }

  /* Header küçült */
  #header { padding:10px 14px; min-height:46px; }
  #header-title { font-size:13px; }

  /* Mesajlar tam genişlik */
  .msg-row { padding:5px 12px; max-width:100%; }
  .msg-bubble { font-size:13.5px; }

  /* Input alanı — mobilde klavye açılınca kaymasın */
  #input-area {
    padding:8px 12px 14px;
    position:sticky;
    bottom:0;
    background:var(--bg);
    border-top:1px solid var(--border-soft);
  }
  #input-wrap { border-radius:10px; }
  #input { font-size:16px; padding:10px 90px 10px 12px; } /* font-size 16px = zoom yok */
  #send-btn  { right:8px; bottom:8px; width:30px; height:30px; }
  #resim-btn { right:44px; bottom:8px; width:30px; height:30px; }
  #input-hint { font-size:10px; }

  /* Boş durum */
  #empty-state h2 { font-size:17px; }
  #empty-state p  { font-size:13px; }
  .quick-btns { gap:6px; }
  .quick-btn  { font-size:12px; padding:6px 10px; }

  /* Modal tam ekran */
  .modal { width:94vw !important; max-width:94vw; padding:20px; }

  /* Görsel önizleme */
  #resim-onizleme { padding:0 12px; }
  #onizleme-img { max-height:90px; }

  /* PRO banner küçült */
  #pro-banner { margin:6px; padding:8px 10px; }

  /* Mobil hamburger butonu — sidebar'ı aç */
  #hamburger {
    display:flex !important;
    align-items:center; justify-content:center;
    width:32px; height:32px;
    background:transparent; border:none;
    color:var(--text-dim); cursor:pointer;
    margin-right:8px;
  }

  /* Mobilde sidebar overlay */
  #sidebar.mobile-acik {
    display:flex !important;
    position:fixed; inset:0; z-index:200;
    width:280px;
    box-shadow:4px 0 20px rgba(0,0,0,0.5);
  }
  #sidebar-overlay {
    display:none;
    position:fixed; inset:0; z-index:199;
    background:rgba(0,0,0,0.5);
  }
  #sidebar.mobile-acik ~ #sidebar-overlay,
  body.sidebar-acik #sidebar-overlay { display:block; }
}

/* Çok küçük ekranlar */
@media (max-width:380px) {
  .msg-bubble { font-size:13px; }
  #header-title { display:none; }
}

/* ── Bağış Butonları ────────────────────────────────────── */
.bagis-btn {
  padding:9px 18px;
  background:transparent;
  border:1px solid var(--border);
  border-radius:20px;
  color:var(--text);
  font-family:var(--font);
  font-size:14px;
  font-weight:500;
  cursor:pointer;
  transition:all 0.15s;
}
.bagis-btn:hover,
.bagis-btn.secili {
  background:rgba(0,212,170,0.1);
  border-color:#00d4aa;
  color:#00d4aa;
}

/* ── Aydınlık Tema ─────────────────────────────────────────── */
[data-tema="aydinlik"] {
  --bg:          #f8f9fb;
  --bg-2:        #ffffff;
  --surface:     #edf0f4;
  --border:      #d8dde6;
  --border-soft: #e4e8f0;
  --text:        #1a1d23;
  --text-dim:    #4a5568;
  --text-faint:  #8a95a3;
  --accent:      #6c3fd4;
  --danger:      #dc3545;
  --warn:        #e67e22;
}
[data-tema="aydinlik"] body {
  background: var(--bg);
  color: var(--text);
}
[data-tema="aydinlik"] #sidebar {
  background: #ffffff;
  border-right: 1px solid var(--border);
}
[data-tema="aydinlik"] #header {
  background: #ffffff;
  border-bottom: 1px solid var(--border);
}
[data-tema="aydinlik"] #input-area {
  background: var(--bg);
  border-top: 1px solid var(--border);
}
[data-tema="aydinlik"] #input-wrap {
  background: #ffffff;
  border: 1px solid var(--border);
}
[data-tema="aydinlik"] .mesaj.kullanici .mesaj-icerik {
  background: var(--accent);
  color: white;
}
[data-tema="aydinlik"] .mesaj.orion .mesaj-icerik {
  background: #ffffff;
  border: 1px solid var(--border);
}
@media (max-width:1024px) {
  #sidebar { width:280px; }
  #main { padding-bottom:100px; }
  #input-area {
    position:fixed !important;
    bottom:0 !important;
    left:0 !important;
    right:0 !important;
    background:var(--bg) !important;
    z-index:150 !important;
    padding:10px 16px 16px !important;
    border-top:1px solid var(--border) !important;
  }
}
