/* AI súgó — lebegő csevegő panel (Views/Shared/_AiHelper.cshtml). */

.ai-panel {
    position: fixed;
    right: 24px;
    bottom: 92px;
    z-index: 1045;
    display: none;
    flex-direction: column;
    width: 420px;
    max-width: calc(100vw - 32px);
    height: min(660px, calc(100vh - 130px));
    background: #fff;
    border: 1px solid var(--adm-line, #e3e7e4);
    border-radius: 16px;
    box-shadow: 0 18px 48px rgba(22, 36, 30, .28);
    overflow: hidden;
}

.ai-panel.open { display: flex; }

.ai-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    background: var(--adm-primary, #1f4d3a);
    color: #fff;
}

.ai-head .title { font-weight: 600; flex: 1; }

.ai-head button {
    border: none;
    background: rgba(255, 255, 255, .14);
    color: #fff;
    border-radius: 8px;
    padding: 4px 9px;
    font-size: .95rem;
    line-height: 1.4;
}

.ai-head button:hover { background: rgba(255, 255, 255, .28); }

.ai-body {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    background: #f7f9f8;
}

.ai-msg {
    max-width: 88%;
    margin-bottom: 10px;
    padding: 9px 12px;
    border-radius: 12px;
    font-size: .9rem;
    line-height: 1.5;
    white-space: normal;
    word-wrap: break-word;
}

.ai-msg.user {
    margin-left: auto;
    background: var(--adm-primary, #1f4d3a);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.ai-msg.bot {
    background: #fff;
    border: 1px solid var(--adm-line, #e3e7e4);
    border-bottom-left-radius: 4px;
}

.ai-msg.error {
    background: #fdecea;
    border: 1px solid #f5c2bd;
    color: #8a1c12;
}

.ai-msg p { margin: 0 0 .5rem; }
.ai-msg p:last-child { margin-bottom: 0; }
.ai-msg ul { margin: 0 0 .5rem; padding-left: 1.1rem; }
.ai-msg code { background: rgba(0, 0, 0, .06); padding: 1px 4px; border-radius: 4px; }
.ai-msg.user code { background: rgba(255, 255, 255, .2); }

.ai-hint {
    color: #6b7a72;
    font-size: .85rem;
    line-height: 1.5;
    padding: 6px 2px 12px;
}

.ai-hint .ai-sample {
    display: block;
    width: 100%;
    text-align: left;
    margin-top: 6px;
    padding: 7px 10px;
    background: #fff;
    border: 1px solid var(--adm-line, #e3e7e4);
    border-radius: 10px;
    font-size: .85rem;
    color: #2c3a34;
}

.ai-hint .ai-sample:hover { border-color: var(--adm-primary, #1f4d3a); }

.ai-foot {
    /* Az előzmény-réteg fölött marad, hogy nyitott előzményeknél is lehessen gépelni. */
    position: relative;
    z-index: 1;
    border-top: 1px solid var(--adm-line, #e3e7e4);
    padding: 10px 12px;
    background: #fff;
}

.ai-foot .row-input { display: flex; gap: 8px; align-items: flex-end; }

.ai-foot textarea {
    flex: 1;
    resize: none;
    border: 1px solid var(--adm-line, #e3e7e4);
    border-radius: 10px;
    padding: 8px 10px;
    font-size: .9rem;
    max-height: 120px;
}

.ai-foot textarea:focus { outline: none; border-color: var(--adm-primary, #1f4d3a); }

.ai-send {
    border: none;
    background: var(--adm-primary, #1f4d3a);
    color: #fff;
    border-radius: 10px;
    padding: 9px 14px;
    font-size: .9rem;
}

.ai-send:disabled { opacity: .55; }

.ai-meta {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-top: 6px;
    font-size: .75rem;
    color: #6b7a72;
}

/* Előzmények nézet: a csevegés fölé csúszik be. */
.ai-history {
    display: none;
    position: absolute;
    inset: 52px 0 0;
    background: #fff;
    overflow-y: auto;
    padding: 10px;
}

.ai-history.open { display: block; }

.ai-history-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 10px;
    border: 1px solid var(--adm-line, #e3e7e4);
    border-radius: 10px;
    margin-bottom: 8px;
}

.ai-history-item .open-btn {
    flex: 1;
    border: none;
    background: none;
    text-align: left;
    font-size: .88rem;
    color: #24312b;
}

.ai-history-item .when { font-size: .75rem; color: #7c8a83; }

.ai-history-item .del-btn {
    border: none;
    background: none;
    color: #b3212f;
    font-size: .95rem;
    line-height: 1;
}

.ai-empty { color: #7c8a83; font-size: .85rem; padding: 12px 4px; }

/* Gépel-jelzés */
.ai-typing span {
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-right: 3px;
    border-radius: 50%;
    background: #9aa8a1;
    animation: ai-blink 1.2s infinite;
}

.ai-typing span:nth-child(2) { animation-delay: .2s; }
.ai-typing span:nth-child(3) { animation-delay: .4s; }

@keyframes ai-blink {
    0%, 80%, 100% { opacity: .25; }
    40% { opacity: 1; }
}

/* A hibajelentő FAB fölé kerülő második gomb. */
.bug-fab-wrap.open .bug-fab-item.bug-fab-ai { bottom: 120px; }
.bug-fab-item.bug-fab-ai { background: var(--adm-primary, #1f4d3a); }
.bug-fab-item.bug-fab-ai:hover { background: var(--adm-primary-dark, #16362a); }

@media (max-width: 576px) {
    .ai-panel {
        right: 8px;
        left: 8px;
        bottom: 84px;
        width: auto;
        height: min(560px, calc(100vh - 110px));
    }
}
