/*
 * Dosya: chat-core.css
 * Bağlı PHP: tema.php / dobay-akilli-asistan.php
 * Alan: Frontend
 * Tür: Frontend CSS
 * Açıklama: Sohbet penceresinin içerik akışı; header, gövde, mesaj balonları, input, ilgili kartlar ve medya alanları.
 */

/* Header alanı */
#dfa-chat .dfa-chat-header{
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding:12px 14px;
    background:linear-gradient(135deg, var(--dfa-header-start), var(--dfa-header-end));
    color:#fff;
}
#dfa-chat .dfa-chat-header-left{ display:flex; align-items:center; gap:10px; min-width:0; }
#dfa-chat .dfa-chat-header-avatar{
    width:38px;
    height:38px;
    border-radius:50%;
    border:2px solid rgba(255,255,255,0.5);
    background:radial-gradient(circle at 20% 20%, #fff, var(--dfa-main) 48%, var(--dfa-header-end) 100%);
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:18px;
    font-weight:700;
    overflow:hidden;
    flex:0 0 auto;
}
#dfa-chat .dfa-chat-header-avatar img{ width:110%; height:110%; object-fit:contain; transform:translateY(4%); }
#dfa-chat .dfa-chat-header-text{ min-width:0; }
#dfa-chat .dfa-chat-header-text small{ font-size:11px; opacity:.85; display:block; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
#dfa-chat .dfa-chat-header-text strong{ display:block; font-size:13px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
#dfa-chat .dfa-chat-header-right{ display:flex; align-items:center; gap:6px; }

/* Body ve sistem balonları */
#dfa-chat .dfa-chat-body{
    padding:12px 10px 6px;
    overflow-y:auto;
    scroll-behavior:smooth;
    font-size:var(--dfa-fs-desktop);
    background:var(--dfa-bg);
}
#dfa-chat .dfa-chat-body::-webkit-scrollbar{ width:6px; }
#dfa-chat .dfa-chat-body::-webkit-scrollbar-thumb{ background:rgba(0,0,0,0.18); border-radius:999px; }
@media (max-width: 767px){
    #dfa-chat .dfa-chat-body{
        font-size:var(--dfa-fs-mobile);
        padding:14px 12px 10px;
    }
}
#dfa-chat .dfa-system-bubble{
    background:var(--dfa-surface);
    border-radius:14px;
    padding:10px 12px;
    font-size:12px;
    color:#333;
    box-shadow:0 4px 12px rgba(0,0,0,0.06);
    margin-bottom:8px;
    border:1px solid rgba(0,0,0,0.05);
}
#dfa-chat .dfa-system-bubble strong{ display:block; margin-bottom:3px; font-size:13px; }
#dfa-chat .dfa-system-bubble.dfa-page-offer{ margin-top:8px; }
#dfa-chat .dfa-offer-actions{ display:flex; gap:8px; margin-top:10px; flex-wrap:wrap; }

/* Mesaj balonları */
#dfa-chat .dfa-message-row{ display:flex; margin:6px 0; }
#dfa-chat .dfa-message-row.user{ justify-content:flex-end; }
#dfa-chat .dfa-message-row.assistant{ justify-content:flex-start; }
#dfa-chat .dfa-message{
    max-width:84%;
    padding:9px 12px;
    border-radius:14px;
    font-size:1em;
    line-height:1.48;
    word-break:break-word;
}
#dfa-chat .dfa-message.user{
    background:var(--dfa-main);
    color:#fff;
    border-bottom-right-radius:4px;
    box-shadow:0 6px 18px rgba(0,0,0,0.10);
}
#dfa-chat .dfa-message.assistant{
    background:var(--dfa-surface);
    color:var(--dfa-surface-text);
    border-bottom-left-radius:4px;
    box-shadow:0 3px 10px rgba(0,0,0,0.06);
}
#dfa-chat .dfa-message.assistant a{ color:var(--dfa-main); text-decoration:none; border-bottom:1px dotted rgba(0,0,0,0.25); }
#dfa-chat .dfa-message.assistant a:hover{ text-decoration:underline; }
#dfa-chat .dfa-inline-icon{ margin-left:4px; text-decoration:none; border:0 !important; }
#dfa-chat .dfa-inline-icon:hover{ filter:brightness(0.9); }

/* Link blokları ve açıklama */
#dfa-chat .dfa-links-block{
    margin-top:10px;
    padding:8px 10px;
    border-radius:12px;
    background:var(--dfa-surface);
    border:1px solid rgba(0,0,0,0.05);
    font-size:12px;
}
#dfa-chat .dfa-links-block a{ display:block; margin-top:6px; color:var(--dfa-main); border:0; }
#dfa-chat .dfa-disclaimer{
    margin-top:10px;
    padding:8px 10px;
    border-radius:12px;
    background:rgba(177,151,119,0.12);
    border:1px solid rgba(177,151,119,0.35);
    color:#3a2a1e;
    font-size:11px;
    line-height:1.4;
}
#dfa-chat .dfa-status-line{
    padding:4px 12px;
    font-size:11px;
    color:rgba(0,0,0,0.55);
    min-height:18px;
}

/* Input alanı */
#dfa-chat .dfa-chat-input{
    border-top:1px solid rgba(0,0,0,0.06);
    background:var(--dfa-bg);
    padding:8px 8px calc(9px + env(safe-area-inset-bottom, 0px));
}
#dfa-chat .dfa-chat-input-inner{
    display:flex;
    align-items:flex-end;
    gap:8px;
    border-radius:999px;
    background:var(--dfa-input-surface);
    padding:6px 8px 6px 10px;
    border:1px solid rgba(0,0,0,0.06);
}
#dfa-chat .dfa-message-input{
    flex:1;
    border:0;
    outline:none;
    background:transparent;
    resize:none;
    font-size:1em;
    line-height:1.35;
    padding:6px 0;
    color:#111827;
    max-height:160px;
    overflow:auto;
}

/* Quick menu / quick actions */
#dfa-chat .dfa-quick-menu{ margin-top:6px; }
#dfa-chat .dfa-quick-menu-title{ font-size:11px; color:rgba(0,0,0,0.55); margin:8px 2px 6px; }
#dfa-chat .dfa-quick-menu-buttons,
#dfa-chat .dfa-quick-actions{ display:flex; flex-wrap:wrap; gap:6px; }
#dfa-chat .dfa-quick-actions{ gap:8px; margin-top:10px; }

/* Mesaj içi medya */
#dfa-chat .dfa-message.assistant img,
#dfa-chat .dfa-message.assistant figure img{
    max-height:var(--dfa-inline-max-h);
    width:auto;
    max-width:100%;
    border-radius:14px;
    display:block;
    cursor:zoom-in;
    border:1px solid rgba(0,0,0,0.06);
    box-shadow:0 10px 24px rgba(2,6,23,.10);
}

/* Related cards */
#dfa-chat .dfa-links-block{ margin-top:12px; }
#dfa-chat .dfa-links-title{ font-weight:800; margin:0 0 8px 0; letter-spacing:-.01em; }
#dfa-chat .dfa-related-wrap{ display:grid; grid-template-columns:1fr; gap:10px; }
#dfa-chat .dfa-related-card{
    display:flex;
    gap:12px;
    align-items:center;
    padding:12px;
    border-radius:18px;
    border:1px solid rgba(15,23,42,.10);
    background:rgba(255,255,255,.80);
    box-shadow:0 10px 26px rgba(2,6,23,.06);
    transition:transform .18s ease, box-shadow .18s ease, border-color .18s ease;
    overflow:hidden;
}
#dfa-chat .dfa-related-card:hover{ transform:translateY(-2px); box-shadow:0 14px 36px rgba(2,6,23,.12); border-color:rgba(15,23,42,.16); }
#dfa-chat .dfa-related-thumb{
    width:var(--dfa-thumb);
    height:var(--dfa-thumb);
    border-radius:16px;
    flex:0 0 var(--dfa-thumb);
    background:linear-gradient(135deg, rgba(2,6,23,.06), rgba(2,6,23,.02));
    border:1px solid rgba(15,23,42,.10);
    display:flex;
    align-items:center;
    justify-content:center;
    overflow:hidden;
}
#dfa-chat .dfa-related-thumb img{ width:100%; height:100%; object-fit:cover; display:block; cursor:zoom-in; }
#dfa-chat .dfa-related-meta{ min-width:0; flex:1; }
#dfa-chat .dfa-related-title{ font-weight:800; line-height:1.2; margin:0; font-size:13.5px; }
#dfa-chat .dfa-related-title a{ text-decoration:none; }
#dfa-chat .dfa-related-sub{ margin-top:4px; font-size:12px; opacity:.78; line-height:1.25; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
#dfa-chat .dfa-related-cta{
    flex:0 0 auto;
    font-size:12px;
    opacity:.75;
    padding:6px 10px;
    border-radius:999px;
    border:1px solid rgba(15,23,42,.10);
    background:rgba(255,255,255,.70);
    transition:opacity .18s ease, transform .18s ease;
}
#dfa-chat .dfa-related-card:hover .dfa-related-cta{ opacity:.95; transform:translateY(-1px); }
@media (max-width: 520px){
    #dfa-chat .dfa-related-card{ padding:10px; gap:10px; }
    #dfa-chat .dfa-related-thumb{
        width:calc(var(--dfa-thumb) - 6px);
        height:calc(var(--dfa-thumb) - 6px);
        flex-basis:calc(var(--dfa-thumb) - 6px);
        border-radius:15px;
    }
    #dfa-chat .dfa-related-title{ font-size:13px; }
    #dfa-chat .dfa-related-sub{ display:none; }
}
