/* =========================================================
   DARA AFFILIATION — CHATBOT PREMIUM
========================================================= */

#dara-chatbot{
    position:fixed;
    right:22px;
    bottom:22px;
    z-index:10080;
    font-family:'Poppins',sans-serif;
}

/* ---------- BULLE FLOTTANTE ---------- */
#dara-chat-toggle{
    position:relative;
    width:64px;
    height:64px;
    border:none;
    border-radius:50%;
    cursor:pointer;
    display:flex;
    align-items:center;
    justify-content:center;
    background:linear-gradient(135deg,#0d6efd,#21c7ff);
    color:#fff;
    font-size:24px;
    box-shadow:0 18px 45px rgba(13,110,253,.45),0 0 0 1px rgba(255,255,255,.08);
    transition:.4s cubic-bezier(.2,.8,.2,1);
}

#dara-chat-toggle:hover{
    transform:translateY(-4px) scale(1.05);
    box-shadow:0 24px 60px rgba(33,199,255,.55);
}

#dara-chat-toggle .chat-icon-close{display:none;}

#dara-chatbot.open #dara-chat-toggle .chat-icon-open{display:none;}
#dara-chatbot.open #dara-chat-toggle .chat-icon-close{display:block;}

.dara-chat-ping{
    position:absolute;
    top:-3px;
    right:-3px;
    width:16px;
    height:16px;
    border-radius:50%;
    background:#ffb020;
    box-shadow:0 0 0 3px rgba(2,5,12,1);
    animation:daraPing 1.8s ease-in-out infinite;
}

#dara-chatbot.open .dara-chat-ping{display:none;}

@keyframes daraPing{
    0%,100%{transform:scale(1);opacity:1;}
    50%{transform:scale(1.25);opacity:.6;}
}

/* ---------- FENETRE DE CHAT ---------- */
#dara-chat-window{
    position:absolute;
    right:0;
    bottom:82px;
    width:370px;
    max-width:calc(100vw - 32px);
    height:520px;
    max-height:70vh;
    display:flex;
    flex-direction:column;
    overflow:hidden;
    border-radius:24px;
    background:linear-gradient(180deg,rgba(9,16,30,.98),rgba(4,8,17,.98));
    border:1px solid rgba(87,181,255,.22);
    box-shadow:0 35px 100px rgba(0,0,0,.55),0 0 0 1px rgba(255,255,255,.04);
    backdrop-filter:blur(20px);
    -webkit-backdrop-filter:blur(20px);
    opacity:0;
    transform:translateY(24px) scale(.95);
    pointer-events:none;
    transition:.4s cubic-bezier(.2,.8,.2,1);
}

#dara-chatbot.open #dara-chat-window{
    opacity:1;
    transform:none;
    pointer-events:auto;
}

/* ---------- HEADER ---------- */
.dara-chat-header{
    display:flex;
    align-items:center;
    gap:12px;
    padding:16px 16px;
    background:linear-gradient(120deg,rgba(13,110,253,.20),rgba(33,199,255,.08));
    border-bottom:1px solid rgba(255,255,255,.07);
}

.dara-chat-avatar{
    position:relative;
    width:42px;
    height:42px;
    border-radius:50%;
    overflow:hidden;
    border:2px solid rgba(33,199,255,.45);
    flex-shrink:0;
}

.dara-chat-avatar img{
    width:100%;
    height:100%;
    object-fit:cover;
}

.dara-online-dot{
    position:absolute;
    bottom:0;
    right:0;
    width:11px;
    height:11px;
    border-radius:50%;
    background:#2ee6a6;
    border:2px solid #04070f;
}

.dara-chat-title{
    display:flex;
    flex-direction:column;
    line-height:1.25;
    flex:1;
}

.dara-chat-title strong{
    color:#fff;
    font-size:15px;
}

.dara-chat-title span{
    color:#8fe0b3;
    font-size:11.5px;
    font-weight:500;
}

#dara-chat-close{
    background:rgba(255,255,255,.06);
    border:none;
    color:#cfe0f5;
    width:30px;
    height:30px;
    border-radius:50%;
    cursor:pointer;
    display:flex;
    align-items:center;
    justify-content:center;
    transition:.3s;
}

#dara-chat-close:hover{
    background:rgba(255,80,80,.18);
    color:#ff8080;
}

/* ---------- CORPS DU CHAT ---------- */
.dara-chat-body{
    flex:1;
    padding:16px;
    overflow-y:auto;
    display:flex;
    flex-direction:column;
    gap:10px;
    scroll-behavior:smooth;
}

.dara-chat-body::-webkit-scrollbar{width:5px;}
.dara-chat-body::-webkit-scrollbar-thumb{
    background:linear-gradient(#0066ff,#00c6ff);
    border-radius:20px;
}

.dara-msg{
    max-width:82%;
    padding:11px 14px;
    border-radius:16px;
    font-size:13.5px;
    line-height:1.55;
    animation:daraPop .35s cubic-bezier(.2,.8,.2,1) both;
}

@keyframes daraPop{
    from{opacity:0;transform:translateY(10px) scale(.96);}
    to{opacity:1;transform:none;}
}

.dara-msg.bot{
    align-self:flex-start;
    background:rgba(255,255,255,.07);
    border:1px solid rgba(255,255,255,.08);
    color:#e5eefb;
    border-bottom-left-radius:4px;
}

.dara-msg.user{
    align-self:flex-end;
    background:linear-gradient(135deg,#0d6efd,#21c7ff);
    color:#fff;
    font-weight:500;
    border-bottom-right-radius:4px;
}

.dara-msg a{
    color:#ffd07a;
    text-decoration:underline;
}

/* Typing indicator */
.dara-typing{
    align-self:flex-start;
    display:flex;
    align-items:center;
    gap:4px;
    padding:12px 16px;
    border-radius:16px;
    background:rgba(255,255,255,.07);
    border:1px solid rgba(255,255,255,.08);
}

.dara-typing span{
    width:6px;
    height:6px;
    border-radius:50%;
    background:#7fd3ff;
    animation:daraBlink 1.2s infinite ease-in-out;
}

.dara-typing span:nth-child(2){animation-delay:.2s;}
.dara-typing span:nth-child(3){animation-delay:.4s;}

@keyframes daraBlink{
    0%,80%,100%{opacity:.25;transform:translateY(0);}
    40%{opacity:1;transform:translateY(-3px);}
}

/* ---------- SUGGESTIONS RAPIDES ---------- */
.dara-chat-quickreplies{
    display:flex;
    flex-wrap:wrap;
    gap:7px;
    padding:0 14px 12px;
}

.dara-chip{
    border:1px solid rgba(33,199,255,.35);
    background:rgba(33,199,255,.08);
    color:#bfe6ff;
    font-size:11.5px;
    font-weight:600;
    padding:7px 12px;
    border-radius:30px;
    cursor:pointer;
    transition:.3s;
    white-space:nowrap;
}

.dara-chip:hover{
    background:rgba(33,199,255,.22);
    transform:translateY(-2px);
    color:#fff;
}

/* ---------- SAISIE ---------- */
.dara-chat-input{
    display:flex;
    align-items:center;
    gap:8px;
    padding:12px 14px;
    border-top:1px solid rgba(255,255,255,.07);
    background:rgba(255,255,255,.02);
}

.dara-chat-input input{
    flex:1;
    border:1px solid rgba(255,255,255,.10);
    background:rgba(0,0,0,.25);
    color:#fff;
    padding:11px 14px;
    border-radius:30px;
    font-size:13px;
    font-family:inherit;
    outline:none;
    transition:.3s;
}

.dara-chat-input input:focus{
    border-color:rgba(33,199,255,.55);
    box-shadow:0 0 0 3px rgba(33,199,255,.10);
}

.dara-chat-input button{
    width:42px;
    height:42px;
    flex-shrink:0;
    border:none;
    border-radius:50%;
    background:linear-gradient(135deg,#0d6efd,#21c7ff);
    color:#fff;
    cursor:pointer;
    display:flex;
    align-items:center;
    justify-content:center;
    transition:.3s;
}

.dara-chat-input button:hover{
    transform:scale(1.08);
    box-shadow:0 10px 25px rgba(33,199,255,.4);
}

/* ---------- MOBILE ---------- */
@media(max-width:480px){
    #dara-chatbot{right:14px;bottom:14px;}
    #dara-chat-window{
        width:calc(100vw - 24px);
        height:72vh;
        bottom:78px;
        right:-6px;
    }
    #dara-chat-toggle{width:58px;height:58px;font-size:22px;}
}
