/**
 * vSecure Vigthoria Chat Widget
 * Elegant chat widget powered by Vigthoria.io
 */

:root {
    --vg-primary: #6366f1;
    --vg-secondary: #00bfa6;
    --vg-dark: #1e293b;
    --vg-darker: #0f172a;
    --vg-light: #f8fafc;
    --vg-gray: #64748b;
    --vg-success: #10b981;
    --vg-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    --vg-transition: all 0.3s ease;
    --vg-z-index: 9999;
}

/* Chat Toggle Button */
.vg-chat-toggle {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--vg-primary), #8b5cf6);
    border: none;
    cursor: pointer;
    box-shadow: var(--vg-shadow);
    z-index: var(--vg-z-index);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--vg-transition);
    overflow: hidden;
}

.vg-chat-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.4);
}

.vg-chat-toggle img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.vg-chat-toggle .vg-close-icon {
    display: none;
    font-size: 24px;
    color: white;
}

.vg-chat-toggle.active .vg-logo {
    display: none;
}

.vg-chat-toggle.active .vg-close-icon {
    display: block;
}

/* Notification Badge */
.vg-notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 20px;
    height: 20px;
    background: #ef4444;
    border-radius: 50%;
    color: white;
    font-size: 12px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Chat Container */
.vg-chat-container {
    position: fixed;
    bottom: 100px;
    right: 25px;
    width: 380px;
    height: 550px;
    max-height: calc(100vh - 130px);
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    box-shadow: var(--vg-shadow);
    z-index: calc(var(--vg-z-index) - 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: var(--vg-transition);
}

.vg-chat-container.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Chat Header */
.vg-chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: rgba(30, 41, 59, 0.8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

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

.vg-chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--vg-primary);
    background: white;
}

.vg-chat-avatar img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 4px;
}

.vg-chat-title {
    font-size: 16px;
    font-weight: 600;
    color: white;
    margin: 0;
}

.vg-chat-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #94a3b8;
}

.vg-status-dot {
    width: 8px;
    height: 8px;
    background: var(--vg-success);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--vg-success);
}

.vg-chat-header-controls {
    display: flex;
    gap: 8px;
}

.vg-header-btn {
    background: transparent;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    color: #94a3b8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--vg-transition);
}

.vg-header-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* Messages Area */
.vg-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scrollbar-width: thin;
    scrollbar-color: var(--vg-gray) transparent;
}

.vg-chat-messages::-webkit-scrollbar {
    width: 5px;
}

.vg-chat-messages::-webkit-scrollbar-thumb {
    background: var(--vg-gray);
    border-radius: 10px;
}

/* Message Bubbles */
.vg-message {
    display: flex;
    gap: 10px;
    max-width: 85%;
    animation: messageSlide 0.3s ease;
}

@keyframes messageSlide {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.vg-message.assistant {
    align-self: flex-start;
}

.vg-message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.vg-message-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: white;
}

.vg-message-avatar img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 2px;
}

.vg-message-bubble {
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
}

.vg-message.assistant .vg-message-bubble {
    background: rgba(30, 41, 59, 0.8);
    color: #e2e8f0;
    border-top-left-radius: 4px;
}

.vg-message.user .vg-message-bubble {
    background: linear-gradient(135deg, var(--vg-primary), #8b5cf6);
    color: white;
    border-top-right-radius: 4px;
}

/* Typing Indicator */
.vg-typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
}

.vg-typing-dot {
    width: 8px;
    height: 8px;
    background: var(--vg-gray);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite;
}

.vg-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.vg-typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-8px); }
}

/* Input Area */
.vg-chat-input-area {
    padding: 16px 20px;
    background: rgba(30, 41, 59, 0.8);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.vg-chat-input-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
}

.vg-chat-input {
    flex: 1;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px 16px;
    color: white;
    font-size: 14px;
    outline: none;
    transition: var(--vg-transition);
}

.vg-chat-input:focus {
    border-color: var(--vg-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.vg-chat-input::placeholder {
    color: #64748b;
}

.vg-send-btn {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--vg-primary), #8b5cf6);
    border: none;
    border-radius: 12px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--vg-transition);
}

.vg-send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.vg-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Powered by Footer */
.vg-powered-by {
    padding: 8px;
    text-align: center;
    font-size: 11px;
    color: #64748b;
    background: rgba(15, 23, 42, 0.9);
}

.vg-powered-by a {
    color: var(--vg-primary);
    text-decoration: none;
}

.vg-powered-by a:hover {
    text-decoration: underline;
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
    .vg-chat-container {
        width: calc(100vw - 20px);
        left: 10px;
        right: 10px;
        bottom: 90px;
        height: 60vh;
    }
    
    .vg-chat-toggle {
        width: 55px;
        height: 55px;
        bottom: 20px;
        right: 20px;
    }
}
