body{
    font-family:tahoma;
}

.chat-shell{
    width:100%;
    max-width:85%;
    height:90vh;
    margin:auto;
    border-radius:14px;
    display:flex;
    flex-direction:column;
    background:#f7f7f8;
}

.chat-body{
    background-color:lightgray;
    flex:1;
    overflow-y:auto;
    padding:20px;
}
.video-chat{
    width:50%;
}
/* ✅ فاصله بیشتر بین پیام‌ها */
.row{
    display:flex;
    margin-bottom:28px;
}

.row.user{
    justify-content:flex-end;
    margin:10px auto 10px 0 !important;
    width: 500px;
}

.ai{
    margin:10px 0 !important;
    width: 500px;
    margin-left: auto !important;
}

.avatar{
    margin-left:10px;
    width:35px;
    /*height:35px;*/
    border-radius:50%;
    display:flex;
    align-items:center;
    justify-content:center;
    color:#fff;
    font-size:50px;
}

.bubble{
    max-width:75%;
    padding:14px;
    border-radius:14px;
    position:relative;
    font-size:14px;
    line-height:1.8;
}

.ai-bubble{
    background:#fff;
    border:1px solid #e5e5e5;
}

.user-bubble{
    background: rgba(220, 248, 198, 0.52);
}

/* ✅ دکمه کپی */
.copy-msg-btn{
    top:auto;
    background:none;
    font-size:14px;
    position:absolute;
    margin-top:10px;
    bottom:6px;
    left:8px;
    background:transparent;
    border:none;
    cursor:pointer;
    opacity:0.5;
    transition:0.2s;
}

.user-bubble .copy-msg-btn{
    left:8px;
    right:auto;
}

.copy-msg-btn:hover{
    opacity:1;
}

/* ✅ سه نقطه لودینگ */
.loading-dots{
    display:flex;
    gap:5px;
    align-items:center;
}

.loading-dots span{
    width:7px;
    height:7px;
    background:#999;
    border-radius:50%;
    animation:bounce 1.4s infinite ease-in-out both;
}

.loading-dots span:nth-child(1){animation-delay:-0.32s;}
.loading-dots span:nth-child(2){animation-delay:-0.16s;}

@keyframes bounce{
    0%,80%,100%{transform:scale(0);}
    40%{transform:scale(1);}
}

.chat-input{
    border-top:1px solid #ddd;
    display:flex;
    align-items:center;
    gap:8px;
    padding:10px;
    background:#fff !important;
    height: 100%;
}

.text-input{
    flex:1;
    border-radius:18px;
    border:1px solid #ddd;
    padding:10px 12px;
    font-size:14px;
    line-height:1.6;

    /* مهم */
    resize:none;
    overflow-y: scroll;
    min-height:42px;
    max-height:160px;
    transition: height 0.1s ease;
}
.voice-toast{
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%);
    background: #111;
    color: #fff;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 13px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 9999;
}

/* show state */
.voice-toast.show{
    opacity: 1;
    visibility: visible;
    bottom: 110px;
}
.send-btn{
    padding-top:2px;
    cursor:pointer;
    width:40px;
    height:38px;
    border-radius:50%;
    border:none;
    background: rgb(242, 244, 245);
    display:flex;
    align-items:center;
    justify-content:center;
}
/* ICON BUTTONS */
.icon-btn{
    width:40px;
    height:40px;
    display:flex;
    align-items:center;
    justify-content:center;
    border-radius:50%;
    background:#f3f4f6;
    cursor:pointer;
    border:none;
}
.file-btn{
    background: #5a6868;
    color:#fff;
    border:none;
    border-radius:50%;
    width:40px;
    height:40px;
    cursor:pointer;
}
.ai-avatar{
    background-color:unset !important;
}

.d-none{
    display:none;
}

@media (max-width:768px){
    .row.user{
        width:100%;
    }
    .pages{
        width:100% !important;
    }
    .ai{
        display:flex;
        width:100%;
        flex-direction: column;
    }
    .chat-shell{
        width:95% !important;
        max-width:unset;
    }
    .avatar{
        font-size:25px;
        width: 40px !important;
        min-width:unset !important;
        height:40px !important;
    }
    .chat-input{
        padding:8px;
        gap:6px;
    }

    .icon-btn{
        width:36px;
        height:36px;
    }

    .send-btn{
        width:38px;
        height:38px;
    }
    .video-chat{
        width:100%;
    }
}
.ai-circuit-section{

    position:relative;
    width:100%;
    height: 550px;

    display:flex;
    justify-content:center;
    align-items:center;

    overflow:hidden;
}

.robot-box{

    position:relative;

    z-index:50;

}

.robot-box img{

    width:330px;
    max-width:100%;

}

.circuit-bg{

    position:absolute;

    inset:0;

}
.ai-circuit-line{

    position:absolute;

}

/* ---------- Horizontal ---------- */

.circuit-h{

    width:230px;

    height:3px;

    background:#0f1723;

    overflow:hidden;

}

.circuit-h::after{

    content:"";

    position:absolute;

    inset:0;

    background:linear-gradient(
            90deg,
            transparent,
            #00d9ff,
            #7df7ff,
            #00d9ff,
            transparent
    );

    background-size:220px 100%;

    animation:flowX 2.5s linear infinite;

    filter:blur(.2px);

    box-shadow:
            0 0 8px #00d9ff,
            0 0 18px #00d9ff,
            0 0 35px #00d9ff;

}

@keyframes flowX{

    from{

        background-position:-240px;

    }

    to{

        background-position:240px;

    }

}
.circuit-v{

    width:3px;

    height:180px;

    background:#111827;

}

.circuit-v::after{

    content:"";

    position:absolute;

    inset:0;

    background:linear-gradient(

            180deg,

            transparent,

            #00d9ff,

            #79f8ff,

            #00d9ff,

            transparent

    );

    background-size:100% 220px;

    animation:flowY 2.3s linear infinite;

    box-shadow:

            0 0 10px #00d9ff,

            0 0 25px #00d9ff;

}

@keyframes flowY{

    from{

        background-position:0 -220px;

    }

    to{

        background-position:0 220px;

    }

}
.tl{

    border-right:none;
    border-bottom:none;

}
.tr{

    border-left:none;
    border-bottom:none;

}
.bl{

    border-right:none;
    border-top:none;

}

.br{

    border-left:none;
    border-top:none;

}

.corner{

    position:absolute;

    width:45px;

    height:45px;

    border:3px solid #00d9ff;

    box-shadow:
            0 0 10px #00d9ff,
            0 0 25px #00d9ff;

}
.node{

    position:absolute;

    width:10px;
    height:10px;

    border-radius:50%;

    background:#7df7ff;

    box-shadow:
            0 0 8px #00d9ff,
            0 0 20px #00d9ff;

}
.h1{
    width:220px;
    top:110px;
    left:40px;
}

.v1{
    height:140px;
    left:258px;
    top:110px;
}

.h2{
    width:180px;
    top:248px;
    left:258px;
}

.v2{
    height:180px;
    left:435px;
    top:248px;
}

.h3{
    width:260px;
    top:425px;
    left:180px;
}

.h4{
    width:220px;
    top:180px;
    right:80px;
}

.v3{
    height:120px;
    right:298px;
    top:180px;
}

.h5{
    width:180px;
    top:300px;
    right:298px;
}

.v4{
    height:170px;
    right:120px;
    top:300px;
}

.h6{
    width:260px;
    bottom:120px;
    right:120px;
}

.v5{
    height:130px;
    left:120px;
    bottom:120px;
}
.c1{
    left:216px;
    top:110px;
}

.c2{
    left:392px;
    top:248px;
}

.c3{
    right:298px;
    top:258px;
}

.c4{
    right:164px;
    bottom:120px;
}
.n1{
    left:36px;
    top:106px;
}

.n2{
    left:430px;
    top:420px;
}

.n3{
    right:78px;
    top:176px;
}

.n4{
    right:118px;
    bottom:116px;
}

.n5{
    left:116px;
    bottom:116px;
}