@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css');

:root {
    --vgp-primary: #5850ec;
    --vgp-primary-dark: #4338ca;
    --vgp-primary-hover: #4338ca;
    --vgp-bg-subtle: #f9fafb;
    --vgp-bg-soft: #f8fafc;
    --vgp-border: #e5e7eb;
    --vgp-text-dark: #111827;
    --vgp-text-light: #6b7280;
    --vgp-text-main: #1e293b;
    --vgp-text-muted: #64748b;
    --vgp-radius: 20px;
    --vgp-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --vgp-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

#vgp-chat-widget {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 999999;
    font-family: 'Inter', -apple-system, system-ui, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

/* Launcher Button */
#vgp-chat-btn {
    width: 60px;
    height: 60px;
    background: var(--vgp-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    cursor: pointer;
    box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#vgp-chat-btn:hover {
    transform: scale(1.1) rotate(5deg);
    background: var(--vgp-primary-dark);
}

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

/* Auto Greeting Popup */
#vgp-greeting-popup {
    position: absolute;
    bottom: 75px;
    right: 0;
    background: white;
    padding: 12px 18px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    font-size: 14px;
    color: #1f2937;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    border: 1px solid #e5e7eb;
}

#vgp-greeting-popup.vgp-show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#vgp-greeting-popup::after {
    content: '';
    position: absolute;
    bottom: -8px;
    right: 22px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid white;
}

/* The Chat Window */
#vgp-chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 600px;
    max-height: calc(100vh - 120px);
    background: #fff;
    border-radius: var(--vgp-radius);
    box-shadow: var(--vgp-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

#vgp-chat-window.vgp-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

#vgp-chat-window.vgp-fullscreen {
    width: calc(100vw - 50px) !important;
    height: calc(100vh - 50px) !important;
    max-width: 1000px !important;
    max-height: 800px !important;
    bottom: 20px !important;
    right: 0 !important;
}

/* Modern Header */
.vgp-header {
    background: #ffffff;
    /* Explicitly white as per user preference in screenshot */
    color: var(--vgp-text-dark);
    padding: 24px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--vgp-border);
}

.vgp-header-btn {
    all: unset;
    cursor: pointer;
    background: transparent;
    border: none;
    color: var(--vgp-text-dark) !important;
    font-size: 20px;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, opacity 0.2s;
    opacity: 0.7;
}

.vgp-header-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

.vgp-close-btn {
    font-size: 26px;
    line-height: 1;
}

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

.vgp-avatar-circle {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.vgp-header-text h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.vgp-header-text p {
    margin: 2px 0 0;
    font-size: 13px;
    opacity: 0.9;
}

/* Container Polish */
.vgp-prechat {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    /* Centers the form horizontally */
    justify-content: center;
    padding: 40px 24px;
    background-color: #ffffff;
}

/* Constraining the form width */
.vgp-form-content {
    width: 100%;
    max-width: 300px;
    /* Prevents that "stretched" look */
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.vgp-prechat-header {
    text-align: center;
    margin-bottom: 8px;
}

.vgp-prechat-header i {
    font-size: 32px;
    color: var(--vgp-primary);
    margin-bottom: 16px;
    display: block;
}

.vgp-prechat-header h4 {
    font-size: 22px;
    font-weight: 800;
    color: var(--vgp-text-dark);
    margin: 0;
}

.vgp-prechat-header p {
    font-size: 14px;
    color: var(--vgp-text-light);
    margin-top: 8px;
}

/* Modern Input Styling */
.vgp-input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: left;
}

.vgp-input-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--vgp-text-light);
    text-transform: uppercase;
    letter-spacing: 0.025em;
    padding-left: 2px;
    display: block;
    margin-bottom: 0;
}

.vgp-prechat input {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
    border: 1px solid var(--vgp-border);
    border-radius: 10px;
    font-size: 14px;
    background-color: var(--vgp-bg-subtle);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--vgp-shadow-sm);
}

.vgp-prechat input:focus {
    outline: none;
    background-color: #fff;
    border-color: var(--vgp-primary);
    box-shadow: 0 0 0 4px rgba(88, 80, 236, 0.1), var(--vgp-shadow-sm);
}

/* The "De-vibe-coded" Button */
.vgp-start-btn {
    width: auto;
    /* Not full width */
    min-width: 160px;
    align-self: center;
    /* Center the button */
    background: var(--vgp-primary);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 9999px;
    /* Pill shape */
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(88, 80, 236, 0.2);
    transition: transform 0.1s, background 0.2s, box-shadow 0.2s;
    margin-top: 10px;
}

.vgp-start-btn:hover {
    background: var(--vgp-primary-hover);
    box-shadow: 0 10px 15px -3px rgba(88, 80, 236, 0.3);
}

.vgp-start-btn:active {
    transform: scale(0.98);
}

/* Scrollbar */
.vgp-messages::-webkit-scrollbar {
    width: 4px;
}

.vgp-messages::-webkit-scrollbar-track {
    background: transparent;
}

.vgp-messages::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.vgp-msg {
    max-width: 85%;
    padding: 12px 16px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
    margin-bottom: 12px;
}

.vgp-msg-admin {
    align-self: flex-start;
    background: #e0e7ff;
    color: #1e1b4b;
    border-radius: 16px 16px 16px 4px;
}

.vgp-msg-visitor {
    align-self: flex-end;
    background: var(--vgp-primary);
    color: white;
    border-radius: 16px 16px 4px 16px;
}

#vgp-typing-indicator {
    padding: 8px 20px;
    font-size: 12px;
    color: var(--vgp-text-muted);
    font-style: italic;
    background: var(--vgp-bg-soft);
    border-top: 1px solid #f1f5f9;
}

/* Attachment Preview Popup */
#vgp-attachment-preview {
    position: absolute;
    bottom: 70px;
    left: 0;
    right: 0;
    background: white;
    padding: 16px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 10;
}

#vgp-preview-filename {
    font-size: 13px;
    color: #4b5563;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vgp-preview-actions {
    display: flex;
    gap: 8px;
}

.vgp-preview-actions button {
    flex: 1;
    padding: 8px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
}

#vgp-preview-cancel {
    background: #f3f4f6;
    color: #4b5563;
}

#vgp-preview-send {
    background: #10b981;
    color: white;
}


/* Input Area Overrides */
.vgp-input-area input:focus {
    outline: none;
    border-color: var(--vgp-primary);
}


.hidden {
    display: none !important;
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
    #vgp-chat-widget {
        bottom: 0px;
        right: 0px;
    }

    #vgp-chat-window {
        width: 100vw;
        height: 100vh;
        max-height: 100vh;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }

    #vgp-chat-window.vgp-fullscreen {
        width: 100vw !important;
        height: 100vh !important;
        max-width: 100vw !important;
        max-height: 100vh !important;
        bottom: 0 !important;
        right: 0 !important;
        border-radius: 0 !important;
    }

    #vgp-chat-btn {
        bottom: 20px;
        right: 20px;
        position: fixed;
    }
}