/* =========================================================
   TITAN SAVUNMA COGNITIVE CORE V3.0 | EXECUTIVE & CORPORATE STİL
   
   🔧 V3.0: Fütüristik neonlar silindi, ağır "Executive Navy & Titanium" eklendi.
   ========================================================= */

:root {
    --t-bg: #090c10; /* Derin Kurumsal Siyah */
    --t-panel-base: rgba(14, 20, 28, 0.95); /* Mat Antrasit */
    --t-panel-deep: #0e141c; 
    --t-border: rgba(255, 255, 255, 0.05);
    --t-border-strong: rgba(255, 255, 255, 0.1);
    
    --t-primary: #1e3a8a; /* Ağır Kurumsal Lacivert (Executive Navy) */
    --t-primary-hover: #1e40af;
    --t-primary-soft: rgba(30, 58, 138, 0.1);
    
    --t-titanium: #94a3b8; /* Titanyum / Gümüş Vurgular */
    --t-titanium-soft: rgba(148, 163, 184, 0.15);
    
    --t-accent: #059669; /* Mat Onay Yeşili (Online) */
    
    --t-text: #e2e8f0;
    --t-text-bright: #ffffff;
    --t-text-muted: #64748b;
    
    --t-ease: cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* =========================================================
   ✨ WRAPPER + TETİKLEYİCİ (SOLA HİZALI)
   ========================================================= */
#titan-ai-wrapper {
    position: fixed;
    bottom: 30px;
    left: 30px;
    z-index: 999999;
    font-family: 'Inter', sans-serif;
}

#titan-ai-trigger {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--t-bg);
    border: 2px solid var(--t-primary);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s var(--t-ease);
    display: flex;
    align-items: center;
    justify-content: center;
}

#titan-ai-trigger:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6);
    border-color: var(--t-titanium);
}

#titan-ai-trigger img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
    border-radius: 50%;
    transform: scale(1.15);
    transition: transform 0.3s var(--t-ease);
}

#titan-ai-trigger:hover img {
    transform: scale(1.18);
}

/* =========================================================
   ✨ ANA TERMİNAL PENCERESİ (SOLDAN AÇILIR)
   ========================================================= */
#titan-ai-window {
    position: absolute;
    bottom: 95px;
    left: 0;
    width: 380px;
    height: 560px; 
    background: var(--t-panel-deep);
    border: 1px solid var(--t-border-strong);
    border-radius: 4px; /* Keskin, kurumsal köşeler */
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
    display: none;
    flex-direction: column;
    overflow: hidden;
    transform-origin: bottom left;
    animation: titanPop 0.3s var(--t-ease) forwards;
}

@keyframes titanPop {
    0% { opacity: 0; transform: scale(0.95) translateY(10px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

/* =========================================================
   ✨ HEADER
   ========================================================= */
#titan-ai-header {
    background: #090c10;
    padding: 16px 20px;
    border-bottom: 1px solid var(--t-border-strong);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#titan-ai-header .title {
    color: var(--t-titanium);
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 8px;
}

#titan-ai-header .title::before {
    content: '';
    display: block;
    width: 6px;
    height: 6px;
    background: var(--t-accent);
    border-radius: 50%;
    box-shadow: 0 0 4px var(--t-accent);
}

#titan-ai-close {
    color: var(--t-text-muted);
    cursor: pointer;
    font-size: 1.1rem;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

#titan-ai-close:hover {
    color: var(--t-text-bright);
}

/* =========================================================
   ✨ MESAJ ALANI (GÖVDE)
   ========================================================= */
#titan-ai-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scrollbar-width: thin;
    scrollbar-color: var(--t-primary) transparent;
}

#titan-ai-body::-webkit-scrollbar { width: 4px; }
#titan-ai-body::-webkit-scrollbar-track { background: transparent; }
#titan-ai-body::-webkit-scrollbar-thumb { background: var(--t-primary); border-radius: 2px; }

/* MESAJ BALONLARI */
.t-msg {
    max-width: 85%;
    line-height: 1.6;
    font-size: 0.88rem;
    padding: 12px 16px;
    border-radius: 4px;
    white-space: pre-wrap;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    animation: msgFadeIn 0.3s ease-out forwards;
}

@keyframes msgFadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

.t-msg.bot {
    background: #111827;
    color: var(--t-text);
    border-left: 3px solid var(--t-primary);
    align-self: flex-start;
}

.t-msg.user {
    background: var(--t-primary);
    color: var(--t-text-bright);
    align-self: flex-end;
    text-align: right;
}

/* =========================================================
   ✨ SEÇENEK BUTONLARI (CHIPS)
   ========================================================= */
#titan-ai-options {
    padding: 12px 20px;
    background: #090c10;
    border-top: 1px solid var(--t-border-strong);
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 250px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--t-primary) transparent;
}

.t-option-btn {
    background: transparent;
    color: var(--t-text);
    border: 1px solid var(--t-border-strong);
    padding: 10px 14px;
    border-radius: 3px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 0.82rem;
    text-align: left;
    transition: all 0.2s ease;
    font-weight: 500;
}

.t-option-btn:hover {
    background: var(--t-primary-soft);
    border-color: var(--t-primary);
    color: var(--t-text-bright);
    padding-left: 18px; /* Hafif içeri kayma efekti */
}

/* =========================================================
   ✨ YENİ: FREE-TEXT CHAT INPUT BAR
   ========================================================= */
#titan-ai-input-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: #090c10;
    border-top: 1px solid var(--t-border-strong);
}

#titan-ai-input {
    flex: 1;
    background: #111827;
    border: 1px solid var(--t-border-strong);
    color: var(--t-text-bright);
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    padding: 10px 12px;
    border-radius: 3px;
    outline: none;
    transition: border-color 0.2s;
}

#titan-ai-input::placeholder {
    color: var(--t-text-muted);
}

#titan-ai-input:focus {
    border-color: var(--t-primary);
}

#titan-ai-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#titan-ai-send {
    width: 38px;
    height: 38px;
    background: var(--t-primary);
    border: none;
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

#titan-ai-send:hover:not(:disabled) {
    background: var(--t-primary-hover);
}

#titan-ai-send:disabled {
    background: var(--t-border-strong);
    color: var(--t-text-muted);
    cursor: not-allowed;
}

/* =========================================================
   ✨ MOBİL DUYARLILIK
   ========================================================= */
@media (max-width: 480px) {
    #titan-ai-wrapper {
        bottom: 20px;
        left: 20px;
    }
    
    #titan-ai-trigger {
        width: 65px;
        height: 65px;
    }
    
    #titan-ai-window {
        width: calc(100vw - 30px);
        height: 75vh;
        bottom: 80px;
        left: -5px;
        max-width: 400px;
    }
    
    #titan-ai-header { padding: 12px 16px; }
    #titan-ai-body { padding: 16px; }
    .t-msg { font-size: 0.82rem; }
    #titan-ai-options { padding: 10px 16px; }
    .t-option-btn { font-size: 0.78rem; padding: 8px 12px; }
    #titan-ai-input-bar { padding: 10px 16px; }
}