/* ==========================================================================
   AROOSYAR AI — ویجت چت شناور «یار»
   ========================================================================== */

#aroosyar-ai-widget {
    direction: rtl;
    font-family: 'Vazirmatn', sans-serif;
    position: fixed;
    bottom: 22px;
    left: 22px;
    z-index: 999999;
}

#aroosyar-ai-toggle {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    background: linear-gradient(135deg, #7099d6, #A3BEE7);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 26px -8px rgba(15, 21, 51, .45);
    transition: transform .2s ease;
}
#aroosyar-ai-toggle:hover {
    transform: translateY(-2px) scale(1.04);
}
#aroosyar-ai-toggle svg {
    width: 26px;
    height: 26px;
}

#aroosyar-ai-panel {
    position: absolute;
    bottom: 72px;
    left: 0;
    width: 340px;
    max-width: calc(100vw - 40px);
    height: 460px;
    max-height: 70vh;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 20px 50px -18px rgba(15, 21, 51, .35);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #E3ECF2;
}

.aroosyar-ai-header {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px 14px 40px;
    background: linear-gradient(135deg, #7099d6, #A3BEE7);
    color: #fff;
}
#aroosyar-ai-close {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,.22);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .2s;
}
#aroosyar-ai-close:hover {
    background: rgba(255,255,255,.36);
}
#aroosyar-ai-close svg {
    width: 15px;
    height: 15px;
}
.aroosyar-ai-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,.22);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    overflow: hidden;
}
.aroosyar-ai-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.aroosyar-ai-header b {
    display: block;
    font-size: .88rem;
}
.aroosyar-ai-header span {
    display: block;
    font-size: .72rem;
    opacity: .85;
    margin-top: 2px;
}

.aroosyar-ai-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #F7FAFC;
}

.aroosyar-ai-msg {
    max-width: 84%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: .84rem;
    line-height: 1.9;
    animation: aroosyarAiFadeIn .2s ease;
}
.aroosyar-ai-msg a {
    color: #7099d6;
    text-decoration: underline;
}
.aroosyar-ai-msg--bot {
    align-self: flex-start;
    background: #fff;
    border: 1px solid #E3ECF2;
    color: #0F1533;
    border-bottom-left-radius: 4px;
}
.aroosyar-ai-msg--user {
    align-self: flex-end;
    background: #0F1533;
    color: #fff;
    border-bottom-right-radius: 4px;
}

@keyframes aroosyarAiFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.aroosyar-ai-suggestion {
    padding: 0 14px 10px;
}
.aroosyar-ai-chip {
    display: inline-block;
    max-width: 100%;
    text-align: right;
    white-space: normal;
    background: #E7F0F6;
    border: 1px solid #D3E2EC;
    color: #0F1533;
    border-radius: 14px;
    padding: 8px 14px;
    font-size: .8rem;
    font-family: inherit;
    cursor: pointer;
    transition: background .2s;
}
.aroosyar-ai-chip:hover {
    background: #D3E2EC;
}

.aroosyar-ai-typing {
    padding: 0 16px 8px;
    display: flex;
    gap: 4px;
}
.aroosyar-ai-typing span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #A3BEE7;
    animation: aroosyarAiTyping 1s infinite ease-in-out;
}
.aroosyar-ai-typing span:nth-child(2) { animation-delay: .15s; }
.aroosyar-ai-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes aroosyarAiTyping {
    0%, 60%, 100% { transform: translateY(0); opacity: .5; }
    30% { transform: translateY(-4px); opacity: 1; }
}

#aroosyar-ai-form {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    border-top: 1px solid #E3ECF2;
    background: #fff;
}
#aroosyar-ai-input {
    flex: 1;
    border: 1px solid #E3ECF2;
    border-radius: 12px;
    padding: 10px 14px;
    font-size: .84rem;
    font-family: inherit;
    color: #0F1533;
    outline: none;
}
#aroosyar-ai-input:focus {
    border-color: #A3BEE7;
    box-shadow: 0 0 0 3px rgba(163, 190, 231, .28);
}
#aroosyar-ai-form button[type="submit"] {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border: none;
    border-radius: 12px;
    background: #0F1533;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .2s;
}
#aroosyar-ai-form button[type="submit"]:hover {
    background: #1C2551;
}
#aroosyar-ai-form button[type="submit"] svg {
    width: 18px;
    height: 18px;
}

@media (max-width: 480px) {
    #aroosyar-ai-widget {
        bottom: 14px;
        left: 14px;
    }
    #aroosyar-ai-panel {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        width: 100%;
        max-width: 100%;
        height: 100%;
        max-height: none;
        border-radius: 0;
    }
    #aroosyar-ai-input {
        font-size: 16px;
    }
}
#aroosyar-ai-toggle span{
    position: absolute;
    right: -6px;
    letter-spacing: 2px;
    bottom: 4px;
    font-size: 13px;
    background: #404040;
    line-height: 0;
    margin: 0;
    border-radius: 100px;
    padding: 6px 4px 10px;
}