/* HIA (HubBroker AI Assistant) Chatbot Styles */

/* 1. Speech Bubble Tooltip */
.hia-tooltip {
    position: fixed;
    bottom: 95px;
    right: 24px;
    background: #ffffff;
    border: 2px solid #86EFAC;
    border-radius: 16px;
    padding: 0.85rem 1.15rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    z-index: 9998;
    max-width: 250px;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    animation: hiaBounceIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.hia-tooltip::after {
    content: '';
    position: absolute;
    bottom: -9px;
    right: 32px;
    width: 0;
    height: 0;
    border-left: 9px solid transparent;
    border-right: 9px solid transparent;
    border-top: 9px solid #86EFAC;
}

.hia-tooltip-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.hia-tooltip-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: #10243E;
}

.hia-tooltip-close {
    background: none;
    border: none;
    font-size: 1.1rem;
    color: #94A3B8;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.hia-tooltip-close:hover {
    color: #0F172A;
}

.hia-tooltip-body {
    font-size: 0.825rem;
    color: #475569;
    line-height: 1.45;
}

/* 2. Floating Trigger Button */
.hia-launcher {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0B301B 0%, #165B33 100%);
    border: 3px solid #86EFAC;
    box-shadow: 0 8px 24px rgba(11, 48, 27, 0.35), 0 0 0 4px rgba(34, 197, 94, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 9999;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.hia-launcher:hover {
    transform: scale(1.06);
    box-shadow: 0 12px 28px rgba(11, 48, 27, 0.45), 0 0 0 6px rgba(34, 197, 94, 0.3);
}

.hia-launcher-text {
    font-size: 0.625rem;
    font-weight: 800;
    color: #ffffff;
    line-height: 1;
    margin-top: 2px;
    text-align: center;
}

.hia-launcher-subtext {
    font-size: 0.525rem;
    color: #86EFAC;
    font-weight: 700;
}

/* 3. Minimized Bottom Bar */
.hia-minimized-bar {
    position: fixed;
    bottom: 20px;
    right: 24px;
    background: #ffffff;
    border: 1.5px solid #86EFAC;
    border-radius: 99px;
    padding: 0.45rem 1rem;
    display: none;
    align-items: center;
    gap: 0.65rem;
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
    cursor: pointer;
    z-index: 9999;
    transition: all 0.2s ease;
}

.hia-minimized-bar:hover {
    box-shadow: 0 10px 25px rgba(0,0,0,0.12);
    border-color: #22C55E;
}

/* 4. Chat Modal Window */
.hia-modal {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 410px;
    height: 620px;
    max-height: calc(100vh - 48px);
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.2), 0 0 0 1px rgba(0,0,0,0.05);
    display: none;
    flex-direction: column;
    z-index: 10000;
    overflow: hidden;
    font-family: inherit;
    animation: hiaSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.hia-modal.is-open {
    display: flex;
}

/* Modal Header */
.hia-header {
    background: linear-gradient(135deg, #0B301B 0%, #165B33 100%);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #ffffff;
}

.hia-header-info {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.hia-header-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #072213;
    border: 2px solid #86EFAC;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex-shrink: 0;
}

.hia-status-dot {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    background: #22C55E;
    border: 2px solid #0B301B;
    border-radius: 50%;
}

.hia-header-title {
    font-size: 1.15rem;
    font-weight: 800;
    margin: 0;
    color: #ffffff;
    line-height: 1.2;
}

.hia-header-subtitle {
    font-size: 0.775rem;
    color: #A7F3D0;
    margin: 0;
}

.hia-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.hia-header-btn {
    background: rgba(255,255,255,0.12);
    border: none;
    color: #ffffff;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    transition: background 0.15s ease;
}

.hia-header-btn:hover {
    background: rgba(255,255,255,0.25);
}

/* Modal Body */
.hia-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.15rem;
    background: #F8FAFC;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    scrollbar-width: thin;
    scrollbar-color: #CBD5E1 transparent;
}

/* Welcome Card */
.hia-welcome-card {
    background: #F0FDF4;
    border: 1px solid #DCFCE7;
    border-radius: 16px;
    padding: 1.15rem;
    display: flex;
    gap: 1rem;
}

.hia-welcome-avatar {
    width: 44px;
    height: 44px;
    background: #0B301B;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.hia-welcome-content h4 {
    font-size: 1rem;
    font-weight: 800;
    color: #10243E;
    margin: 0 0 0.35rem;
}

.hia-welcome-content p {
    font-size: 0.835rem;
    color: #475569;
    margin: 0;
    line-height: 1.45;
}

/* Suggestions Section */
.hia-suggestions-header {
    font-size: 0.835rem;
    font-weight: 700;
    color: #334155;
    margin-top: 0.5rem;
}

.hia-suggestions-list {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.hia-suggestion-card {
    background: #ffffff;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 0.85rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.hia-suggestion-card:hover {
    border-color: #22C55E;
    background: #F0FDF4;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}

.hia-suggestion-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: #1E293B;
}

/* Chat Messages */
.hia-message-row {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.hia-message-row.user {
    flex-direction: row-reverse;
}

.hia-message-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.hia-message-avatar.bot {
    background: #0B301B;
}

.hia-message-avatar.user {
    background: #E2E8F0;
}

.hia-bubble {
    max-width: 85%;
    border-radius: 14px;
    padding: 0.85rem 1rem;
    font-size: 0.85rem;
    line-height: 1.5;
}

.hia-bubble.user {
    background: #DCFCE7;
    color: #064E3B;
    font-weight: 600;
    border-bottom-right-radius: 2px;
}

.hia-bubble.bot {
    background: #ffffff;
    border: 1px solid #E2E8F0;
    color: #1E293B;
    border-bottom-left-radius: 2px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.02);
}

/* Step list inside bot answer */
.hia-steps-list {
    margin: 0.75rem 0 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.hia-step-item {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    font-size: 0.825rem;
    line-height: 1.4;
}

.hia-step-num {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #22C55E;
    color: #ffffff;
    font-weight: 800;
    font-size: 0.725rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
}

/* Action Guide Card inside Answer */
.hia-guide-card {
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 0.75rem;
    margin-top: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-decoration: none;
    transition: all 0.15s ease;
}

.hia-guide-card:hover {
    background: #EFF6FF;
    border-color: #93C5FD;
}

.hia-guide-left {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.hia-guide-icon {
    width: 32px;
    height: 32px;
    background: #FAF5FF;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9333EA;
}

/* Related Articles inside Answer */
.hia-related-box {
    margin-top: 1rem;
    border-top: 1px solid #F1F5F9;
    padding-top: 0.75rem;
}

.hia-related-title {
    font-size: 0.75rem;
    font-weight: 800;
    color: #64748B;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.hia-related-item {
    background: #ffffff;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 0.55rem 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 700;
    color: #1E293B;
    margin-bottom: 0.45rem;
    transition: all 0.15s ease;
}

.hia-related-item:hover {
    border-color: #22C55E;
    color: #15803D;
}

/* Footer / Input Bar */
.hia-footer {
    padding: 0.75rem 1rem 0.65rem;
    background: #ffffff;
    border-top: 1px solid #E2E8F0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.hia-input-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #F8FAFC;
    border: 1px solid #CBD5E1;
    border-radius: 12px;
    padding: 0.35rem 0.4rem 0.35rem 0.75rem;
    transition: border-color 0.15s ease;
}

.hia-input-container:focus-within {
    border-color: #22C55E;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}

.hia-input-field {
    border: none;
    outline: none;
    background: transparent;
    font-size: 0.875rem;
    width: 100%;
    color: #0F172A;
}

.hia-send-btn {
    width: 36px;
    height: 36px;
    background: #22C55E;
    border: none;
    border-radius: 8px;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s ease;
}

.hia-send-btn:hover {
    background: #16A34A;
}

.hia-disclaimer {
    font-size: 0.6875rem;
    color: #94A3B8;
    text-align: center;
    margin: 0;
}

/* Animations */
@keyframes hiaBounceIn {
    0% { opacity: 0; transform: scale(0.8) translateY(10px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes hiaSlideUp {
    0% { opacity: 0; transform: translateY(20px) scale(0.95); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 480px) {
    .hia-modal {
        width: calc(100vw - 20px);
        right: 10px;
        bottom: 10px;
        height: calc(100vh - 20px);
    }
}
