/* Assistente LeoGrill — stili condivisi tra la pagina /owner/assistant e il
   widget fluttuante. I colori usano le variabili del tema (theme.css) così il
   componente segue chiaro/scuro senza duplicare palette. */

.lga-thread {
    display: flex;
    flex-direction: column;
    gap: .75rem;
    overflow-y: auto;
    scroll-behavior: smooth;
}

.lga-msg {
    max-width: 92%;
    padding: .65rem .85rem;
    border-radius: .9rem;
    line-height: 1.5;
    font-size: .93rem;
    white-space: pre-wrap;
    word-break: break-word;
}

.lga-msg-user {
    align-self: flex-end;
    background: #c44536;
    color: #fff;
    border-bottom-right-radius: .25rem;
}

.lga-msg-bot {
    align-self: flex-start;
    background: var(--bs-tertiary-bg, #f1f3f5);
    color: var(--bs-body-color, #212529);
    border-bottom-left-radius: .25rem;
}

.lga-msg-error {
    align-self: flex-start;
    background: #f8d7da;
    color: #842029;
}

[data-theme="dark"] .lga-msg-error {
    background: #4a1f24;
    color: #f5c2c7;
}

.lga-sources {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    margin-top: .6rem;
    padding-top: .5rem;
    border-top: 1px solid rgba(128, 128, 128, .25);
}

.lga-source {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    font-size: .76rem;
    text-decoration: none;
    padding: .18rem .5rem;
    border-radius: 999px;
    border: 1px solid rgba(128, 128, 128, .35);
    color: inherit;
    opacity: .85;
}

.lga-source:hover { opacity: 1; border-color: #c44536; color: #c44536; }
.lga-source-locked { opacity: .6; cursor: default; }

.lga-typing span {
    display: inline-block;
    width: .4rem;
    height: .4rem;
    margin-right: .18rem;
    border-radius: 50%;
    background: currentColor;
    opacity: .35;
    animation: lga-blink 1.2s infinite;
}

.lga-typing span:nth-child(2) { animation-delay: .2s; }
.lga-typing span:nth-child(3) { animation-delay: .4s; }

@keyframes lga-blink {
    0%, 60%, 100% { opacity: .25; transform: translateY(0); }
    30% { opacity: .9; transform: translateY(-2px); }
}

@media (prefers-reduced-motion: reduce) {
    .lga-typing span { animation: none; opacity: .6; }
}

.lga-chip {
    font-size: .8rem;
    padding: .3rem .7rem;
    border-radius: 999px;
    border: 1px solid rgba(128, 128, 128, .4);
    background: transparent;
    color: inherit;
    text-align: left;
}

.lga-chip:hover { border-color: #c44536; color: #c44536; }

/* ── Widget fluttuante ─────────────────────────────────────────────────── */

.lga-launcher {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 1035;
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 50%;
    border: none;
    background: #c44536;
    color: #fff;
    font-size: 1.35rem;
    box-shadow: 0 .5rem 1.25rem rgba(0, 0, 0, .28);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.lga-launcher:hover { background: #a93a2d; }
.lga-launcher:focus-visible { outline: 3px solid #ffd7d1; outline-offset: 2px; }

.lga-panel {
    position: fixed;
    right: 1rem;
    bottom: 4.75rem;
    z-index: 1036;
    width: min(23rem, calc(100vw - 2rem));
    max-height: min(32rem, calc(100vh - 7rem));
    display: none;
    flex-direction: column;
    background: var(--bs-body-bg, #fff);
    color: var(--bs-body-color, #212529);
    border: 1px solid rgba(128, 128, 128, .28);
    border-radius: .9rem;
    box-shadow: 0 1rem 2.5rem rgba(0, 0, 0, .3);
    overflow: hidden;
}

.lga-panel.lga-open { display: flex; }

.lga-panel-head {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .65rem .8rem;
    background: #c44536;
    color: #fff;
}

.lga-panel-body {
    padding: .8rem;
    overflow-y: auto;
    flex: 1 1 auto;
}

.lga-panel-foot {
    padding: .6rem .7rem;
    border-top: 1px solid rgba(128, 128, 128, .25);
}

@media (max-width: 575.98px) {
    .lga-panel {
        right: .5rem;
        left: .5rem;
        width: auto;
        bottom: 4.5rem;
    }
}
