/* =========================================================
   EMDY CHATBOT WIDGET
========================================================= */

.emdy-chatbot,
.emdy-chatbot *{
    box-sizing:border-box;
    font-family:"Times New Roman", Times, serif;
}

.emdy-chatbot{
    position:fixed;
    right:24px;
    bottom:24px;
    z-index:999999;
}

.emdy-chatbot-toggle{
    width:82px;
    height:82px;
    border:none;
    border-radius:50%;
    color:#fff;
    background:linear-gradient(135deg,#ff7aa5,#ff2e74);
    box-shadow:0 18px 45px rgba(255,46,116,.35);
    cursor:pointer;
    display:grid;
    place-items:center;
    gap:0;
    animation:emdyBotPulse 2.3s infinite;
}

.emdy-chatbot-toggle span{
    font-size:30px;
    line-height:1;
}

.emdy-chatbot-toggle small{
    margin-top:-8px;
    font-size:13px;
    font-weight:900;
}

@keyframes emdyBotPulse{
    0%,100%{transform:translateY(0)}
    50%{transform:translateY(-4px)}
}

.emdy-chatbot-panel{
    position:absolute;
    right:0;
    bottom:96px;
    width:390px;
    height:590px;
    border-radius:30px;
    overflow:hidden;
    background:#fff;
    border:1px solid rgba(255,46,116,.18);
    box-shadow:0 24px 70px rgba(33,21,27,.22);
    display:none;
    grid-template-rows:auto 1fr auto auto;
}

.emdy-chatbot.active .emdy-chatbot-panel{
    display:grid;
}

.emdy-chatbot-head{
    padding:18px 20px;
    background:linear-gradient(135deg,#ff7aa5,#ff2e74);
    color:#fff;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
}

.emdy-chatbot-head strong{
    display:block;
    font-size:22px;
    line-height:1.1;
}

.emdy-chatbot-head span{
    display:block;
    margin-top:4px;
    font-size:14px;
    opacity:.95;
    font-weight:700;
}

.emdy-chatbot-head button{
    width:38px;
    height:38px;
    border:none;
    border-radius:50%;
    background:rgba(255,255,255,.22);
    color:#fff;
    cursor:pointer;
    font-size:28px;
    line-height:1;
}

.emdy-chatbot-body{
    padding:18px;
    overflow-y:auto;
    background:
        radial-gradient(circle at 15% 15%,rgba(255,122,165,.16),transparent 28%),
        #fff8fb;
}

.emdy-chat-message{
    display:flex;
    margin-bottom:12px;
}

.emdy-chat-message.user{
    justify-content:flex-end;
}

.emdy-chat-message .bubble{
    max-width:82%;
    padding:12px 14px;
    border-radius:18px;
    font-size:16px;
    line-height:1.45;
    box-shadow:0 8px 22px rgba(255,46,116,.08);
}

.emdy-chat-message.bot .bubble{
    color:#21151b;
    background:#fff;
    border-bottom-left-radius:6px;
}

.emdy-chat-message.user .bubble{
    color:#fff;
    background:linear-gradient(135deg,#ff7aa5,#ff2e74);
    border-bottom-right-radius:6px;
}

.emdy-chat-message.typing .bubble{
    display:flex;
    gap:5px;
    align-items:center;
    min-width:58px;
}

.emdy-chat-message.typing i{
    width:7px;
    height:7px;
    border-radius:50%;
    background:#ff2e74;
    animation:emdyTyping 1s infinite ease-in-out;
}

.emdy-chat-message.typing i:nth-child(2){
    animation-delay:.15s;
}

.emdy-chat-message.typing i:nth-child(3){
    animation-delay:.3s;
}

@keyframes emdyTyping{
    0%,80%,100%{opacity:.35;transform:translateY(0)}
    40%{opacity:1;transform:translateY(-4px)}
}

.emdy-chat-products{
    display:grid;
    gap:10px;
    margin:4px 0 14px;
}

.emdy-chat-product{
    display:grid;
    grid-template-columns:78px 1fr;
    gap:12px;
    padding:10px;
    border-radius:18px;
    background:#fff;
    border:1px solid rgba(255,46,116,.12);
    box-shadow:0 8px 22px rgba(255,46,116,.08);
}

.emdy-chat-product img{
    width:78px;
    height:96px;
    border-radius:14px;
    object-fit:cover;
}

.emdy-chat-product strong{
    display:block;
    color:#21151b;
    font-size:16px;
    line-height:1.3;
}

.emdy-chat-product span{
    display:block;
    color:#7d6871;
    margin:4px 0;
    font-size:13px;
    font-weight:800;
}

.emdy-chat-product b{
    display:block;
    color:#ff2e74;
    font-size:17px;
}

.emdy-chat-product .actions{
    margin-top:8px;
    display:flex;
    gap:8px;
    align-items:center;
}

.emdy-chat-product a,
.emdy-chat-product button{
    height:32px;
    padding:0 12px;
    border:none;
    border-radius:999px;
    color:#fff;
    background:#ff2e74;
    text-decoration:none;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    font-size:13px;
    font-weight:900;
    cursor:pointer;
}

.emdy-chat-product form{
    margin:0;
}

.emdy-chatbot-suggestions{
    padding:10px 14px;
    background:#fff;
    border-top:1px solid rgba(255,46,116,.12);
    display:flex;
    gap:8px;
    overflow-x:auto;
}

.emdy-chatbot-suggestions button{
    height:34px;
    padding:0 12px;
    border:none;
    border-radius:999px;
    color:#ff2e74;
    background:#fff3f8;
    white-space:nowrap;
    cursor:pointer;
    font-size:14px;
    font-weight:900;
}

.emdy-chatbot-form{
    padding:14px;
    background:#fff;
    border-top:1px solid rgba(255,46,116,.12);
    display:grid;
    grid-template-columns:1fr 72px;
    gap:10px;
}

.emdy-chatbot-form input{
    height:46px;
    border:1px solid rgba(255,46,116,.16);
    border-radius:999px;
    outline:none;
    background:#fff3f8;
    padding:0 16px;
    color:#21151b;
    font-size:16px;
}

.emdy-chatbot-form input:focus{
    background:#fff;
    border-color:rgba(255,46,116,.45);
    box-shadow:0 0 0 4px rgba(255,46,116,.08);
}

.emdy-chatbot-form button{
    height:46px;
    border:none;
    border-radius:999px;
    color:#fff;
    background:linear-gradient(135deg,#ff7aa5,#ff2e74);
    cursor:pointer;
    font-size:16px;
    font-weight:900;
}

@media(max-width:520px){
    .emdy-chatbot{
        right:14px;
        bottom:14px;
    }

    .emdy-chatbot-panel{
        width:calc(100vw - 28px);
        height:calc(100vh - 130px);
        bottom:86px;
    }

    .emdy-chatbot-toggle{
        width:70px;
        height:70px;
    }
}

/* =========================================================
   EMDY ADMIN CHATBOT
========================================================= */

.emdy-admin-chat-page,
.emdy-admin-chat-page *{
    box-sizing:border-box;
    font-family:"Times New Roman", Times, serif;
}

.emdy-admin-chat-page{
    min-height:100vh;
    background:linear-gradient(180deg,#fff8fb,#fff);
    color:#21151b;
    padding:30px;
}

.emdy-admin-chat-hero{
    margin-bottom:24px;
    display:flex;
    align-items:flex-end;
    justify-content:space-between;
    gap:20px;
}

.emdy-admin-chat-hero span{
    color:#ff2e74;
    font-weight:900;
    letter-spacing:2px;
}

.emdy-admin-chat-hero h1{
    margin:6px 0 8px;
    font-size:42px;
}

.emdy-admin-chat-hero p{
    margin:0;
    color:#7d6871;
    font-size:18px;
}

.emdy-admin-chat-alert{
    margin-bottom:20px;
    padding:15px 18px;
    border-radius:18px;
    color:#137333;
    background:#e9f8ee;
    border:1px solid #bde9c8;
    font-weight:900;
}

.emdy-admin-chat-layout{
    display:grid;
    grid-template-columns:360px 1fr;
    gap:22px;
    align-items:start;
}

.emdy-admin-chat-list,
.emdy-admin-chat-detail{
    background:#fff;
    border:1px solid rgba(255,46,116,.16);
    border-radius:28px;
    box-shadow:0 18px 55px rgba(255,46,116,.14);
}

.emdy-admin-chat-list{
    padding:12px;
    max-height:calc(100vh - 140px);
    overflow-y:auto;
}

.emdy-admin-chat-list a{
    display:block;
    padding:15px;
    border-radius:20px;
    color:#21151b;
    text-decoration:none;
    margin-bottom:8px;
    background:#fff3f8;
    transition:.22s;
}

.emdy-admin-chat-list a.active,
.emdy-admin-chat-list a:hover{
    color:#fff;
    background:linear-gradient(135deg,#ff7aa5,#ff2e74);
}

.emdy-admin-chat-list strong{
    display:block;
    font-size:17px;
}

.emdy-admin-chat-list span{
    display:block;
    margin:6px 0;
    font-size:15px;
    opacity:.85;
}

.emdy-admin-chat-list small{
    font-weight:900;
}

.emdy-admin-chat-detail{
    overflow:hidden;
}

.emdy-admin-chat-info{
    padding:22px;
    border-bottom:1px solid rgba(255,46,116,.14);
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:18px;
}

.emdy-admin-chat-info h2{
    margin:0 0 8px;
    font-size:30px;
}

.emdy-admin-chat-info p{
    margin:4px 0;
    color:#7d6871;
    font-weight:800;
}

.emdy-admin-chat-info button,
.emdy-admin-chat-note button{
    height:46px;
    padding:0 18px;
    border:none;
    border-radius:999px;
    color:#fff;
    background:linear-gradient(135deg,#ff7aa5,#ff2e74);
    cursor:pointer;
    font-weight:900;
}

.emdy-admin-chat-messages{
    padding:22px;
    max-height:520px;
    overflow-y:auto;
    background:#fff8fb;
}

.emdy-admin-chat-message{
    display:flex;
    margin-bottom:14px;
}

.emdy-admin-chat-message.user{
    justify-content:flex-end;
}

.emdy-admin-chat-message > div{
    max-width:72%;
    padding:14px 16px;
    border-radius:20px;
    background:#fff;
    box-shadow:0 8px 22px rgba(255,46,116,.08);
}

.emdy-admin-chat-message.user > div{
    color:#fff;
    background:linear-gradient(135deg,#ff7aa5,#ff2e74);
}

.emdy-admin-chat-message strong{
    display:block;
    margin-bottom:6px;
}

.emdy-admin-chat-message small{
    margin-left:8px;
    padding:3px 8px;
    border-radius:999px;
    background:rgba(255,255,255,.25);
    font-size:12px;
}

.emdy-admin-chat-message p{
    margin:0 0 8px;
    line-height:1.55;
}

.emdy-admin-chat-message em{
    font-size:12px;
    opacity:.8;
}

.emdy-admin-chat-note{
    padding:22px;
    border-top:1px solid rgba(255,46,116,.14);
}

.emdy-admin-chat-note label{
    display:block;
    margin-bottom:8px;
    font-weight:900;
}

.emdy-admin-chat-note textarea{
    width:100%;
    border:1px solid rgba(255,46,116,.16);
    border-radius:18px;
    background:#fff3f8;
    outline:none;
    padding:14px;
    resize:vertical;
    font-size:17px;
}

.emdy-admin-chat-note button{
    margin-top:12px;
}

.emdy-admin-chat-empty{
    padding:40px;
    color:#7d6871;
    font-size:20px;
    font-weight:900;
}

@media(max-width:1000px){
    .emdy-admin-chat-layout{
        grid-template-columns:1fr;
    }
}
