/* Virtual Girl Chatbot - Main Styles */
.vgc-chatbot-container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    overflow: hidden;
    margin: 20px auto;
    border: 1px solid #e1e8ed;
}

/* Chat Header */
.vgc-chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.vgc-chat-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.vgc-avatar {
    position: relative;
}

.vgc-avatar-img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.3);
    object-fit: cover;
}

.vgc-status-indicator {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    background: #4caf50;
    border: 2px solid white;
    border-radius: 50%;
}

.vgc-chat-info {
    display: flex;
    flex-direction: column;
}

.vgc-chat-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.vgc-chat-status {
    font-size: 13px;
    opacity: 0.9;
}

.vgc-chat-header-right {
    display: flex;
    gap: 8px;
}

.vgc-header-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.vgc-header-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.dashicons {
    width: 20px;
    height: 20px;
    font-size: 20px;
}

/* Chat Messages Area */
.vgc-chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 300px;
    max-height: 400px;
}

.vgc-message {
    display: flex;
    gap: 12px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.vgc-bot-message {
    align-self: flex-start;
}

.vgc-user-message {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.vgc-message-avatar {
    flex-shrink: 0;
}

.vgc-message-avatar img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.vgc-message-content {
    max-width: 70%;
    display: flex;
    flex-direction: column;
}

.vgc-bot-message .vgc-message-content {
    align-items: flex-start;
}

.vgc-user-message .vgc-message-content {
    align-items: flex-end;
}

.vgc-message-text {
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.vgc-bot-message .vgc-message-text {
    background: white;
    color: #333;
    border: 1px solid #e1e8ed;
    border-top-left-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.vgc-user-message .vgc-message-text {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-top-right-radius: 4px;
}

.vgc-message-time {
    font-size: 11px;
    color: #999;
    margin-top: 4px;
    padding: 0 4px;
}

/* Translation Badge */
.vgc-translation-badge {
    display: inline-block;
    background: #e3f2fd;
    color: #1976d2;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    margin-top: 8px;
    font-weight: 500;
}

.vgc-user-message .vgc-translation-badge {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* Chat Input Area */
.vgc-chat-input-area {
    border-top: 1px solid #e1e8ed;
    background: white;
    padding: 16px;
}

.vgc-input-tools {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.vgc-tool-btn {
    background: none;
    border: none;
    color: #667eea;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.vgc-tool-btn:hover {
    background: #f5f5f5;
}

.vgc-tool-btn.active {
    background: #667eea;
    color: white;
}

.vgc-input-wrapper {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.vgc-message-input {
    flex: 1;
    border: 1px solid #e1e8ed;
    border-radius: 24px;
    padding: 12px 20px;
    font-size: 14px;
    resize: none;
    min-height: 24px;
    max-height: 120px;
    line-height: 1.5;
    font-family: inherit;
    transition: border 0.3s;
}

.vgc-message-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.vgc-input-buttons {
    flex-shrink: 0;
}

/* SEND BUTTON - FIXED AND VISIBLE */
.vgc-send-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    min-width: 100px;
}

.vgc-send-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.vgc-send-btn:active {
    transform: translateY(0);
}

.vgc-send-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.vgc-send-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.vgc-send-text {
    display: block;
}

/* Chat Actions */
.vgc-chat-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
}

.vgc-action-btn {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid #e1e8ed;
    border-radius: 8px;
    background: white;
    color: #666;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s;
}

.vgc-action-btn:hover {
    background: #f8f9fa;
    border-color: #667eea;
    color: #667eea;
}

/* Typing Indicator */
.vgc-typing-indicator {
    padding: 12px 20px;
    background: white;
    border-top: 1px solid #e1e8ed;
    display: none;
    align-items: center;
    gap: 12px;
}

.vgc-typing-dots {
    display: flex;
    gap: 4px;
}

.vgc-typing-dots span {
    width: 8px;
    height: 8px;
    background: #667eea;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

.vgc-typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.vgc-typing-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
    0%, 80%, 100% { transform: scale(0); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

.vgc-typing-text {
    font-size: 13px;
    color: #666;
}

/* Floating Chatbot Widget */
.vgc-floating-chatbot {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 380px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    z-index: 9999;
    display: none;
    border: 1px solid #e1e8ed;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.vgc-floating-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.vgc-floating-avatar {
    position: relative;
}

.vgc-floating-avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.vgc-floating-status {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    background: #4caf50;
    border: 2px solid white;
    border-radius: 50%;
}

.vgc-floating-info {
    flex: 1;
}

.vgc-floating-info h4 {
    margin: 0;
    font-size: 16px;
}

.vgc-floating-info span {
    font-size: 12px;
    opacity: 0.9;
}

.vgc-floating-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vgc-floating-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.vgc-floating-chatbot.expanded .vgc-floating-body {
    max-height: 500px;
}

.vgc-floating-messages {
    padding: 20px;
    max-height: 300px;
    overflow-y: auto;
    background: #f8f9fa;
}

.vgc-floating-input {
    padding: 16px;
    border-top: 1px solid #e1e8ed;
    display: flex;
    gap: 12px;
    background: white;
}

.vgc-floating-input-field {
    flex: 1;
    border: 1px solid #e1e8ed;
    border-radius: 20px;
    padding: 10px 16px;
    font-size: 14px;
}

.vgc-floating-send {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

/* Chatbot Launcher */
#vgc-chatbot-launcher {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    z-index: 9998;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4); }
    50% { box-shadow: 0 6px 30px rgba(102, 126, 234, 0.6); }
    100% { box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4); }
}

#vgc-chatbot-launcher img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
}

/* Voice Input Indicator */
.vgc-voice-active {
    background: #ff6b6b !important;
    color: white !important;
    animation: voice-pulse 1s infinite;
}

@keyframes voice-pulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 107, 107, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(255, 107, 107, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 107, 107, 0); }
}

/* Message Status */
.vgc-message-status {
    font-size: 11px;
    color: #999;
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.vgc-message-status.sent { color: #4caf50; }
.vgc-message-status.error { color: #ff6b6b; }

/* Responsive Design */
@media (max-width: 768px) {
    .vgc-chatbot-container {
        width: 95% !important;
        margin: 10px auto;
        height: 80vh !important;
    }
    
    .vgc-floating-chatbot {
        width: calc(100% - 40px);
        right: 20px;
        bottom: 20px;
    }
    
    .vgc-send-btn {
        padding: 12px 20px;
        min-width: 80px;
    }
    
    .vgc-send-text {
        display: none;
    }
    
    #vgc-chatbot-launcher {
        bottom: 20px;
        right: 20px;
    }
}

/* Scrollbar Styling */
.vgc-chat-messages::-webkit-scrollbar {
    width: 6px;
}

.vgc-chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.vgc-chat-messages::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.vgc-chat-messages::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Bot Message with Speech */
.vgc-speech-available {
    position: relative;
}

.vgc-speech-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(102, 126, 234, 0.1);
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #667eea;
    opacity: 0;
    transition: opacity 0.3s;
}

.vgc-speech-available:hover .vgc-speech-btn {
    opacity: 1;
}

.vgc-speech-btn:hover {
    background: rgba(102, 126, 234, 0.2);
}

/* Loading Animation */
.vgc-loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(102, 126, 234, 0.3);
    border-radius: 50%;
    border-top-color: #667eea;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}