/* AlvealPRO Chat Widget Styles */
#alveal-chat-widget-container,
#alveal-chat-widget-container * {
    box-sizing: border-box !important;
}

#alveal-chat-widget-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999999;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Floating Launch Button */
.alveal-chat-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #000000;
    color: #ffffff;
    border: 2px solid #8bb32d;
    outline: none;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease, background-color 0.2s;
    position: relative;
    padding: 0 !important;
}

.alveal-chat-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 10px 28px rgba(139, 179, 45, 0.4);
    background-color: #111111;
}

.alveal-chat-btn:active {
    transform: scale(0.95);
}

.alveal-chat-btn svg {
    fill: #ffffff !important;
    width: 28px;
    height: 28px;
}

.alveal-chat-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background-color: #ef4444;
    color: white;
    font-size: 11px;
    font-weight: bold;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* Chat Drawer Box */
#alveal-chat-box {
    position: absolute;
    bottom: 76px;
    right: 0;
    width: 380px;
    height: 520px;
    max-height: calc(100vh - 120px);
    border-radius: 20px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), visibility 0.3s;
    opacity: 1;
    transform: translateY(0) scale(1);
    visibility: visible;
}

#alveal-chat-box.alveal-chat-box-hidden {
    opacity: 0;
    transform: translateY(40px) scale(0.85);
    visibility: hidden;
    pointer-events: none;
}

/* Header */
.alveal-chat-header {
    background: #000000;
    color: #ffffff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 2px solid #8bb32d;
    shrink: 0;
}

.alveal-chat-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.alveal-chat-title-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #1e293b;
    border: 1px solid rgba(255,255,255,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8bb32d;
    font-size: 18px;
}

.alveal-chat-title-info h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.01em;
}

.alveal-chat-title-info span {
    font-size: 10px;
    color: #8bb32d;
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
}

.alveal-chat-status-dot {
    width: 6px;
    height: 6px;
    background-color: #22c55e;
    border-radius: 50%;
    display: inline-block;
}

.alveal-chat-close-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: color 0.2s, background-color 0.2s;
}

.alveal-chat-close-btn:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.1);
}

/* Messages List */
.alveal-chat-body {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background-color: #f1f5f9;
}

.alveal-chat-msg {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 12.5px;
    line-height: 1.5;
    word-break: break-word;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.alveal-chat-msg-user {
    align-self: flex-end;
    background-color: #000000;
    color: #ffffff;
    border-bottom-right-radius: 4px;
}

.alveal-chat-msg-ai,
.alveal-chat-msg-operator {
    align-self: flex-start;
    background-color: #ffffff;
    color: #0f172a;
    border: 1px solid #e2e8f0;
    border-bottom-left-radius: 4px;
}

.alveal-chat-msg-operator {
    border-left: 3px solid #2563eb;
}

/* Links inside AI responses */
.alveal-chat-msg a.alveal-chat-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    padding: 6px 12px;
    background-color: #000000;
    color: #ffffff !important;
    font-weight: 700;
    font-size: 11px;
    border-radius: 8px;
    text-decoration: none !important;
    transition: background-color 0.2s;
}

.alveal-chat-msg a.alveal-chat-link-btn:hover {
    background-color: #1e293b;
}

/* Typing Indicator */
.alveal-chat-typing {
    align-self: flex-start;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    padding: 10px 14px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.alveal-chat-typing span {
    width: 6px;
    height: 6px;
    background-color: #94a3b8;
    border-radius: 50%;
    animation: alvealChatBounce 1.4s infinite ease-in-out both;
}

.alveal-chat-typing span:nth-child(1) { animation-delay: -0.32s; }
.alveal-chat-typing span:nth-child(2) { animation-delay: -0.16s; }

@keyframes alvealChatBounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1.0); }
}

/* Quick Actions Bar */
.alveal-chat-quick-actions {
    padding: 8px 12px;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 6px;
    overflow-x: auto;
    shrink: 0;
}

.alveal-chat-quick-btn {
    white-space: nowrap;
    padding: 5px 10px;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    color: #334155;
    cursor: pointer;
    transition: all 0.2s;
}

.alveal-chat-quick-btn:hover {
    background: #000000;
    color: #ffffff;
    border-color: #000000;
}

/* Footer Input Form */
.alveal-chat-footer {
    padding: 10px;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 8px;
    shrink: 0;
}

.alveal-chat-input {
    flex: 1;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 9px 12px;
    font-size: 12px;
    outline: none;
    transition: border-color 0.2s;
    background: #f8fafc;
}

.alveal-chat-input:focus {
    border-color: #000000;
    background: #ffffff;
}

.alveal-chat-send-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #000000;
    color: #ffffff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.alveal-chat-send-btn:hover {
    background: #1e293b;
}

@media (max-width: 480px) {
    #alveal-chat-box {
        width: calc(100vw - 32px);
        right: -8px;
        bottom: 70px;
        height: 480px;
    }
}
