/* ==========================================================================
   TTK ASİSTAN ROBOT - CSS TASARIMI (GÜNCEL)
   ========================================================================== */

/* Ana Kapsayıcı (Sol Alt Köşe) */
#ttk-character-search-wrapper { 
    position: fixed; 
    bottom: 25px; 
    left: 25px; 
    z-index: 999999; 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; 
}

/* Tetikleyici Alan */
#ttk-character-trigger { 
    position: relative; 
    cursor: pointer; 
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
}

/* 1. KARAKTER GÖRSELİ (Büyütüldü: 85px -> 130px) */
.ttk-character-img { 
    width: 130px; 
    height: auto; 
    display: block;
    filter: drop-shadow(0px 8px 15px rgba(0, 0, 0, 0.25)); 
    transition: transform 0.2s ease;
}

#ttk-character-trigger:hover .ttk-character-img {
    transform: scale(1.04);
}

/* Konuşma Balonu (Açıkken Gizlenir) */
.ttk-speech-bubble { 
    background: #1e293b; 
    color: #fff; 
    font-size: 11px; 
    padding: 6px 10px; 
    border-radius: 10px; 
    margin-bottom: 6px; 
    white-space: nowrap; 
    pointer-events: none; /* Tıklamaların alttaki ögelere geçmesini sağlar */
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

/* Chat penceresi açıkken konuşma balonunu tamamen saklar */
#ttk-character-search-wrapper:has(#ttk-search-popup:not(.ttk-popup-hidden)) .ttk-speech-bubble { 
    opacity: 0; 
    visibility: hidden; 
}

/* 2. POP-UP CHAT KUTUSU VE KATMAN DÜZENLEMESİ */
#ttk-search-popup { 
    position: absolute; 
    bottom: 150px; /* Büyüyen karaktere göre yukarısı ayarlandı */
    left: 0; 
    width: 320px; 
    max-width: 85vw;
    background: #0f172a; 
    border: 1px solid #334155; 
    border-radius: 16px; 
    padding: 14px; 
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4); 
    display: flex; 
    flex-direction: column; 
    gap: 10px; 
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1); 
    z-index: 1000000; /* Tıklama alanının üste geçmesini garantiler */
}

/* Gizli Durum (Kapalıyken Tıklama Almaz) */
.ttk-popup-hidden { 
    opacity: 0; 
    visibility: hidden; 
    transform: scale(0.85) translateY(15px); 
    pointer-events: none; /* Gizliyken ekrandaki tıklamaları engellemez */
}

/* Başlık Alanı */
.ttk-popup-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    color: #f8fafc; 
    font-size: 13px; 
    font-weight: bold; 
    border-bottom: 1px solid #1e293b; 
    padding-bottom: 8px; 
}

#ttk-popup-close { 
    background: none; 
    border: none; 
    color: #94a3b8; 
    font-size: 20px; 
    cursor: pointer; 
    line-height: 1;
    padding: 0 4px;
}

#ttk-popup-close:hover {
    color: #ffffff;
}

/* Mesaj Alanı */
#ttk-chat-body { 
    height: 220px; 
    overflow-y: auto; 
    display: flex; 
    flex-direction: column; 
    gap: 8px; 
    padding-right: 4px; 
}

.ttk-msg { 
    font-size: 12px; 
    padding: 8px 12px; 
    border-radius: 12px; 
    max-width: 85%; 
    line-height: 1.4; 
    word-wrap: break-word;
}

.ttk-msg-bot { 
    background: #1e293b; 
    color: #e2e8f0; 
    align-self: flex-start; 
    border-bottom-left-radius: 2px; 
}

.ttk-msg-user { 
    background: #ff6600; 
    color: #ffffff; 
    align-self: flex-end; 
    border-bottom-right-radius: 2px; 
}

.ttk-read-more { 
    display: inline-block; 
    margin-top: 6px; 
    color: #38bdf8; 
    text-decoration: none; 
    font-size: 11px; 
    font-weight: bold; 
}

/* Form Alanı */
#ttk-chat-form { 
    display: flex; 
    gap: 6px; 
}

#ttk-chat-input { 
    background: #1e293b; 
    border: 1px solid #334155; 
    border-radius: 8px; 
    padding: 8px 10px; 
    color: #fff; 
    font-size: 12px; 
    width: 100%; 
    outline: none; 
}

#ttk-chat-input:focus {
    border-color: #ff6600;
}

#ttk-chat-form button { 
    background: #ff6600; 
    border: none; 
    color: #fff; 
    border-radius: 8px; 
    padding: 0 14px; 
    cursor: pointer; 
    font-weight: bold;
    transition: background 0.2s ease;
}

#ttk-chat-form button:hover {
    background: #e65c00;
}