/* Explain: Styles for the floating AI chat assistant UI. */
/* ---------------- Launcher ---------------- */
.assistant-fab {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 96;
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    height: 60px;
    min-width: 60px;
    padding: 0 1.15rem 0 .95rem;
    border: 1px solid rgba(255, 255, 255, .5);
    border-radius: 999px;
    cursor: pointer;
    color: #04101F;
    font-weight: 600;
    font-size: .85rem;
    letter-spacing: .02em;
    background: linear-gradient(135deg, #F4F8FF 0%, #C6D6EA 32%, #9FB6D4 58%, #54E5E1 100%);
    box-shadow: 0 16px 40px rgba(4, 16, 31, .55), 0 0 0 1px rgba(84, 229, 225, .35);
    transition: transform .3s ease, box-shadow .3s ease;
}
.assistant-fab:hover { transform: translateY(-3px); box-shadow: 0 22px 52px rgba(4, 16, 31, .6), 0 0 26px rgba(84, 229, 225, .5); }
.assistant-fab:focus-visible { outline: 2px solid var(--accent-color); outline-offset: 3px; }
.assistant-fab-icon { font-size: 1.15rem; }
.assistant-fab-halo {
    position: absolute;
    inset: -6px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(84, 229, 225, .42) 0%, rgba(84, 229, 225, 0) 68%);
    animation: assistantHalo 2.8s ease-in-out infinite;
    pointer-events: none;
}
@keyframes assistantHalo {
    0%, 100% { opacity: .35; transform: scale(.94); }
    50% { opacity: .9; transform: scale(1.08); }
}
.assistant-fab-label { display: none; }
@media (min-width: 640px) { .assistant-fab-label { display: inline; } }

/* ---------------- Panel ---------------- */
.assistant-panel {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 97;
    display: none;
    flex-direction: column;
    width: min(94vw, 25rem);
    height: min(88vh, 40rem);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: var(--radius-lg);
    background:
        radial-gradient(circle at 85% 0%, rgba(39, 200, 243, .16) 0%, rgba(39, 200, 243, 0) 55%),
        linear-gradient(165deg, #0A1D3A 0%, #07152D 58%, #050F1F 100%);
    box-shadow: 0 34px 80px rgba(0, 0, 0, .62), 0 0 46px rgba(39, 200, 243, .12);
    color: #fff;
    font-family: 'Inter', 'Noto Sans Arabic', system-ui, sans-serif;
}
.assistant-panel.is-open { display: flex; animation: assistantPanelIn .35s cubic-bezier(.22, .61, .36, 1); }
@keyframes assistantPanelIn {
    from { opacity: 0; transform: translateY(18px) scale(.98); }
    to { opacity: 1; transform: none; }
}

/* ---------------- Header ---------------- */
.assistant-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .9rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, .1);
    background: linear-gradient(120deg, rgba(84, 229, 225, .1), rgba(16, 42, 80, .4));
}
.assistant-id { display: flex; align-items: center; gap: .7rem; min-width: 0; }
.assistant-avatar {
    position: relative;
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: conic-gradient(from 0deg, #54E5E1, #27C8F3, #C6D6EA, #54E5E1);
    animation: assistantSpin 6s linear infinite;
    box-shadow: 0 0 18px rgba(84, 229, 225, .45);
}
.assistant-avatar::before { content: ''; position: absolute; inset: 3px; border-radius: 50%; background: #07152D; }
.assistant-avatar-core { position: relative; color: #54E5E1; font-size: .95rem; animation: assistantSpinBack 6s linear infinite; }
@keyframes assistantSpin { to { transform: rotate(360deg); } }
@keyframes assistantSpinBack { to { transform: rotate(-360deg); } }

.assistant-id-text { min-width: 0; }
.assistant-name {
    font-family: var(--font-heading);
    font-size: .95rem;
    line-height: 1.25;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.assistant-status { display: flex; align-items: center; gap: .4rem; font-size: .74rem; color: var(--gold-400); margin-top: .15rem; }
.assistant-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold-400); box-shadow: 0 0 8px var(--gold-400); flex-shrink: 0; }

.assistant-head-actions { display: flex; align-items: center; gap: .45rem; flex-shrink: 0; }
.assistant-lang { display: inline-flex; border: 1px solid rgba(255, 255, 255, .18); border-radius: 999px; overflow: hidden; }
.assistant-lang-btn {
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, .72);
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .06em;
    padding: .3rem .5rem;
    cursor: pointer;
    transition: background .25s ease, color .25s ease;
}
.assistant-lang-btn:hover { color: #fff; }
.assistant-lang-btn.is-active { background: linear-gradient(120deg, var(--gold-500), var(--gold-400)); color: #04101F; }
.assistant-icon-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, .18);
    background: rgba(255, 255, 255, .06);
    color: #fff;
    cursor: pointer;
    font-size: .9rem;
    display: grid;
    place-items: center;
    transition: border-color .25s ease, color .25s ease;
}
.assistant-icon-btn:hover { border-color: var(--accent-color); color: var(--gold-400); }

/* ---------------- Conversation ---------------- */
.assistant-log {
    flex: 1 1 auto;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: .7rem;
    padding: 1rem;
}
.assistant-log[dir="rtl"] .assistant-msg--user { align-self: flex-start; }
.assistant-log[dir="rtl"] .assistant-msg--bot { align-self: flex-end; }

.assistant-msg { display: flex; max-width: 88%; }
.assistant-msg--bot { align-self: flex-start; }
.assistant-msg--user { align-self: flex-end; }
.assistant-bubble {
    padding: .7rem .9rem;
    border-radius: 14px;
    font-size: .88rem;
    line-height: 1.65;
    overflow-wrap: anywhere;
}
.assistant-msg--bot .assistant-bubble {
    background: linear-gradient(160deg, rgba(16, 42, 80, .92), rgba(7, 21, 45, .95));
    border: 1px solid rgba(255, 255, 255, .1);
    color: rgba(255, 255, 255, .92);
    border-bottom-left-radius: 4px;
}
.assistant-msg--user .assistant-bubble {
    background: linear-gradient(120deg, #DCE6F2 0%, #B9CDE2 45%, #54E5E1 100%);
    color: #04101F;
    font-weight: 500;
    border-bottom-right-radius: 4px;
}
.assistant-link { color: var(--gold-400); text-decoration: underline; text-underline-offset: 2px; }

/* ---------------- Typing indicator ---------------- */
.assistant-typing { display: none; align-items: center; gap: .28rem; padding: 0 1rem .6rem; }
.assistant-typing.is-visible { display: flex; }
.assistant-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--gold-400); animation: assistantTyping 1.2s infinite ease-in-out; }
.assistant-typing span:nth-child(2) { animation-delay: .15s; }
.assistant-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes assistantTyping {
    0%, 100% { opacity: .3; transform: translateY(0); }
    50% { opacity: 1; transform: translateY(-3px); }
}

/* ---------------- Quick suggestions ---------------- */
.assistant-quick { display: flex; flex-wrap: wrap; gap: .4rem; padding: 0 1rem .7rem; }
.assistant-chip {
    border: 1px solid rgba(255, 255, 255, .18);
    background: rgba(255, 255, 255, .05);
    color: rgba(255, 255, 255, .85);
    font-size: .74rem;
    padding: .35rem .65rem;
    border-radius: 999px;
    cursor: pointer;
    transition: border-color .25s ease, color .25s ease, background .25s ease;
}
.assistant-chip:hover { border-color: var(--accent-color); color: var(--gold-400); background: rgba(39, 200, 243, .1); }

/* ---------------- Composer ---------------- */
.assistant-composer {
    display: flex;
    align-items: flex-end;
    gap: .5rem;
    padding: .7rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, .1);
    background: rgba(5, 16, 33, .6);
}
.assistant-input-wrap { flex: 1 1 auto; min-width: 0; }
.assistant-input {
    width: 100%;
    resize: none;
    max-height: 6.5rem;
    padding: .6rem .75rem;
    font-size: .88rem;
    font-family: inherit;
    color: #fff;
    background: rgba(4, 16, 31, .85);
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 12px;
    line-height: 1.5;
    transition: border-color .25s ease, box-shadow .25s ease;
}
.assistant-input:focus { outline: none; border-color: var(--accent-color); box-shadow: 0 0 0 3px rgba(39, 200, 243, .18); }
.assistant-input::placeholder { color: rgba(255, 255, 255, .4); }

.assistant-send {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: 50%;
    display: grid;
    place-items: center;
    cursor: pointer;
    font-size: .95rem;
    border: 1px solid transparent;
    background: linear-gradient(120deg, var(--gold-500), var(--gold-400));
    color: #04101F;
    transition: transform .25s ease, box-shadow .25s ease, opacity .25s ease;
}
.assistant-send:hover { box-shadow: 0 10px 26px rgba(39, 200, 243, .4); }
.assistant-send:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ---------------- Mobile ---------------- */
@media (max-width: 640px) {
    .assistant-panel { right: .6rem; left: .6rem; bottom: .6rem; width: auto; height: min(86vh, 40rem); }
    .assistant-fab { right: 1rem; bottom: 1rem; }
    .assistant-log { padding: .9rem .85rem; }
}