/* =============================================================================
   DEBIAN AI | CYBER-DARK V8.3
   Geliştirici: Emir Ali Erkılıç
   ============================================================================= */

:root {
    --bg: #080a0f;
    --side: #11141d;
    --text: #e6e9ef;
    --blue: #3a5aff;
    --accent: #00d2ff;
    --border: rgba(255, 255, 255, 0.08);
    --user-msg: #3a5aff;
    --ai-msg: #1c1f2e;
    --panel-bg: #121520;
    --placeholder: rgba(255, 255, 255, 0.25);
    --del-btn: rgba(255, 255, 255, 0.4);
    --lang-bg: rgba(255, 255, 255, 0.04);
    --lang-color: #e6e9ef;
    --input-bg: rgba(255, 255, 255, 0.03);
    --sp-input-bg: rgba(255, 255, 255, 0.04);
}

body.light-mode {
    --bg: #f0f2f5;
    --side: #ffffff;
    --text: #1a1d23;
    --border: rgba(0, 0, 0, 0.12);
    --ai-msg: #ffffff;
    --user-msg: #0052cc;
    --panel-bg: #f9fafb;
    --placeholder: rgba(0, 0, 0, 0.35);
    --del-btn: rgba(0, 0, 0, 0.4);
    --lang-bg: rgba(0, 0, 0, 0.04);
    --lang-color: #1a1d23;
    --input-bg: rgba(0, 0, 0, 0.03);
    --sp-input-bg: rgba(0, 0, 0, 0.04);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    transition: all 0.25s ease;
}

body, html {
    height: 100%;
    width: 100%;
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    overflow: hidden;
}

/* --- LOGIN EKRANI --- */
.login-page {
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at center, #1a1e2e 0%, #050608 100%);
    position: fixed;
    top: 0;
    left: 0;
    padding: 20px;
}

.login-box {
    background: var(--side);
    padding: 40px 30px;
    border-radius: 25px;
    width: 100%;
    max-width: 400px;
    text-align: center;
    border: 2px solid var(--blue);
    box-shadow: 0 0 40px rgba(58, 90, 255, 0.2);
    z-index: 100;
}

.login-box h1 {
    color: var(--blue);
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 10px;
    letter-spacing: -1px;
}

.login-box p {
    font-size: 13px;
    opacity: 0.6;
    margin-bottom: 20px;
}

.login-box input {
    width: 100%;
    padding: 16px;
    margin: 15px 0;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    outline: none;
    font-size: 16px;
    text-align: center;
    font-family: 'Inter', sans-serif;
}

.login-box input::placeholder {
    color: var(--placeholder);
}

.login-box button {
    width: 100%;
    padding: 16px;
    background: var(--blue);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 800;
    font-size: 16px;
    text-transform: uppercase;
    box-shadow: 0 4px 15px rgba(58, 90, 255, 0.4);
    font-family: 'Inter', sans-serif;
}

.login-box button:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

/* --- ANA KONTEYNER --- */
.main-container {
    display: flex;
    width: 100vw;
    height: 100vh;
}

/* --- SIDEBAR --- */
.sidebar {
    width: 300px;
    background: var(--side);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 25px;
    flex-shrink: 0;
}

.new-chat-btn {
    background: var(--blue);
    color: white;
    border: none;
    padding: 14px;
    border-radius: 12px;
    font-weight: 800;
    cursor: pointer;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(58, 90, 255, 0.3);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
}

.new-chat-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.1);
}

#historyList {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    cursor: pointer;
    border: 1px solid transparent;
    font-size: 13px;
    color: var(--text);
}

body.light-mode .history-item {
    background: rgba(0, 0, 0, 0.03);
}

.history-item:hover {
    border-color: var(--blue);
    background: rgba(58, 90, 255, 0.1);
}

.del-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    opacity: 0.4;
    transition: opacity 0.2s;
    padding: 2px 4px;
}

.del-btn:hover {
    opacity: 1;
}

.settings-toggle {
    padding: 14px 16px;
    margin-top: auto;
    background: rgba(58, 90, 255, 0.1);
    border-radius: 12px;
    cursor: pointer;
    font-weight: 700;
    text-align: center;
    border: 1px solid var(--border);
    font-size: 14px;
    color: var(--text);
    margin-bottom: 10px;
}

.settings-toggle:hover {
    background: rgba(58, 90, 255, 0.2);
    border-color: var(--blue);
}

.dev-tag {
    font-size: 9px;
    color: var(--blue);
    text-align: center;
    padding-top: 8px;
    opacity: 0.5;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* --- AYARLAR PANELİ --- */
.settings-panel {
    display: none;
    position: fixed;
    bottom: 85px;
    left: 20px;
    width: 270px;
    background: var(--side);
    padding: 22px;
    border-radius: 18px;
    border: 1px solid rgba(58, 90, 255, 0.45);
    z-index: 999;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}

.settings-panel h3 {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--blue);
    margin-bottom: 16px;
}

.settings-panel input {
    width: 100%;
    padding: 11px 14px;
    background: var(--sp-input-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    margin-bottom: 14px;
    outline: none;
}

.settings-panel input::placeholder {
    color: var(--placeholder);
}

.sp-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sp-btn {
    width: 100%;
    padding: 11px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    border: none;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s ease;
}

.sp-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.1);
}

.sp-save {
    background: var(--blue);
    color: white;
    box-shadow: 0 4px 14px rgba(58, 90, 255, 0.35);
}

.sp-theme {
    background: rgba(58, 90, 255, 0.12);
    color: var(--blue);
    border: 1px solid rgba(58, 90, 255, 0.35) !important;
}

.sp-close {
    background: rgba(255, 50, 50, 0.08);
    color: #ff4d4d;
    border: 1px solid rgba(255, 50, 50, 0.2) !important;
}

/* --- DİL BUTONLARI --- */
.sp-lang {
    display: flex;
    gap: 8px;
}

.lang-btn {
    flex: 1;
    padding: 10px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    background: var(--lang-bg);
    color: var(--lang-color);
    border: 1px solid var(--border);
    transition: all 0.2s ease;
    opacity: 0.6;
}

.lang-btn.active {
    background: rgba(58, 90, 255, 0.15);
    border-color: rgba(58, 90, 255, 0.5) !important;
    color: var(--blue);
    opacity: 1;
}

.lang-btn:hover {
    opacity: 1;
}

/* --- CHAT ALANI --- */
.chat-window {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    width: 100%;
    overflow: hidden;
}

.messages {
    flex: 1;
    overflow-y: auto;
    padding: 40px 10%;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.user-bubble {
    align-self: flex-end;
    background: var(--user-msg);
    color: white;
    padding: 15px 20px;
    border-radius: 20px 20px 0 20px;
    max-width: 75%;
    font-size: 15px;
    line-height: 1.6;
    word-wrap: break-word;
}

.ai-bubble {
    align-self: flex-start;
    background: var(--ai-msg);
    color: var(--text);
    padding: 15px 20px;
    border-radius: 20px 20px 20px 0;
    max-width: 75%;
    border: 1px solid var(--border);
    font-size: 15px;
    line-height: 1.6;
    word-wrap: break-word;
}

body.light-mode .ai-bubble {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* --- INPUT ALANI --- */
.input-area {
    padding: 20px 10% 40px;
    flex-shrink: 0;
}

.input-box {
    background: var(--side);
    border: 1px solid var(--border);
    border-radius: 20px;
    display: flex;
    align-items: center;
    padding: 8px 20px;
}

.input-box:focus-within {
    border-color: rgba(58, 90, 255, 0.5);
}

.input-box input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text);
    padding: 12px;
    outline: none;
    font-size: 16px;
    font-family: 'Inter', sans-serif;
}

.input-box input::placeholder {
    color: var(--placeholder);
}

.send-btn {
    background: none;
    border: none;
    color: var(--blue);
    font-size: 26px;
    cursor: pointer;
    padding: 4px 8px;
    transition: transform 0.2s;
}

.send-btn:hover {
    transform: scale(1.15);
}

/* --- MOBİL --- */
@media (max-width: 768px) {
    .sidebar {
        display: none;
    }
    .messages {
        padding: 20px 5% !important;
    }
    .input-area {
        padding: 15px 5% 25px !important;
    }
}

/* --- SCROLLBAR --- */
::-webkit-scrollbar {
    width: 5px;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 10px;
}