/* Help Agent Floating Button & Window */
:root {
    --ha-primary: #4a6cf7;
    --ha-secondary: #0d1117;
    --ha-text: #ffffff;
    --ha-bg: #ffffff;
    --ha-accent: #6c5ce7;
    --ha-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.ha-fab-container {
    /* Container for logical grouping, but elements are fixed */
}

.ha-fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 10001;
    /* Above the window */
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--ha-primary), var(--ha-accent));
    box-shadow: var(--ha-shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: none;
    outline: none;
}

.ha-fab:hover {
    transform: scale(1.1);
}

.ha-fab i {
    color: white;
    font-size: 24px;
    transition: transform 0.3s ease;
}

.ha-fab.active i {
    transform: rotate(45deg);
    /* Turn question mark/icon into X */
}

/* Chat Window */
.ha-window {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 340px;
    height: 450px;
    max-height: 80vh;
    background: var(--ha-bg);
    border-radius: 20px;
    box-shadow: var(--ha-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(0, 0, 0, 0.05);
    z-index: 10000;
}

.ha-window.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

.ha-header {
    background: linear-gradient(135deg, var(--ha-primary), var(--ha-accent));
    padding: 20px;
    color: white;
    display: flex;
    align-items: center;
    gap: 15px;
}

.ha-avatar {
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ha-primary);
    font-size: 20px;
}

.ha-title h4 {
    margin: 0;
    font-weight: 600;
    font-size: 16px;
}

.ha-title span {
    font-size: 12px;
    opacity: 0.8;
}

.ha-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f9fafb;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.ha-message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    animation: ha-fade-in 0.3s ease forwards;
}

.ha-message.bot {
    background: white;
    border-bottom-left-radius: 2px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    color: #333;
    align-self: flex-start;
}

.ha-message.user {
    background: var(--ha-primary);
    color: white;
    border-bottom-right-radius: 2px;
    align-self: flex-end;
}

.ha-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.ha-action-btn {
    background: white;
    border: 1px solid var(--ha-primary);
    color: var(--ha-primary);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.ha-action-btn:hover {
    background: var(--ha-primary);
    color: white;
}

.ha-footer {
    padding: 15px;
    background: white;
    border-top: 1px solid #eee;
}

.ha-input-group {
    display: flex;
    gap: 10px;
}

.ha-input-group input {
    flex: 1;
    border: 1px solid #eee;
    border-radius: 20px;
    padding: 10px 15px;
    outline: none;
    font-family: inherit;
}

.ha-input-group button {
    background: none;
    border: none;
    color: var(--ha-primary);
    cursor: pointer;
    font-size: 18px;
}

@keyframes ha-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Driver.js Custom Overrides if needed usually works OOTB */