﻿/* ===== GENEL ===== */
body {
    font-family: 'Poppins', sans-serif;
    background-color: #0f172a;
    color: #e2e8f0;
    margin: 0;
    padding: 0;
}

header {
    background-color: #111827;
    color: #f1f5f9;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #1e293b;
}

    header h1 {
        margin: 0;
        font-size: 1.4rem;
        font-weight: 600;
    }

/* ===== SOL MENÜ + ANA CHAT ===== */
.chat-container {
    display: grid;
    grid-template-columns: 260px 1fr;
    height: calc(100vh - 70px);
}

/* SOL TARAF */
.chat-history {
    background-color: #1e293b;
    padding: 1rem;
    overflow-y: auto;
    border-right: 1px solid #334155;
}

    .chat-history h3 {
        margin-bottom: .8rem;
        padding-bottom: .4rem;
        border-bottom: 1px solid #334155;
    }

    .chat-history a {
        display: block;
        padding: 0.6rem 0.8rem;
        color: #cbd5e1;
        border-radius: 6px;
    }

        .chat-history a:hover {
            background: #334155;
        }

/* ===== CHAT PENCERESİ ===== */
.chat-window {
    display: flex;
    flex-direction: column;
    padding: 1rem;
}

/* Mesaj alanı */
.messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: .8rem;
}

/* Mesaj baloncukları */
.message {
    max-width: 75%;
    padding: .8rem 1rem;
    border-radius: 12px;
    line-height: 1.4;
}

    .message.user {
        background: #2563eb;
        color: white;
        align-self: flex-end;
        border-bottom-right-radius: 0;
    }

    .message.ai {
        background: #1e293b;
        color: #f1f5f9;
        align-self: flex-start;
        border-bottom-left-radius: 0;
    }

/* Mesaj yazma alanı */
.chat-window form {
    display: flex;
    padding: .8rem;
    background: #1e293b;
    border-radius: 10px;
    gap: 10px;
}

textarea {
    flex: 1;
    resize: none;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: .8rem;
    color: #e2e8f0;
    font-size: 1rem;
}

button {
    background: #3b82f6;
    border: none;
    padding: .8rem 1.2rem;
    color: white;
    border-radius: 8px;
    cursor: pointer;
}

    button:hover {
        background: #2563eb;
    }

/* ===== LOGIN & REGISTER ===== */
.auth-container {
    max-width: 380px;
    margin: 70px auto;
    padding: 30px;
    background: #111827;
    border-radius: 12px;
    border: 1px solid #1e293b;
}

    .auth-container h2 {
        text-align: center;
        margin-bottom: 20px;
    }

    .auth-container input {
        width: 100%;
        padding: 12px;
        background: #0f172a;
        color: white;
        border: 1px solid #334155;
        border-radius: 6px;
        margin-bottom: 15px;
    }

    .auth-container button {
        width: 100%;
    }

/* ===== PROFİL DROPDOWN ===== */
.profile-box {
    position: relative;
    cursor: pointer;
}

.profile-dropdown {
    position: absolute;
    top: 40px;
    right: 0;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 8px;
    display: none;
    width: 150px;
}

.profile-box.open .profile-dropdown {
    display: block;
}

/* =======================================
    📱 PROFESYONEL MOBİL TASARIM
======================================= */
@media (max-width: 768px) {

    /* Sol menü gizleniyor */
    .chat-container {
        grid-template-columns: 1fr;
    }

    .chat-history {
        display: none;
    }

    .chat-window {
        padding: .7rem;
    }

    .messages {
        padding: .6rem;
        height: calc(100vh - 230px);
    }

    textarea {
        height: 60px;
        font-size: 15px;
    }

    button {
        padding: 1rem;
        font-size: 15px;
    }
}
.chat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
}

    .chat-item:hover {
        background: #334155;
    }

.chat-title {
    flex: 1;
}

.delete-btn {
    color: #f87171;
    cursor: pointer;
    margin-left: 10px;
}

    .delete-btn:hover {
        color: #ef4444;
    }

/* ======================================= */
/*    📱 MOBİL CHATGPT BENZERİ ARAYÜZ     */
/* ======================================= */

@media (max-width: 768px) {

    /* Navbar hizalama düzeltme */
    .navbar {
        height: 55px;
        padding: 0 15px;
    }

    .brand {
        font-size: 18px;
    }

    /* Chat container tam ekran */
    .chat-container {
        grid-template-columns: 1fr !important;
        height: calc(100vh - 55px);
    }

    /* Sol panel tamamen gizleniyor */
    .chat-history {
        display: none !important;
    }

    /* Chat alanı tam ekran */
    .chat-window {
        padding: 0.5rem !important;
        height: 100%;
        display: flex;
        flex-direction: column;
    }

    /* Mesaj listesi */
    .messages {
        flex: 1;
        overflow-y: auto;
        padding: 12px !important;
        margin-bottom: 80px;
    }

    /* Mesaj stilleri optimize */
    .message {
        max-width: 85% !important;
        font-size: 15px;
        padding: 10px 14px;
    }

    /* Mesaj yazma alanı sabitlenmiş */
    .chat-window form {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        padding: 12px;
        background: #0f172a;
        border-top: 1px solid #334155;
        border-radius: 0;
        gap: 8px;
        display: flex;
        z-index: 50;
    }

    textarea {
        height: 52px !important;
        font-size: 16px !important;
        padding: 10px !important;
    }

    button {
        padding: 14px 18px !important;
        font-size: 15px;
        border-radius: 8px;
    }

    /* Profil dropdown overflow fix */
    .profile-dropdown {
        right: 10px !important;
    }

    /* Sayfa içeriği container override */
    .page-body {
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
    }
}
@media (max-width: 768px) {
    #left-panel
}
/* ============================= */
/*   🛠 ESKİ ID’LERE UYUMLU CSS  */
/*   Desktop + Mobile Fix       */
/* ============================= */

/* Masaüstü düzende 2 kolon: sol panel + chat alanı */
#chat-wrapper {
    display: grid;
    grid-template-columns: 260px 1fr;
    height: calc(100vh - 70px); /* header yüksekliğine göre */
}

/* Sol panel (Sohbetler) */
#left-panel {
    background-color: #1e293b;
    padding: 1rem;
    overflow-y: auto;
    border-right: 1px solid #334155;
}

/* Chat alanı */
#chat-container {
    display: flex;
    flex-direction: column;
    padding: 1rem;
}

/* Mesaj listesi – eski id'yi de kapsayalım */
#messages,
.messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: .8rem;
}

/* ============================= */
/* 📱 MOBİL DÜZEN – MAX 768px   */
/* ============================= */

@media (max-width: 768px) {

    /* Header biraz daha kompakt olabilir istersen */
    header {
        padding: 0.7rem 1rem;
    }

    /* Sol paneli tamamen gizle, chat tek sütun olsun */
    #chat-wrapper {
        grid-template-columns: 1fr;
        height: calc(100vh - 55px); /* header’a göre ayarladım */
    }

    #left-panel {
        display: none !important;
    }

    /* Chat alanı tam ekran */
    #chat-container {
        padding: 0.5rem;
        height: 100%;
        display: flex;
        flex-direction: column;
    }

    /* Mesajlar alanı – form sabit olacağı için altına margin veriyoruz */
    #messages,
    .messages {
        flex: 1;
        overflow-y: auto;
        padding: 0.75rem;
        margin-bottom: 80px; /* input alanına yer bırak */
    }

    /* Mesaj balonları biraz daha geniş ve okunaklı */
    .message {
        max-width: 85%;
        font-size: 15px;
        padding: 10px 14px;
    }

    /* Mesaj yazma formu ekranın altına sabitleniyor */
    #chatForm,
    .chat-window form {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        padding: 12px;
        background: #0f172a;
        border-top: 1px solid #334155;
        border-radius: 0;
        display: flex;
        gap: 8px;
        z-index: 50;
    }

    /* textarea ve gönder butonu id’lerini kendi projene göre düzelt */
    #userInput,
    textarea {
        flex: 1;
        height: 52px;
        font-size: 16px;
        padding: 10px;
        resize: none;
        background: #0f172a;
        border: 1px solid #334155;
        border-radius: 8px;
        color: #e2e8f0;
    }

    #sendButton,
    button {
        padding: 14px 18px;
        font-size: 15px;
        border-radius: 8px;
        background: #3b82f6;
        border: none;
        color: white;
        cursor: pointer;
    }

        #sendButton:hover,
        button:hover {
            background: #2563eb;
        }
}
@media (max-width: 768px) {
    #menuToggle {
    }