﻿/* Beezle Chat Support Widget — Gia v2 (glassmorphic) */

/* Chat Button */
.beezle-chat-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #173F5F 0%, #20639B 100%);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 24px rgba(23, 63, 95, 0.45), 0 0 0 3px rgba(60, 174, 163, 0.15);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(.4,0,.2,1);
}

.beezle-chat-button:hover {
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 8px 30px rgba(23, 63, 95, 0.55), 0 0 0 4px rgba(60, 174, 163, 0.25);
}

.beezle-chat-button svg {
    width: 26px;
    height: 26px;
    fill: white;
}

.beezle-chat-button .notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 20px;
    height: 20px;
    background: #F6D55C;
    color: #173F5F;
    border-radius: 50%;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

/* Chat Window */
.beezle-chat-window {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 380px;
    height: 520px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    box-shadow: 0 16px 48px rgba(23, 63, 95, 0.18), 0 0 0 1px rgba(255,255,255,0.6);
    z-index: 9998;
    display: none;
    flex-direction: column;
    overflow: hidden;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.beezle-chat-window.open {
    display: flex;
    animation: chatSlideUp 0.35s cubic-bezier(.4,0,.2,1);
}

@keyframes chatSlideUp {
    from { opacity: 0; transform: translateY(16px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Chat Header */
.beezle-chat-header {
    background: linear-gradient(135deg, #0a1929 0%, #173F5F 100%);
    color: white;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.beezle-chat-header-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.beezle-chat-header-avatar {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: linear-gradient(135deg, #3CAEA3 0%, #F6D55C 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(60, 174, 163, 0.35);
}

.beezle-chat-header-avatar svg {
    width: 22px;
    height: 22px;
    fill: white;
}

.beezle-chat-header-text h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.beezle-chat-header-text p {
    margin: 1px 0 0;
    font-size: 11px;
    opacity: 0.75;
    font-weight: 400;
}

.beezle-chat-close {
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    opacity: 0.7;
    transition: all 0.2s;
}

.beezle-chat-close:hover {
    opacity: 1;
    background: rgba(255,255,255,0.18);
}

/* Chat Messages */
.beezle-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: transparent;
}

.beezle-chat-messages::-webkit-scrollbar { width: 4px; }
.beezle-chat-messages::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 4px; }

.beezle-chat-message {
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
}

.beezle-chat-message.user { align-items: flex-end; }
.beezle-chat-message.ai,
.beezle-chat-message.system { align-items: flex-start; }

.beezle-chat-bubble {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 13.5px;
    line-height: 1.55;
    word-wrap: break-word;
}

.beezle-chat-message.user .beezle-chat-bubble {
    background: linear-gradient(135deg, #173F5F 0%, #20639B 100%);
    color: white;
    border-bottom-right-radius: 4px;
    box-shadow: 0 2px 10px rgba(23, 63, 95, 0.2);
}

.beezle-chat-message.ai .beezle-chat-bubble {
    background: white;
    color: #1f2937;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.beezle-chat-message.system .beezle-chat-bubble {
    background: rgba(246, 213, 92, 0.12);
    color: #92400e;
    font-style: italic;
    font-size: 12.5px;
    border: 1px solid rgba(246, 213, 92, 0.25);
}

.beezle-chat-time {
    font-size: 10px;
    color: #9ca3af;
    margin-top: 3px;
    padding: 0 6px;
}

/* Typing Indicator */
.beezle-typing {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px 14px;
    background: white;
    border-radius: 14px;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    width: fit-content;
}

.beezle-typing-dot {
    width: 7px;
    height: 7px;
    background: #3CAEA3;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out;
}

.beezle-typing-dot:nth-child(1) { animation-delay: 0s; }
.beezle-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.beezle-typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
    0%, 80%, 100% { transform: scale(0.75); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

/* Chat Input */
.beezle-chat-input-area {
    padding: 10px 14px;
    background: rgba(255,255,255,0.8);
    border-top: 1px solid rgba(229, 231, 235, 0.7);
    display: flex;
    gap: 8px;
    align-items: center;
}

.beezle-chat-input {
    flex: 1;
    border: 1px solid #e5e7eb;
    border-radius: 22px;
    padding: 9px 16px;
    font-size: 13.5px;
    font-family: inherit;
    outline: none;
    background: white;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.beezle-chat-input:focus {
    border-color: #20639B;
    box-shadow: 0 0 0 3px rgba(32, 99, 155, 0.1);
}

.beezle-chat-input::placeholder { color: #9ca3af; }

.beezle-chat-send {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #173F5F 0%, #20639B 100%);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.beezle-chat-send:hover {
    transform: scale(1.08);
    box-shadow: 0 2px 12px rgba(23, 63, 95, 0.3);
}

.beezle-chat-send:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

.beezle-chat-send svg {
    width: 18px;
    height: 18px;
    fill: white;
}

/* Escalate Button */
.beezle-escalate-btn {
    width: 100%;
    padding: 10px;
    background: #25D366;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
    transition: background 0.2s, transform 0.15s;
    text-decoration: none;
}

.beezle-escalate-btn:hover {
    background: #128C7E;
    transform: translateY(-1px);
}

.beezle-escalate-btn svg {
    width: 18px;
    height: 18px;
    fill: white;
}

/* Quick Actions */
.beezle-quick-actions {
    padding: 8px 14px;
    background: rgba(255,255,255,0.7);
    border-top: 1px solid rgba(229, 231, 235, 0.5);
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.beezle-quick-action {
    padding: 5px 12px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    font-size: 11.5px;
    font-family: inherit;
    color: #4b5563;
    cursor: pointer;
    transition: all 0.2s;
}

.beezle-quick-action:hover {
    background: #173F5F;
    color: white;
    border-color: #173F5F;
}

/* Responsive */
@media (max-width: 480px) {
    .beezle-chat-window {
        width: calc(100% - 20px);
        height: calc(100% - 100px);
        right: 10px;
        bottom: 80px;
        border-radius: 16px;
    }

    .beezle-chat-button {
        width: 54px;
        height: 54px;
        right: 16px;
        bottom: 16px;
    }
}
