/*
 * Dosya: chat-layout.css
 * Bağlı PHP: tema.php / dobay-akilli-asistan.php
 * Alan: Frontend
 * Tür: Frontend CSS
 * Açıklama: Sohbet penceresinin yerleşimi, launcher konumu, mobil/tam ekran davranışı ve sayfa ipucu katmanı.
 */

/* Temel izolasyon ve font render kalitesi */
#dfa-launcher,
#dfa-chat,
#dfa-page-hint{
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    z-index: 999999;
}

/* Klavye ve erişilebilirlik odak halkası */
#dfa-chat :where(button, a, textarea, [role="button"]):focus{ outline:none; }
#dfa-chat :where(button, a, textarea, [role="button"]):focus-visible{
    outline:2px solid rgba(11,124,131,0.35);
    outline-offset:2px;
}

/* Launcher ana taşıyıcı */
#dfa-launcher.dfa-launcher{
    position:fixed;
    bottom:20px;
    display:flex;
    align-items:center;
    gap:8px;
    cursor:pointer;
    user-select:none;
    -webkit-tap-highlight-color:transparent;
    touch-action:manipulation;
}
#dfa-launcher.dfa-launcher.dfa-desktop-left{ left:20px; right:auto; }
#dfa-launcher.dfa-launcher.dfa-desktop-right{ right:20px; left:auto; flex-direction:row-reverse; }
@media (max-width: 767px){
    #dfa-launcher.dfa-launcher{ bottom:calc(16px + env(safe-area-inset-bottom, 0px)); }
    #dfa-launcher.dfa-launcher.dfa-mobile-left{ left:16px; right:auto; }
    #dfa-launcher.dfa-launcher.dfa-mobile-right{ right:16px; left:auto; flex-direction:row-reverse; }
}

/* Chat pencere iskeleti */
#dfa-chat.dfa-chat-window{
    position:fixed;
    bottom:90px;
    width:var(--dfa-chat-w);
    max-width:calc(100vw - 32px);
    max-height:var(--dfa-max-h);
    display:none;
    flex-direction:column;
    border-radius:var(--dfa-radius);
    box-shadow:var(--dfa-shadow);
    overflow:hidden;
    border:var(--dfa-border);
}
#dfa-chat.dfa-chat-window.dfa-desktop-left{ left:20px; right:auto; }
#dfa-chat.dfa-chat-window.dfa-desktop-right{ right:20px; left:auto; }
@media (min-width: 768px) and (max-width: 1024px){
    #dfa-chat.dfa-chat-window{ width:min(520px, calc(100vw - 32px)); }
}
@media (min-width: 1400px){
    #dfa-chat.dfa-chat-window{ width:min(560px, calc(100vw - 40px)); }
    #dfa-chat .dfa-chat-body{ padding:14px 12px 8px; }
}
@media (max-width: 767px){
    #dfa-chat.dfa-chat-window{
        left:0 !important;
        right:0 !important;
        bottom:0;
        top:0;
        width:100%;
        max-width:100%;
        border-radius:0;
        height:100vh;
        height:100dvh;
        max-height:none;
    }
}

/* Sayfa ipucu katmanı */
#dfa-page-hint.dfa-page-hint{
    position:fixed;
    z-index:999998;
    max-width:260px;
    font-size:11px;
    background:#fff;
    color:#333;
    padding:6px 10px;
    border-radius:10px;
    box-shadow:0 10px 24px rgba(0,0,0,0.18);
    cursor:pointer;
    border:1px solid rgba(0,0,0,0.08);
}
#dfa-page-hint.dfa-page-hint.dfa-desktop-left{ left:26px; bottom:88px; }
#dfa-page-hint.dfa-page-hint.dfa-desktop-right{ right:26px; bottom:88px; }
@media (max-width: 767px){ #dfa-page-hint.dfa-page-hint{ display:none; } }

/* Reduced motion */
@media (prefers-reduced-motion: reduce){
    #dfa-launcher .dfa-launcher-avatar,
    #dfa-chat .dfa-icon-btn,
    #dfa-chat .dfa-mode-btn,
    #dfa-chat .dfa-offer-btn,
    #dfa-chat .dfa-quick-menu-btn,
    #dfa-chat .dfa-quick-action-btn,
    #dfa-chat .dfa-mic-btn,
    #dfa-chat .dfa-send-btn{
        transition:none !important;
        animation:none !important;
    }
}
