/* Widget agent Mbogi */
#mbogi-widget {
    --mbogi-primary: #2E8B57;
    --mbogi-secondary: #FFD700;
    --mbogi-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
    position: fixed;
    bottom: 1.25rem;
    right: 1.25rem;
    z-index: 10001;
    font-family: 'Segoe UI', Tahoma, sans-serif;
}

.mbogi-fab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #2E8B57, #228B22);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 0.85rem 1.25rem;
    box-shadow: var(--mbogi-shadow);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.mbogi-fab:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 36px rgba(46, 139, 87, 0.35);
}

.mbogi-fab-label {
    font-weight: 600;
    font-size: 0.95rem;
}

.mbogi-panel {
    position: absolute;
    bottom: calc(100% + 0.75rem);
    right: 0;
    width: min(380px, calc(100vw - 2rem));
    height: 520px;
    max-height: calc(100vh - 6rem);
    background: #fff;
    border-radius: 16px;
    box-shadow: var(--mbogi-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(46, 139, 87, 0.15);
}

.mbogi-panel[hidden] {
    display: none !important;
}

.mbogi-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.65rem;
    padding: 0.85rem 1rem;
    background: linear-gradient(135deg, #2E8B57, #228B22);
    color: #fff;
}

.mbogi-header-info {
    flex: 1;
    min-width: 0;
}

.mbogi-header small {
    display: block;
    opacity: 0.9;
    font-size: 0.75rem;
}

.mbogi-header button {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 0.25rem;
}

.mbogi-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    background: #f8faf9;
}

.mbogi-msg {
    max-width: 88%;
    padding: 0.65rem 0.85rem;
    border-radius: 14px;
    font-size: 0.92rem;
    line-height: 1.45;
    word-break: break-word;
}

.mbogi-msg.user {
    align-self: flex-end;
    background: var(--mbogi-primary);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.mbogi-msg.assistant {
    align-self: flex-start;
    background: #fff;
    border: 1px solid #e5ebe7;
    border-bottom-left-radius: 4px;
}

.mbogi-msg.typing {
    opacity: 0.7;
    font-style: italic;
}

.mbogi-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.35rem;
}

.mbogi-action-btn {
    font-size: 0.78rem;
    padding: 0.3rem 0.6rem;
    border-radius: 999px;
    border: 1px solid var(--mbogi-primary);
    background: #fff;
    color: var(--mbogi-primary);
    cursor: pointer;
}

.mbogi-action-btn:hover {
    background: var(--mbogi-primary);
    color: #fff;
}

.mbogi-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding: 0.5rem 0.75rem 0;
    border-top: 1px solid #eef2ef;
}

.mbogi-chip {
    font-size: 0.78rem;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    border: 1px solid #d0ddd5;
    background: #fff;
    cursor: pointer;
    color: #333;
}

.mbogi-chip:hover {
    border-color: var(--mbogi-primary);
    color: var(--mbogi-primary);
}

.mbogi-form {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem;
    border-top: 1px solid #eef2ef;
    background: #fff;
}

.mbogi-form input {
    flex: 1;
    border: 1px solid #d8e2dc;
    border-radius: 999px;
    padding: 0.55rem 1rem;
    font-size: 0.9rem;
    outline: none;
}

.mbogi-form input:focus {
    border-color: var(--mbogi-primary);
}

.mbogi-form button {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    background: var(--mbogi-primary);
    color: #fff;
    cursor: pointer;
}

.mbogi-highlight-flash {
    outline: 3px solid var(--mbogi-secondary) !important;
    outline-offset: 4px;
    transition: outline 0.3s;
}

.mbogi-consent {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    background: rgba(26, 26, 26, 0.92);
    color: #fff;
    padding: 1rem;
}

.mbogi-consent[hidden] {
    display: none !important;
}

.mbogi-consent-inner {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.mbogi-consent-inner p {
    margin: 0;
    flex: 1;
    min-width: 200px;
    font-size: 0.9rem;
}

.mbogi-consent-actions {
    display: flex;
    gap: 0.5rem;
}

.mbogi-btn-sm {
    padding: 0.45rem 1rem;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
}

.mbogi-btn-primary {
    background: var(--mbogi-primary);
    color: #fff;
}

.mbogi-btn-ghost {
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

@media (max-width: 480px) {
    #mbogi-widget {
        bottom: 0.75rem;
        right: 0.75rem;
    }

    .mbogi-panel {
        width: calc(100vw - 1.5rem);
        height: calc(100vh - 5rem);
    }

    .mbogi-fab-label {
        display: none;
    }
}
