:root {
    /* Daha Derin ve Modern Renk Paleti */
    --bg: #09090b;          /* Zinc 950 */
    --surface: #18181b;     /* Zinc 900 */
    --surface-hover: #27272a; /* Zinc 800 */
    --card: #141417;
    --border: #27272a;      /* Çok hafif sınır */

    --accent: #818cf8;      /* Soft Mavi/Mor (Sky 400) */
    --accent-glow: rgba(129, 140, 248, 0.15);
    --accent2: #f87171;     /* Soft Kırmızı */

    --text: #f4f4f5;        /* Okunaklı Beyaz */
    --muted: #a1a1aa;       /* Zinc 400 */

    --success: #34d399;
    --gold: #fbbf24;
}

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

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    /* Okunabilirlik için ana font Inter, Başlıklar Syne */
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    display: flex;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .logo, .chat-baslik, .btn, .btn-yeni, .mod-btn {
    font-family: 'Syne', sans-serif;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-thumb { background: var(--surface-hover); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ── SOL PANEL ── */
.sol-panel {
    width: 260px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    z-index: 10;
}

.sol-header {
    padding: 1.25rem 1rem;
}

.logo {
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 1.2rem;
    letter-spacing: -0.5px;
}

.logo span {
    color: var(--accent);
}

.btn-yeni {
    width: 100%;
    padding: 0.75rem;
    border-radius: 10px;
    background: var(--text);
    color: var(--bg);
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(255,255,255,0.1);
}

.btn-yeni:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(255,255,255,0.15);
}

.sohbet-listesi {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.sohbet-item {
    padding: 0.7rem 0.8rem;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 4px;
    transition: all 0.15s;
    border: 1px solid transparent;
}

.sohbet-item:hover {
    background: var(--card);
}

.sohbet-item.aktif {
    background: var(--card);
    border-color: var(--border);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.sohbet-isim {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sohbet-tarih {
    font-size: 0.7rem;
    color: var(--muted);
    margin-top: 2px;
}

.sohbet-sil-btn {
    opacity: 0;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--muted);
    transition: 0.2s;
}

.sohbet-item:hover .sohbet-sil-btn { opacity: 1; }
.sohbet-sil-btn:hover { color: var(--accent2); }

/* ETİKET ALANI */
.sol-alt {
    padding: 1rem;
    border-top: 1px solid var(--border);
    max-height: 35vh;
    overflow-y: auto;
}

.sidebar-title {
    font-size: 0.7rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 600;
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    filter: grayscale(1);
    transition: 0.2s;
}
.btn-icon:hover { filter: grayscale(0); transform: scale(1.1); }

.etiket-listesi { display: flex; flex-direction: column; gap: 4px; }

.kat-btn {
    width: 100%;
    padding: 0.5rem 0.7rem;
    border-radius: 8px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--muted);
    text-align: left;
    transition: 0.2s;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.kat-btn:hover { background: var(--card); color: var(--text); }
.kat-btn.aktif { background: var(--accent-glow); color: var(--accent); font-weight: 500; }

.kat-btn .etiket-renk {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ── ORTA CHAT ALANI ── */
.chat-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg);
}

.chat-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(9, 9, 11, 0.8);
    backdrop-filter: blur(12px); /* Glassmorphism */
    z-index: 10;
}

.chat-baslik {
    font-size: 1.1rem;
    font-weight: 600;
    flex: 1;
}

.mod-chip {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    border: 1px solid var(--border);
    color: var(--muted);
}

.mod-chip.soru { border-color: var(--gold); color: var(--gold); background: rgba(251, 191, 36, 0.1); }
.mod-chip.not { border-color: var(--success); color: var(--success); background: rgba(52, 211, 153, 0.1); }

.chat-gecmisi {
    flex: 1;
    overflow-y: auto;
    padding: 2rem 10%; /* Merkeze odaklama */
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* BOŞ EKRAN */
.bos-ekran {
    margin: auto;
    text-align: center;
    color: var(--muted);
}
.bos-icon { font-size: 3rem; margin-bottom: 1rem; opacity: 0.5; }
.bos-yazi { font-size: 0.95rem; line-height: 1.6; }
.bos-yazi strong { color: var(--text); font-size: 1.2rem; font-family: 'Syne', sans-serif;}

/* MESAJ BALONLARI */
.mesaj { display: flex; gap: 1rem; max-width: 90%; animation: fadeUp 0.3s ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.mesaj.kullanici { align-self: flex-end; flex-direction: row-reverse; }

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    font-size: 0.9rem;
    flex-shrink: 0;
    background: var(--surface);
    border: 1px solid var(--border);
}

.mesaj.kullanici .avatar { background: var(--accent); border-color: var(--accent); color: white;}

.balon {
    padding: 0.85rem 1.2rem;
    line-height: 1.7;
    font-size: 0.95rem;
    color: var(--text);
}

.mesaj.kullanici .balon {
    background: var(--accent);
    color: #fff;
    border-radius: 16px 16px 4px 16px;
    box-shadow: 0 4px 15px var(--accent-glow);
}

.mesaj.sistem .balon {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px 16px 16px 4px;
}

/* Markdown Stilleri */
.balon p { margin-bottom: 0.8rem; }
.balon p:last-child { margin-bottom: 0; }
.balon strong { color: #fff; }
.balon h1, .balon h2, .balon h3 { font-family: 'Syne', sans-serif; color: var(--accent); margin: 1rem 0 0.5rem 0; }
.balon ul, .balon ol { margin-left: 1.5rem; margin-bottom: 1rem; }
.balon li { margin-bottom: 0.4rem; }
.balon code { background: var(--bg); padding: 2px 6px; border-radius: 4px; font-family: 'JetBrains Mono', monospace; font-size: 0.85em; color: var(--gold); border: 1px solid var(--border); }
.balon pre { background: var(--bg); padding: 1rem; border-radius: 8px; border: 1px solid var(--border); overflow-x: auto; margin: 1rem 0; }
.balon pre code { border: none; padding: 0; background: transparent; }

/* ── GİRİŞ ALANI (YÜZEN KAPSÜL TASARIMI) ── */
.giris-alani {
    padding: 0 10% 2rem 10%;
    background: linear-gradient(transparent, var(--bg) 20%);
}

.giris-ust-araclar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
    padding: 0 0.5rem;
}

.mod-toggle { display: flex; gap: 0.5rem; }
.mod-btn {
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    border: 1px solid transparent;
    background: var(--surface);
    color: var(--muted);
    font-size: 0.8rem;
    cursor: pointer;
    transition: 0.2s;
}
.mod-btn.aktif { background: var(--surface-hover); color: var(--text); border-color: var(--border); }

.komut-yardim button {
    background: transparent; border: none; color: var(--muted);
    font-family: 'JetBrains Mono', monospace; font-size: 0.75rem;
    cursor: pointer; padding: 2px 6px; transition: 0.2s;
}
.komut-yardim button:hover { color: var(--accent); background: var(--accent-glow); border-radius: 4px;}

/* KAPSÜL */
.giris-kapsul {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 0.5rem;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
    transition: border-color 0.3s ease;
}

.giris-kapsul:focus-within {
    border-color: var(--accent);
    box-shadow: 0 8px 30px var(--accent-glow);
}

.btn-arac {
    background: transparent;
    border: none;
    color: var(--muted);
    width: 40px; height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: 0.2s;
    flex-shrink: 0;
}
.btn-arac:hover { background: var(--surface-hover); color: var(--text); }

.btn-mic.recording {
    color: var(--accent2);
    animation: pulse-mic 1.5s infinite;
}
@keyframes pulse-mic { 0% { background: transparent; } 50% { background: rgba(248, 113, 113, 0.2); } 100% { background: transparent; } }

#chat-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    resize: none;
    outline: none;
    max-height: 150px;
    min-height: 24px;
    padding: 0.6rem 0.5rem;
    line-height: 1.5;
}
#chat-input::placeholder { color: var(--muted); }

.btn-gonder {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: var(--text);
    color: var(--bg);
    border: none;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: 0.2s;
    flex-shrink: 0;
}
.btn-gonder:hover { background: var(--accent); color: white; transform: scale(1.05); }
.btn-gonder:disabled { opacity: 0.3; cursor: not-allowed; transform: none; }

/* ── SAĞ PANEL (NOTLAR) ── */
.not-panel {
    width: 320px;
    background: var(--surface);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.not-panel-baslik {
    padding: 1.25rem;
    font-family: 'Syne', sans-serif;
    font-weight: 600;
    font-size: 1.1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

.sayac-badge {
    background: var(--surface-hover);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    color: var(--muted);
}

.arama-wrap {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg);
}
.arama-wrap svg { color: var(--muted); width: 16px; height: 16px; }
.arama-wrap input {
    flex: 1; background: transparent; border: none; outline: none;
    color: var(--text); font-size: 0.9rem; font-family: 'Inter', sans-serif;
}

.not-listesi {
    flex: 1; overflow-y: auto; padding: 1rem;
    display: flex; flex-direction: column; gap: 0.6rem;
}

.not-kart {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.not-kart:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--accent-glow);
}

.not-baslik { font-weight: 600; font-size: 0.9rem; margin-bottom: 0.4rem; line-height: 1.4; }
.not-kisa { font-size: 0.8rem; color: var(--muted); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ── MODALLAR VE OVERLAY ── */
.overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px); /* Glassmorphism */
    z-index: 200;
}

.modal {
    position: fixed; top: 5%; left: 50%; transform: translateX(-50%);
    width: 600px; max-height: 90vh;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
    overflow-y: auto; z-index: 201; padding: 2rem; display: none;
}

.modal-kapat {
    position: absolute; top: 1.5rem; right: 1.5rem;
    background: transparent; border: none; color: var(--muted); cursor: pointer; transition: 0.2s;
}
.modal-kapat:hover { color: var(--text); transform: scale(1.1); }

.detay-ozet {
    background: var(--bg); padding: 1rem; border-left: 3px solid var(--accent);
    border-radius: 0 8px 8px 0; margin: 1rem 0; font-size: 0.9rem; line-height: 1.6;
}

/* AI INSIGHT BOX */
.ai-insight-box {
    background: var(--accent-glow);
    border: 1px solid rgba(129, 140, 248, 0.2);
    padding: 1rem; border-radius: 12px; margin: 1.5rem 0; font-size: 0.9rem; line-height: 1.6;
}
.ai-insight-box strong { color: var(--accent); display: block; margin-bottom: 0.5rem; font-family: 'Syne', sans-serif;}

/* ETİKET BADGELERİ */
.etiket-badge, .etiket-badge-sil {
    font-size: 0.7rem; padding: 4px 10px; border-radius: 6px;
    background: var(--bg); border: 1px solid var(--border);
    display: inline-flex; align-items: center; gap: 4px; font-weight: 500;
}
.etiket-badge-sil { cursor: pointer; transition: 0.2s;}
.etiket-badge-sil:hover { background: rgba(248, 113, 113, 0.1); border-color: var(--accent2); color: var(--accent2); }

/* GÖRSEL ÖNİZLEMELER */
#gorsel-onizleme-wrap, #ses-onizleme-wrap {
    display: none; align-items: center; gap: 1rem;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 12px; padding: 0.5rem 1rem; margin-bottom: 1rem;
}
#gorsel-onizleme-wrap.aktif, #ses-onizleme-wrap.aktif { display: flex; }
/* ── GÖRSEL BÜYÜTME OVERLAYİ ── */
#gorsel-zoom-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(8px);
    z-index: 500;
    cursor: zoom-out;
    place-items: center;
    animation: fadeIn 0.2s ease;
}
#gorsel-zoom-overlay.aktif {
    display: grid;
}
#gorsel-zoom-img {
    max-width: 92vw;
    max-height: 92vh;
    object-fit: contain;
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: 0 30px 80px rgba(0,0,0,0.6);
    animation: zoomIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes zoomIn {
    from { opacity: 0; transform: scale(0.85); }
    to   { opacity: 1; transform: scale(1); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ── GÖRSEL MESAJ İÇERİĞİ ── */
.mesaj-gorsel-icerik { display: flex; flex-direction: column; gap: 0.5rem; }
.mesaj-gorsel-icerik img {
    max-width: 220px;
    max-height: 180px;
    border-radius: 10px;
    border: 1px solid var(--border);
    cursor: zoom-in;
    transition: transform 0.15s, box-shadow 0.15s;
    display: block;
}
.mesaj-gorsel-icerik img:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.gorsel-aciklama {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.85);
    margin-top: 0.25rem;
}

/* ── TYPING ANİMASYONU ── */
.typing { display: inline-flex; gap: 4px; align-items: center; height: 20px; padding: 2px 0; }
.typing span {
    width: 7px; height: 7px; border-radius: 50%; background: var(--muted);
    animation: typingBounce 1.2s infinite ease-in-out;
}
.typing span:nth-child(1) { animation-delay: 0s; }
.typing span:nth-child(2) { animation-delay: 0.2s; }
.typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-6px); opacity: 1; }
}

/* ── BAŞLIK DÜZENLEME INPUT ── */
.chat-baslik-input {
    flex: 1;
    background: var(--surface);
    border: 1px solid var(--accent);
    border-radius: 8px;
    color: var(--text);
    font-family: 'Syne', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    padding: 0.3rem 0.6rem;
    outline: none;
    box-shadow: 0 0 0 3px var(--accent-glow);
}

/* ── BAĞLANTILI NOTLAR ── */
.linked-notes-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
}
.linked-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.6rem 0.8rem;
    cursor: pointer;
    transition: all 0.15s;
}
.linked-card:hover {
    border-color: var(--accent);
    background: var(--accent-glow);
    transform: translateX(2px);
}
.linked-card-title { font-size: 0.8rem; font-weight: 600; margin-bottom: 0.2rem; }
.linked-card-summary { font-size: 0.75rem; color: var(--muted); line-height: 1.4;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ── NOT KART ETİKETLER ── */
.not-kart-etiketler { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 0.5rem; }
.gorsel-rozet {
    position: absolute; top: 0.6rem; right: 0.6rem;
    font-size: 0.65rem; background: var(--bg); border: 1px solid var(--border);
    border-radius: 6px; padding: 2px 6px; color: var(--muted);
}
.skor-chip {
    position: absolute; top: 0.6rem; left: 0.6rem;
    font-size: 0.65rem; background: var(--accent-glow); border: 1px solid rgba(129,140,248,0.3);
    border-radius: 6px; padding: 2px 6px; color: var(--accent); font-weight: 600;
}
.bekliyor { opacity: 0.6; }
.bos-mesaj { color: var(--muted); font-size: 0.8rem; text-align: center; padding: 2rem 1rem; }

/* ── MODAL ACTION ROW ── */
.action-row {
    display: flex; gap: 0.6rem; margin-top: 1rem;
    flex-wrap: wrap;
}
.btn {
    padding: 0.55rem 1rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: 'Syne', sans-serif;
    transition: all 0.2s;
}
.btn-primary {
    background: var(--accent);
    color: #fff;
}
.btn-primary:hover { opacity: 0.85; transform: translateY(-1px); }
.btn-danger {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--muted);
}
.btn-danger:hover { border-color: var(--accent2); color: var(--accent2); background: rgba(248,113,113,0.08); }

/* ── ETİKET YÖNETİM ── */
.etiket-yonetim {
    margin-top: 1.2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}
.etiket-yonetim-baslik {
    font-size: 0.7rem; text-transform: uppercase; letter-spacing: 1px;
    color: var(--muted); font-weight: 600; margin-bottom: 0.6rem;
}
.etiket-ekle-wrap { display: flex; gap: 0.5rem; }
.etiket-ekle-input {
    flex: 1;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    padding: 0.4rem 0.7rem;
    outline: none;
    transition: border-color 0.2s;
}
.etiket-ekle-input:focus { border-color: var(--accent); }
.etiket-ekle-btn {
    padding: 0.4rem 0.8rem;
    background: var(--accent);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}
.etiket-ekle-btn:hover { opacity: 0.85; }

/* ── ÖNİZLEME BANDI ── */
.onizleme-bandi {
    display: none;
    align-items: center;
    gap: 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.5rem 1rem;
    margin-bottom: 1rem;
}
.onizleme-bandi.aktif { display: flex; }
.onizleme-info { display: flex; align-items: center; gap: 0.6rem; flex: 1; }
.mic-icon { font-size: 1.2rem; }
.dosya-adi { font-size: 0.8rem; color: var(--text); font-weight: 500; }
.dosya-boyut { font-size: 0.72rem; color: var(--muted); }
.btn-onizleme-sil {
    background: transparent; border: none; color: var(--muted);
    font-size: 1rem; cursor: pointer; transition: 0.2s; padding: 4px;
    border-radius: 50%; width: 28px; height: 28px; display: grid; place-items: center;
}
.btn-onizleme-sil:hover { background: rgba(248,113,113,0.15); color: var(--accent2); }
#gorsel-onizleme-img {
    width: 48px; height: 48px; object-fit: cover; border-radius: 8px;
    border: 1px solid var(--border); flex-shrink: 0;
}
#ses-onizleme-player { height: 32px; max-width: 180px; }

/* ── DÜZENLEMELERi ── */
.btn-duzenle {
    background: transparent; border: none;
    color: var(--muted); cursor: pointer;
    font-size: 1rem; padding: 4px 6px;
    border-radius: 6px; transition: 0.2s;
    display: none;
}
.btn-duzenle:hover { background: var(--surface-hover); color: var(--text); }

/* ── MODAL GÖRSEL ── */
.modal-gorsel {
    max-width: 100%;
    border-radius: 10px;
    margin-bottom: 1rem;
    cursor: zoom-in;
    transition: transform 0.15s;
    display: block;
}
.modal-gorsel:hover { transform: scale(1.01); }

/* ── SCROLL TO BOTTOM GECİKME DÜZELTMESİ ── */
.chat-gecmisi { scroll-behavior: smooth; }


/* ── KAYNAK KARTLARI ── */
.kaynaklar { margin-top: 1rem; padding-top: 0.8rem; border-top: 1px solid var(--border); }
.kaynak-item {
    padding: 0.45rem 0.7rem;
    border-radius: 7px;
    border: 1px solid var(--border);
    background: var(--bg);
    font-size: 0.78rem;
    cursor: pointer;
    margin-bottom: 0.3rem;
    transition: 0.15s;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.kaynak-item:hover { border-color: var(--accent); color: var(--accent); }

/* ── STREAM CURSOR ── */
.stream-cursor {
    display: inline-block;
    width: 2px;
    height: 1em;
    background: var(--accent);
    margin-left: 2px;
    vertical-align: text-bottom;
    animation: blink 0.8s step-end infinite;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* ── NOT OK ── */
.not-ok {
    color: var(--success);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}


/* ── DETAY MODAL SCROLLBAR ── */
#detay-modal::-webkit-scrollbar { width: 4px; }
#detay-modal::-webkit-scrollbar-thumb { background: var(--surface-hover); border-radius: 4px; }

/* ══════════════════════════════════════════════════════════
   MOBİL RESPONSIVE — TAM KAPSAMLI
   ══════════════════════════════════════════════════════════ */

/* ── TABLET (900px altı) ── */
@media (max-width: 900px) {
    .not-panel { display: none; }
    .sol-panel { width: 220px; }
    .chat-gecmisi { padding: 1.5rem 5%; }
    .giris-alani { padding: 0 5% 1.5rem 5%; }
}

/* ── MOBİL (600px altı) — Tam Mobil Deneyim ── */
@media (max-width: 600px) {

    /* === LAYOUT RESET === */
    body {
        flex-direction: column;
        overflow: hidden;
        position: fixed;
        inset: 0;
    }

    /* Sol panel: drawer olarak çalışır, normalde gizli */
    .sol-panel {
        position: fixed;
        top: 0;
        left: 0;
        width: 80vw;
        max-width: 320px;
        height: 100dvh;
        z-index: 500;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 8px 0 32px rgba(0,0,0,0.5);
        overflow-y: auto;
    }

    .sol-panel.mobil-acik {
        transform: translateX(0);
    }

    /* Drawer backdrop */
    .mobil-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.6);
        backdrop-filter: blur(4px);
        z-index: 499;
        animation: fadeIn 0.2s ease;
    }
    .mobil-backdrop.aktif { display: block; }

    /* Chat wrap: tam ekran */
    .chat-wrap {
        flex: 1;
        min-height: 0;
        display: flex;
        flex-direction: column;
        width: 100%;
        /* Alt navigasyon için boşluk */
        padding-bottom: 0;
    }

    /* === HEADER === */
    .chat-header {
        padding: 0.75rem 1rem;
        gap: 0.6rem;
    }

    /* Hamburger menü butonu (mobilde görünür) */
    .btn-hamburger {
        display: flex !important;
        background: transparent;
        border: none;
        color: var(--muted);
        cursor: pointer;
        padding: 6px;
        border-radius: 8px;
        transition: 0.2s;
        flex-shrink: 0;
    }
    .btn-hamburger:hover { background: var(--surface-hover); color: var(--text); }

    .chat-baslik {
        font-size: 0.95rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .mod-chip { display: none; }

    /* === CHAT GEÇMİŞİ === */
    .chat-gecmisi {
        padding: 1rem 1rem;
        gap: 1rem;
        /* Alt nav + input alanı için safe-area */
        padding-bottom: 0.5rem;
    }

    .mesaj { max-width: 95%; }

    /* === GİRİŞ ALANI === */
    .giris-alani {
        padding: 0.5rem 0.75rem;
        padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
        background: var(--surface);
        border-top: 1px solid var(--border);
    }

    .giris-ust-araclar {
        margin-bottom: 0.5rem;
        padding: 0;
        gap: 0.5rem;
        flex-wrap: wrap;
    }

    .mod-toggle { gap: 0.3rem; }

    .mod-btn {
        padding: 0.3rem 0.6rem;
        font-size: 0.75rem;
    }

    .komut-yardim button {
        font-size: 0.7rem;
        padding: 2px 5px;
    }

    .giris-kapsul {
        padding: 0.4rem;
        border-radius: 20px;
        gap: 0.3rem;
    }

    .btn-arac {
        width: 36px;
        height: 36px;
    }

    .btn-gonder {
        width: 38px;
        height: 38px;
    }

    #chat-input {
        font-size: 0.9rem;
        padding: 0.5rem 0.4rem;
    }

    /* === ÖNİZLEME BANTLARI === */
    #gorsel-onizleme-wrap.aktif,
    #ses-onizleme-wrap.aktif {
        padding: 0.4rem 0.7rem;
        margin-bottom: 0.6rem;
    }

    #ses-onizleme-player { max-width: 130px; }

    /* === ALT NAVİGASYON ÇUBUĞU === */
    .mobil-alt-nav {
        display: flex !important;
        background: var(--surface);
        border-top: 1px solid var(--border);
        padding: 0.5rem 0;
        padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
    }

    .mobil-alt-nav-btn {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        background: transparent;
        border: none;
        color: var(--muted);
        cursor: pointer;
        padding: 0.5rem 0;
        font-size: 0.65rem;
        font-family: 'Inter', sans-serif;
        transition: color 0.2s;
        border-radius: 8px;
    }

    .mobil-alt-nav-btn.aktif { color: var(--accent); }
    .mobil-alt-nav-btn svg { width: 22px; height: 22px; }

    /* === MODAL === */
    .modal {
        width: 100vw !important;
        max-width: 100vw !important;
        height: 90dvh;
        top: auto !important;
        bottom: 0;
        left: 0;
        right: 0;
        transform: none !important;
        border-radius: 20px 20px 0 0;
        padding: 1.5rem 1.25rem;
        padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
    }

    /* === GRAPH MODAL === */
    #graph-modal {
        width: 100vw !important;
        height: 100dvh !important;
        top: 0 !important;
        border-radius: 0 !important;
        max-width: 100vw !important;
    }

    /* === NOT PANELİ: drawer olarak === */
    .not-panel {
        display: flex !important;
        position: fixed;
        top: 0;
        right: 0;
        width: 88vw;
        max-width: 360px;
        height: 100dvh;
        z-index: 500;
        transform: translateX(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: -8px 0 32px rgba(0,0,0,0.5);
        border-left: 1px solid var(--border);
    }

    .not-panel.mobil-acik {
        transform: translateX(0);
    }

    /* Mesaj balonları düzeltme */
    .balon {
        font-size: 0.88rem;
        padding: 0.7rem 1rem;
    }

    .avatar { width: 28px; height: 28px; font-size: 0.8rem; }

    /* Görsel içerik */
    .mesaj-gorsel-icerik img {
        max-width: 180px;
        max-height: 150px;
    }

    /* Boş ekran */
    .bos-ekran { padding: 2rem 1rem; }
    .bos-icon { font-size: 2.5rem; }
    .bos-yazi { font-size: 0.88rem; }

    /* Not kartı modal */
    .action-row { gap: 0.4rem; }
    .btn { padding: 0.5rem 0.8rem; font-size: 0.8rem; }
}

/* ── DESKTOP'ta hamburger ve alt nav gizli ── */
.btn-hamburger { display: none; }
.mobil-alt-nav { display: none; }

/* Taslak not kartı için hafif bir nabız animasyonu */
.not-kart.taslak {
    background: var(--surface);
    border: 1px dashed var(--border);
    padding: 10px;
    border-radius: 8px;
    animation: pulse-border 2s infinite;
}

@keyframes pulse-border {
    0% { border-color: var(--border); }
    50% { border-color: var(--accent); }
    100% { border-color: var(--border); }
}

/* Küçük yükleme ikonu */
.spinner-small {
    width: 12px;
    height: 12px;
    border: 2px solid var(--accent);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ── SES PENDING BALONU ─────────────────────────────────────────────────────── */
/* Bu stilleri style.css dosyasına ekleyin */

.ses-pending-kart {
    background: linear-gradient(135deg, rgba(124, 106, 255, 0.08) 0%, rgba(124, 106, 255, 0.03) 100%);
    border: 1px solid rgba(124, 106, 255, 0.25);
    border-radius: 14px;
    padding: .85rem 1rem;
    min-width: 220px;
    max-width: 300px;
    display: flex;
    flex-direction: column;
    gap: .55rem;
}

.ses-pending-ust {
    display: flex;
    align-items: center;
    gap: .5rem;
}

.ses-pending-ikon-wrap {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(124, 106, 255, 0.18);
    border: 1px solid rgba(124, 106, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #7c6aff;
    flex-shrink: 0;
    animation: ses-ikon-nabiz 2s ease-in-out infinite;
}

@keyframes ses-ikon-nabiz {
    0%, 100% { box-shadow: 0 0 0 0 rgba(124, 106, 255, 0.35); }
    50%       { box-shadow: 0 0 0 6px rgba(124, 106, 255, 0); }
}

.ses-pending-etiket {
    font-size: .72rem;
    font-weight: 600;
    color: #7c6aff;
    letter-spacing: .3px;
    flex: 1;
}

.ses-pending-durum {
    display: flex;
    align-items: center;
    gap: .3rem;
    font-size: .63rem;
    color: var(--muted);
    white-space: nowrap;
}

.ses-pending-nokta {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success, #4ade80);
    flex-shrink: 0;
    animation: ses-nokta-blink 1.2s ease-in-out infinite;
}

@keyframes ses-nokta-blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.2; }
}

/* Dalga animasyonu */
.ses-pending-dalga {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 28px;
    padding: 0 2px;
}

.ses-pending-dalga span {
    display: inline-block;
    width: 3px;
    border-radius: 3px;
    background: #7c6aff;
    animation: ses-dalga 1.1s ease-in-out infinite;
    transform-origin: bottom;
}

/* Her çubuk farklı gecikme ve yükseklik ile */
.ses-pending-dalga span:nth-child(1)  { height: 8px;  animation-delay: 0.00s; }
.ses-pending-dalga span:nth-child(2)  { height: 14px; animation-delay: 0.09s; }
.ses-pending-dalga span:nth-child(3)  { height: 20px; animation-delay: 0.18s; }
.ses-pending-dalga span:nth-child(4)  { height: 26px; animation-delay: 0.27s; }
.ses-pending-dalga span:nth-child(5)  { height: 18px; animation-delay: 0.36s; }
.ses-pending-dalga span:nth-child(6)  { height: 24px; animation-delay: 0.45s; }
.ses-pending-dalga span:nth-child(7)  { height: 14px; animation-delay: 0.54s; }
.ses-pending-dalga span:nth-child(8)  { height: 22px; animation-delay: 0.63s; }
.ses-pending-dalga span:nth-child(9)  { height: 10px; animation-delay: 0.72s; }
.ses-pending-dalga span:nth-child(10) { height: 18px; animation-delay: 0.81s; }
.ses-pending-dalga span:nth-child(11) { height: 28px; animation-delay: 0.90s; }
.ses-pending-dalga span:nth-child(12) { height: 12px; animation-delay: 0.99s; }

@keyframes ses-dalga {
    0%, 100% { transform: scaleY(0.3);  opacity: 0.45; }
    50%       { transform: scaleY(1.0);  opacity: 1;    }
}

.ses-pending-alt {
    border-top: 1px solid rgba(124, 106, 255, 0.12);
    padding-top: .4rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ses-pending-whisper {
    font-size: .62rem;
    color: var(--muted);
    font-family: 'JetBrains Mono', monospace;
    opacity: .75;
}