/* /ai-assistant/css/chat.css */
:root {
    --gv-primary: #2563eb;
    --gv-primary-hover: #1d4ed8;
    --gv-bg-glass: rgba(255, 255, 255, 0.75);
    --gv-border-glass: rgba(255, 255, 255, 0.4);
    --gv-text-main: #1f2937;
    --gv-text-muted: #6b7280;
    --gv-msg-user: #2563eb;
    --gv-msg-user-text: #ffffff;
    --gv-msg-ai: rgba(255, 255, 255, 0.9);
    --gv-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
}

.dark-mode {
    --gv-bg-glass: rgba(17, 24, 39, 0.85);
    --gv-border-glass: rgba(255, 255, 255, 0.1);
    --gv-text-main: #f3f4f6;
    --gv-text-muted: #9ca3af;
    --gv-msg-user: #3b82f6;
    --gv-msg-ai: rgba(31, 41, 55, 0.9);
    --gv-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
}

/* Base Container */
#gv-ai-assistant {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Floating Button */
#gv-chat-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--gv-primary);
    color: white;
    border: none;
    font-size: 24px;
    cursor: pointer;
    box-shadow: var(--gv-shadow);
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

#gv-chat-toggle:hover {
    transform: scale(1.1);
    background: var(--gv-primary-hover);
}

/* Chat Window - Glassmorphism */
.gv-glass-panel {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 500px;
    max-height: 80vh;
    background: var(--gv-bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--gv-border-glass);
    border-radius: 16px;
    box-shadow: var(--gv-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease;
    transform-origin: bottom right;
}

.gv-hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.9) translateY(20px);
}

/* Header */
.gv-chat-header {
    padding: 15px;
    border-bottom: 1px solid var(--gv-border-glass);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.05);
}

.gv-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

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

.gv-online-dot {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 10px;
    height: 10px;
    background: #10b981;
    border-radius: 50%;
    border: 2px solid white;
}

.gv-title {
    margin: 0;
    font-size: 16px;
    color: var(--gv-text-main);
}

.gv-status {
    font-size: 12px;
    color: var(--gv-text-muted);
}

.gv-header-actions button {
    background: none;
    border: none;
    color: var(--gv-text-muted);
    cursor: pointer;
    font-size: 16px;
    padding: 5px;
    transition: color 0.2s;
}

.gv-header-actions button:hover {
    color: var(--gv-text-main);
}

/* Body */
.gv-chat-body {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scroll-behavior: smooth;
}

/* Scrollbar */
.gv-chat-body::-webkit-scrollbar { width: 6px; }
.gv-chat-body::-webkit-scrollbar-thumb { background: var(--gv-border-glass); border-radius: 3px; }

/* Messages */
.gv-message {
    max-width: 80%;
    display: flex;
    flex-direction: column;
}

.gv-ai-message {
    align-self: flex-start;
}

.gv-user-message {
    align-self: flex-end;
    align-items: flex-end;
}

.gv-message-content {
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.4;
    color: var(--gv-text-main);
}

.gv-ai-message .gv-message-content {
    background: var(--gv-msg-ai);
    border-bottom-left-radius: 4px;
    border: 1px solid var(--gv-border-glass);
}

.gv-user-message .gv-message-content {
    background: var(--gv-msg-user);
    color: var(--gv-msg-user-text);
    border-bottom-right-radius: 4px;
}

.gv-timestamp {
    font-size: 10px;
    color: var(--gv-text-muted);
    margin-top: 4px;
}

/* Footer */
.gv-chat-footer {
    padding: 15px;
    border-top: 1px solid var(--gv-border-glass);
    display: flex;
    gap: 10px;
    background: rgba(0, 0, 0, 0.02);
}

#gv-chat-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid var(--gv-border-glass);
    border-radius: 20px;
    background: var(--gv-bg-glass);
    color: var(--gv-text-main);
    outline: none;
    font-size: 14px;
}

#gv-chat-input:focus {
    border-color: var(--gv-primary);
}

#gv-chat-send {
    background: var(--gv-primary);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    transition: background 0.2s;
}

#gv-chat-send:hover {
    background: var(--gv-primary-hover);
}

/* Typing Indicator Animation */
.gv-typing-indicator {
    padding: 10px 15px;
    background: var(--gv-msg-ai);
    border-radius: 14px;
    border-bottom-left-radius: 4px;
    align-self: flex-start;
    display: flex;
    gap: 4px;
    margin-left: 15px;
    margin-bottom: 10px;
    width: fit-content;
    border: 1px solid var(--gv-border-glass);
}

.gv-typing-indicator span {
    width: 6px;
    height: 6px;
    background: var(--gv-text-muted);
    border-radius: 50%;
    animation: gv-bounce 1.4s infinite ease-in-out both;
}

.gv-typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.gv-typing-indicator span:nth-child(2) { animation-delay: -0.16s; }

@keyframes gv-bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
    .gv-glass-panel {
        width: 100%;
        height: 100%;
        max-height: 100vh;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }
    #gv-chat-toggle {
        bottom: 15px;
        right: 15px;
    }
}