/* Floating Chat Button */
#unpv_ai-chat-widget {
    position: fixed;
    bottom: 20px;
    z-index: 9999;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

#unpv_ai-chat-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4285f4, #34a853, #fbbc05, #ea4335);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    color: white;
    padding: 0;
}

#unpv_ai-chat-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

#unpv_ai-chat-toggle svg {
    width: 32px;
    height: 32px;
    fill: white;
}

/* Chat Container */
#unpv_ai-chat-container {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 380px;
    height: 600px;
    max-height: 80vh;
    /* Limit height to 80% of screen */
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.08);
    z-index: 10000;
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
}

#unpv_ai-chat-container.hidden {
    opacity: 0;
    transform: translateY(20px);
    visibility: hidden;
    pointer-events: none;
}

#unpv_ai-chat-container.maximized {
    width: 90vw !important;
    height: 80vh !important;
    max-height: 80vh !important;
    bottom: 20px !important;
    right: 5vw !important;
    left: 5vw !important;
    border-radius: 12px;
}

/* Header */
.unpv_ai-chat-header {
    background: #fff;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f0f0f0;
}

.unpv_header-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 15px;
    color: #1f1f1f;
}

.unpv_header-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #eee;
}

.unpv_header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

#unpv_ai-chat-close,
#unpv_ai-chat-maximize {
    background: none;
    border: none;
    color: #5f6368;
    font-size: 18px;
    cursor: pointer;
    padding: 6px;
    line-height: 1;
    border-radius: 4px;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

#unpv_ai-chat-close:hover,
#unpv_ai-chat-maximize:hover {
    background-color: #f5f5f5;
}

/* Messages Area */
#unpv_ai-chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background-color: #fff;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.unpv_ai-chat-message {
    max-width: 85%;
    font-size: 14px;
    line-height: 1.5;
}

.unpv_ai-chat-message.user {
    align-self: flex-end;
}

.unpv_ai-chat-message.user .unpv_message-content {
    background: #f0f4f9;
    color: #1f1f1f;
    padding: 10px 16px;
    border-radius: 18px 18px 4px 18px;
}

.unpv_ai-chat-message.bot {
    align-self: flex-start;
}

.unpv_ai-chat-message.bot .unpv_message-content {
    background: transparent;
    color: #1f1f1f;
    padding: 0;
}

.unpv_ai-chat-message.error .unpv_message-content {
    color: #d93025;
}

/* Input Area */
.unpv_ai-chat-input-area {
    padding: 12px 16px;
    background: #fff;
    display: flex;
    gap: 8px;
    align-items: center;
    border-top: 1px solid #f0f0f0;
}

#unpv_ai-chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 24px;
    outline: none;
    background: #f0f4f9;
    font-size: 14px;
    transition: background 0.2s, box-shadow 0.2s;
    color: #1f1f1f;
}

#unpv_ai-chat-input:focus {
    background: #fff;
    box-shadow: 0 1px 6px rgba(32, 33, 36, 0.28);
    border-color: transparent;
}

#unpv_ai-chat-send {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

#unpv_ai-chat-send:hover {
    background: #f0f4f9;
}

#unpv_ai-chat-send svg {
    width: 20px;
    height: 20px;
    fill: #444746;
}

#unpv_ai-chat-send:disabled svg {
    fill: #c4c7c5;
}

/* Scrollbar */
#unpv_ai-chat-messages::-webkit-scrollbar {
    width: 6px;
}

#unpv_ai-chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

#unpv_ai-chat-messages::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

/* Loading Animation */
.unpv_dot-flashing {
    position: relative;
    width: 8px;
    height: 8px;
    border-radius: 4px;
    background-color: #4285f4;
    color: #4285f4;
    animation: unpv_dot-flashing 1s infinite linear alternate;
    animation-delay: 0.5s;
    display: inline-block;
    margin-left: 12px;
}

.unpv_dot-flashing::before,
.unpv_dot-flashing::after {
    content: "";
    display: inline-block;
    position: absolute;
    top: 0;
}

.unpv_dot-flashing::before {
    left: -12px;
    width: 8px;
    height: 8px;
    border-radius: 4px;
    background-color: #4285f4;
    color: #4285f4;
    animation: unpv_dot-flashing 1s infinite alternate;
    animation-delay: 0s;
}

.unpv_dot-flashing::after {
    left: 12px;
    width: 8px;
    height: 8px;
    border-radius: 4px;
    background-color: #4285f4;
    color: #4285f4;
    animation: unpv_dot-flashing 1s infinite alternate;
    animation-delay: 1s;
}

@keyframes unpv_dot-flashing {
    0% {
        background-color: #4285f4;
    }

    50%,
    100% {
        background-color: #e6e6e6;
    }
}