
.arb-chatbot,
.arb-chatbot *,
.arb-chatbot *::before,
.arb-chatbot *::after {
    box-sizing: border-box;
    font-family: "Special Gothic", sans-serif;
}
 
.arb-chatbot {
    /* Paleta locala a widget-ului */
    --arb-yellow: #e8d400;
    --arb-black: #1f1f1f;
    --arb-white: #ffffff;
    --arb-gray-bg: #f5f5f5;
    --arb-gray-text: #666666;
 
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99999;
}
 
@media (max-width: 600px) {
    .arb-chatbot {
        bottom: 18px;
        right: 18px;
    }
}
 
/* =====================================================================
   BUTON FLOTANT
   ===================================================================== */
.arb-chatbot__toggle {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--arb-black);
    border: none;
    color: var(--arb-white);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 0 40px rgba(232, 212, 0, .35), 0 10px 26px rgba(0, 0, 0, .25);
    transition: transform .35s ease, box-shadow .35s ease;
 
    /* Animatie idle: plutire usoara + scale + puls de glow, la fiecare 5s */
    animation: arbFloat 5s ease-in-out infinite;
}
 
.arb-chatbot__toggle:hover {
    transform: scale(1.08);
    box-shadow: 0 0 55px rgba(232, 212, 0, .5), 0 14px 34px rgba(0, 0, 0, .3);
    animation-play-state: paused;
}
 
.arb-chatbot__toggle:focus-visible {
    outline: 3px solid var(--arb-yellow);
    outline-offset: 4px;
}
 
.arb-chatbot__toggle:active {
    transform: scale(.96);
}
 
/* Odata deschis chat-ul, oprim plutirea - butonul devine un buton de inchidere fix */
.arb-chatbot.is-open .arb-chatbot__toggle {
    animation: none;
    box-shadow: 0 10px 26px rgba(0, 0, 0, .3);
}
 
@keyframes arbFloat {
    0%, 100% {
        transform: translateY(0) scale(1);
        box-shadow: 0 0 40px rgba(232, 212, 0, .35), 0 10px 26px rgba(0, 0, 0, .25);
    }
    50% {
        transform: translateY(-6px) scale(1.03);
        box-shadow: 0 0 58px rgba(232, 212, 0, .55), 0 16px 32px rgba(0, 0, 0, .22);
    }
}
 
/* Cele doua iconite (chat / X) se incrucisaza printr-un fade + rotatie discreta */
.arb-chatbot__icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(0deg);
    opacity: 1;
    transition: opacity .3s ease, transform .3s ease;
}
 
.arb-chatbot__icon--close {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(-90deg);
}
 
.arb-chatbot.is-open .arb-chatbot__icon--chat {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(90deg);
}
 
.arb-chatbot.is-open .arb-chatbot__icon--close {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(0deg);
}
 
/* =====================================================================
   BULA DE NOTIFICARE
   ===================================================================== */
.arb-chatbot__notification {
    position: absolute;
    bottom: 90px;
    right: 0;
    width: 250px;
    background: var(--arb-white);
    color: var(--arb-black);
    padding: 16px 34px 16px 18px;
    border-radius: 16px;
    box-shadow: 0 20px 45px rgba(0, 0, 0, .16);
    font-size: 14px;
    line-height: 1.5;
 
    opacity: 0;
    transform: translateY(12px) scale(.96);
    pointer-events: none;
    transition: opacity .4s ease, transform .4s ease;
}
 
.arb-chatbot__notification::after {
    content: "";
    position: absolute;
    bottom: -7px;
    right: 30px;
    width: 14px;
    height: 14px;
    background: var(--arb-white);
    transform: rotate(45deg);
}
 
.arb-chatbot__notification p {
    margin: 0;
    position: relative;
    z-index: 1;
}
 
.arb-chatbot__notification.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}
 
/* Ascunde notificarea automat cand chat-ul e deschis */
.arb-chatbot.is-open .arb-chatbot__notification {
    opacity: 0;
    pointer-events: none;
}
 
.arb-chatbot__notification-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--arb-gray-bg);
    color: #666;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .25s ease, color .25s ease;
}
 
.arb-chatbot__notification-close:hover {
    background: var(--arb-yellow);
    color: var(--arb-black);
}
 
@media (max-width: 600px) {
    .arb-chatbot__notification {
        width: min(250px, calc(100vw - 60px));
    }
}
 
/* =====================================================================
   FEREASTRA DE CHAT
   ===================================================================== */
.arb-chatbot__window {
    position: absolute;
    bottom: 90px;
    right: 0;
    width: 420px;
    height: 680px;
    max-height: calc(100vh - 120px);
 
    background: var(--arb-white);
    border-radius: 26px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .28);
    overflow: hidden;
 
    display: flex;
    flex-direction: column;
    transform-origin: bottom right;
 
    opacity: 0;
    transform: scale(.85) translateY(30px);
    filter: blur(8px);
    visibility: hidden;
    pointer-events: none;
 
    transition:
        opacity .45s cubic-bezier(.22, 1, .36, 1),
        transform .45s cubic-bezier(.22, 1, .36, 1),
        filter .45s cubic-bezier(.22, 1, .36, 1),
        visibility 0s linear .45s;
}
 
.arb-chatbot.is-open .arb-chatbot__window {
    opacity: 1;
    transform: scale(1) translateY(0);
    filter: blur(0);
    visibility: visible;
    pointer-events: auto;
    transition:
        opacity .45s cubic-bezier(.22, 1, .36, 1),
        transform .45s cubic-bezier(.22, 1, .36, 1),
        filter .45s cubic-bezier(.22, 1, .36, 1),
        visibility 0s linear 0s;
}
 
/* =====================================================================
   HEADER
   ===================================================================== */
.arb-chatbot__header {
    flex-shrink: 0;
    background: var(--arb-black);
    color: var(--arb-white);
    padding: 20px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
 
    /* Header-ul aluneca de sus la deschidere */
    transform: translateY(-100%);
    transition: transform .5s ease .08s;
}
 
.arb-chatbot.is-open .arb-chatbot__header {
    transform: translateY(0);
}
 
.arb-chatbot__header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}
 
.arb-chatbot__logo {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--arb-yellow);
    color: var(--arb-black);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 15px;
    letter-spacing: .5px;
}
 
.arb-chatbot__header-text h2 {
    margin: 0 0 3px 0;
    font-size: 16px;
    font-weight: 800;
    color: var(--arb-white);
}
 
.arb-chatbot__status {
    margin: 0;
    font-size: 12px;
    color: rgba(255, 255, 255, .7);
    display: flex;
    align-items: center;
    gap: 6px;
}
 
.arb-chatbot__status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #3ddc71;
    box-shadow: 0 0 0 rgba(61, 220, 113, .5);
    animation: arbStatusPulse 2s ease-out infinite;
}
 
@keyframes arbStatusPulse {
    0% { box-shadow: 0 0 0 0 rgba(61, 220, 113, .5); }
    70% { box-shadow: 0 0 0 6px rgba(61, 220, 113, 0); }
    100% { box-shadow: 0 0 0 0 rgba(61, 220, 113, 0); }
}
 
.arb-chatbot__close {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .08);
    color: var(--arb-white);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .25s ease, color .25s ease, transform .25s ease;
}
 
.arb-chatbot__close:hover {
    background: var(--arb-yellow);
    color: var(--arb-black);
    transform: rotate(90deg);
}
 
/* =====================================================================
   ZONA DE MESAJE
   ===================================================================== */
.arb-chatbot__messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: #fbfbf9;
 
    /* scrollbar subtire, moderna */
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, .15) transparent;
}
 
.arb-chatbot__messages::-webkit-scrollbar {
    width: 6px;
}
 
.arb-chatbot__messages::-webkit-scrollbar-track {
    background: transparent;
}
 
.arb-chatbot__messages::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, .15);
    border-radius: 10px;
}
 
.arb-chatbot__message {
    max-width: 82%;
    animation: arbMsgIn .35s ease;
}
 
@keyframes arbMsgIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
 
.arb-chatbot__message p {
    margin: 0;
    padding: 13px 16px;
    border-radius: 16px;
    font-size: 15px;
    line-height: 1.55;
    word-wrap: break-word;
}
 
/* Mesaj utilizator: galben, aliniat dreapta */
.arb-chatbot__message--user {
    align-self: flex-end;
}
 
.arb-chatbot__message--user p {
    background: var(--arb-yellow);
    color: var(--arb-black);
    font-weight: 500;
    border-bottom-right-radius: 4px;
}
 
/* Mesaj AI: card alb, aliniat stanga */
.arb-chatbot__message--ai {
    align-self: flex-start;
}
 
.arb-chatbot__message--ai p {
    background: var(--arb-white);
    color: #222;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .06);
    border-bottom-left-radius: 4px;
}
 
/* Accentuarile **text** din raspunsul modelului, redate ca <strong>.
   Greutate explicita: fontul Special Gothic nu are un bold foarte pronuntat,
   iar in bula de chat diferenta trebuie sa se vada clar. */
.arb-chatbot__message p strong {
    font-weight: 700;
    color: inherit;
}

/* Indicator de scriere (3 puncte animate) */
.arb-chatbot__message--typing p {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 16px 18px;
}
 
.arb-chatbot__typing-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #bbb;
    animation: arbTypingBounce 1.2s ease infinite;
}
 
.arb-chatbot__typing-dot:nth-child(2) { animation-delay: .15s; }
.arb-chatbot__typing-dot:nth-child(3) { animation-delay: .3s; }
 
@keyframes arbTypingBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: .5; }
    30% { transform: translateY(-5px); opacity: 1; }
}
 
/* =====================================================================
   SUGESTII RAPIDE (CHIPS)
   ===================================================================== */
.arb-chatbot__suggestions {
    flex-shrink: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 4px 20px 16px;
}
 
.arb-chatbot__chip {
    background: var(--arb-gray-bg);
    color: #333;
    border: 1px solid transparent;
    padding: 9px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
 
    /* stagger la deschiderea ferestrei */
    opacity: 0;
    transform: translateY(8px);
    transition: opacity .4s ease, transform .4s ease, background .25s ease, color .25s ease;
}
 
.arb-chatbot.is-open .arb-chatbot__chip {
    opacity: 1;
    transform: translateY(0);
}
 
.arb-chatbot.is-open .arb-chatbot__chip:nth-child(1) { transition-delay: .30s; }
.arb-chatbot.is-open .arb-chatbot__chip:nth-child(2) { transition-delay: .35s; }
.arb-chatbot.is-open .arb-chatbot__chip:nth-child(3) { transition-delay: .40s; }
.arb-chatbot.is-open .arb-chatbot__chip:nth-child(4) { transition-delay: .45s; }
.arb-chatbot.is-open .arb-chatbot__chip:nth-child(5) { transition-delay: .50s; }
.arb-chatbot.is-open .arb-chatbot__chip:nth-child(6) { transition-delay: .55s; }
 
/* Dupa stagger, hover-ul devine instant (fara delay mostenit) */
.arb-chatbot.is-open .arb-chatbot__chip:hover {
    background: var(--arb-yellow);
    color: var(--arb-black);
    transform: translateY(-2px);
    transition: background .25s ease, color .25s ease, transform .25s ease;
}
 
/* Cand suntem in tranzitie de inchidere, ascunde chip-urile instant (fara sa astepte re-deschiderea) */
.arb-chatbot:not(.is-open) .arb-chatbot__chip {
    transition: none;
}
 
/* =====================================================================
   ZONA DE INPUT
   ===================================================================== */
.arb-chatbot__input-area {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px 20px;
    border-top: 1px solid rgba(0, 0, 0, .06);
    background: var(--arb-white);
}
 
.arb-chatbot__input {
    flex: 1;
    min-width: 0;
    border: 1px solid #e4e4e2;
    background: #f7f7f5;
    border-radius: 24px;
    padding: 13px 18px;
    font-size: 15px;
    font-family: inherit;
    color: #222;
    transition: border-color .25s ease, background .25s ease, box-shadow .25s ease;
}
 
.arb-chatbot__input::placeholder {
    color: #999;
}
 
.arb-chatbot__input:focus {
    outline: none;
    border-color: var(--arb-yellow);
    background: var(--arb-white);
    box-shadow: 0 0 0 4px rgba(232, 212, 0, .15);
}
 
.arb-chatbot__send {
    position: relative;
    flex-shrink: 0;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--arb-yellow);
    color: var(--arb-black);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    transition: transform .3s ease, box-shadow .3s ease, opacity .3s ease;
}
 
.arb-chatbot__send:hover {
    transform: scale(1.08) rotate(8deg);
    box-shadow: 0 8px 20px rgba(232, 212, 0, .45);
}
 
.arb-chatbot__send:active {
    transform: scale(.94);
}
 
.arb-chatbot__send:disabled {
    opacity: .45;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}
 
/* Efect ripple la trimitere, declansat de JS prin clasa .arb-ripple */
.arb-chatbot__send::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .65);
    transform: scale(0);
    opacity: 0;
}
 
.arb-chatbot__send.arb-ripple::after {
    animation: arbRipple .5s ease-out;
}
 
@keyframes arbRipple {
    0%   { transform: scale(0);   opacity: .65; }
    100% { transform: scale(2.4); opacity: 0; }
}
 
/* =====================================================================
   RESPONSIVE: FULLSCREEN PE MOBIL
   ===================================================================== */
@media (max-width: 600px) {
    .arb-chatbot__window {
        position: fixed;
        inset: 0;
        width: 100%;
        height: 100%;
        max-height: none;
        border-radius: 0;
        transform-origin: bottom center;
    }
 
    .arb-chatbot__header {
        padding: 18px 18px calc(18px + env(safe-area-inset-top, 0px));
    }
 
    .arb-chatbot__input-area {
        padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    }
}
 
/* =====================================================================
   ACCESIBILITATE: respecta preferinta de reducere a miscarii
   ===================================================================== */
@media (prefers-reduced-motion: reduce) {
    .arb-chatbot__toggle {
        animation: none;
    }
 
    .arb-chatbot__status-dot {
        animation: none;
    }
 
    .arb-chatbot *,
    .arb-chatbot *::after {
        transition-duration: .15s !important;
        animation-duration: .15s !important;
    }
 
    .arb-chatbot__window {
        filter: none !important;
    }
}