/* ==========================================================================
   Ecorp Voice Chat Bot Widget Styles - Light Theme & Green Brand Color
   ========================================================================== */

/* Root variables */
:root {
    --vbot-primary: #00b050;
    --vbot-primary-hover: #008f4c;
    --vbot-gradient-start: #00e676;
    --vbot-gradient-end: #00b050;
    --vbot-bg: #ffffff;
    --vbot-card-bg: #ffffff;
    --vbot-text: #0f172a;
    --vbot-text-muted: #64748b;
    --vbot-user-bubble: #00b050;
    --vbot-bot-bubble: #f1f5f9;
    --vbot-border: #e2e8f0;
    --vbot-shadow: 0 20px 50px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.05);
    --vbot-radius: 18px;
    --vbot-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Hide any legacy floating buttons */
#askAiFloatBtn, .ask-ai-float-btn {
    display: none !important;
}

/* Floating Trigger Button (✨ Ask AI - Aligned on equal bottom margin as WhatsApp on opposite side) */
.vbot-trigger-btn {
    position: fixed;
    bottom: 24px;
    right: 28px;
    z-index: 999990;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    border-radius: 50px;
    background: linear-gradient(135deg, #00b050 0%, #008f4c 100%);
    color: #ffffff !important;
    font-family: var(--vbot-font);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.2px;
    border: none;
    outline: none;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(0, 176, 80, 0.4), 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: vbot-pulse-glow 3s infinite alternate;
    text-decoration: none !important;
    overflow: visible !important;
}

/* 3D Robot Mascot Standing on Top of the Green Pill Button */
.vbot-mascot-wrap {
    position: absolute;
    bottom: calc(100% - 10px);
    left: 36%;
    transform: translateX(-50%);
    width: 58px;
    height: 72px;
    pointer-events: none;
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.28));
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    animation: vbot-mascot-float 3s ease-in-out infinite alternate;
    transform-origin: bottom center;
}

.vbot-mascot-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* Speech Bubble Tooltip on Hover */
.vbot-speech-bubble {
    position: absolute;
    bottom: calc(100% + 14px);
    right: 0;
    transform: translateY(6px) scale(0.92);
    background: #ffffff;
    color: #0f172a;
    font-family: var(--vbot-font);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.35;
    padding: 8px 16px;
    border-radius: 14px;
    white-space: nowrap;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18), 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1.5px solid #00b050;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 999999;
}

/* Downward arrow pointing to robot */
.vbot-speech-bubble::after {
    content: '';
    position: absolute;
    bottom: -6px;
    right: 24px;
    transform: rotate(45deg);
    width: 11px;
    height: 11px;
    background: #ffffff;
    border-right: 1.5px solid #00b050;
    border-bottom: 1.5px solid #00b050;
}

@keyframes vbot-mascot-float {
    0% {
        transform: translateX(-50%) translateY(0) rotate(0deg);
    }
    50% {
        transform: translateX(-50%) translateY(-4px) rotate(-1deg);
    }
    100% {
        transform: translateX(-50%) translateY(-1px) rotate(1deg);
    }
}

.vbot-trigger-btn:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 12px 30px rgba(0, 176, 80, 0.55), 0 4px 15px rgba(0, 0, 0, 0.15);
    color: #ffffff !important;
    background: linear-gradient(135deg, #00c85b 0%, #008f4c 100%);
}

.vbot-trigger-btn:hover .vbot-mascot-wrap,
.ask-ai-float:hover .vbot-mascot-wrap {
    transform: translateX(-50%) translateY(-8px) scale(1.08) rotate(-3deg);
    filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.35));
}

.vbot-trigger-btn:hover .vbot-speech-bubble,
.ask-ai-float:hover .vbot-speech-bubble {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.vbot-trigger-btn:active {
    transform: translateY(-1px) scale(0.98);
}

@keyframes vbot-pulse-glow {
    0% {
        box-shadow: 0 8px 25px rgba(0, 176, 80, 0.4), 0 0 0 0 rgba(0, 176, 80, 0.4);
    }
    50% {
        box-shadow: 0 10px 30px rgba(0, 230, 118, 0.55), 0 0 0 8px rgba(0, 230, 118, 0);
    }
    100% {
        box-shadow: 0 8px 25px rgba(0, 176, 80, 0.4), 0 0 0 0 rgba(0, 176, 80, 0);
    }
}

/* Chat Drawer Container - Light Theme & NO BLUR on Page Background */
.vbot-drawer-container {
    position: fixed;
    bottom: 90px;
    right: 28px;
    width: 400px;
    max-width: calc(100vw - 36px);
    height: 550px;
    max-height: calc(100vh - 110px);
    z-index: 999995;
    background-color: var(--vbot-bg);
    border-radius: var(--vbot-radius);
    box-shadow: var(--vbot-shadow);
    border: 1px solid var(--vbot-border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: var(--vbot-font);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s;
}

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

/* Header */
.vbot-header {
    padding: 16px 20px;
    background: #ffffff;
    border-bottom: 1px solid var(--vbot-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.vbot-avatar {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, #00b050 0%, #008f4c 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 18px;
    box-shadow: 0 4px 12px rgba(0, 176, 80, 0.3);
}

.vbot-title-area h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
}

.vbot-status-text {
    font-size: 12px;
    color: var(--vbot-text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
}

.vbot-status-indicator {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: #22c55e;
}

.vbot-status-indicator.vbot-listening {
    background-color: #ef4444;
    animation: vbot-blink 1s infinite;
}

.vbot-status-indicator.vbot-speaking {
    background-color: #00b050;
    animation: vbot-blink 0.6s infinite;
}

@keyframes vbot-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.vbot-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.vbot-icon-btn {
    background: transparent;
    border: none;
    color: var(--vbot-text-muted);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 14px;
}

.vbot-icon-btn:hover {
    background: #f1f5f9;
    color: #0f172a;
}

/* Voice Visualizer Section */
.vbot-visualizer-container {
    height: 65px;
    background: #f8fafc;
    border-bottom: 1px solid var(--vbot-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 0 10px;
}

.vbot-canvas {
    width: 100%;
    height: 46px;
    display: block;
}

.vbot-visualizer-label {
    position: absolute;
    bottom: 4px;
    font-size: 10px;
    color: var(--vbot-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 700;
}

/* Chat Messages Box */
.vbot-chat-body {
    flex: 1;
    padding: 18px 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background-color: #ffffff;
    scroll-behavior: smooth;
}

.vbot-chat-body::-webkit-scrollbar {
    width: 5px;
}

.vbot-chat-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

/* Message Item */
.vbot-msg {
    display: flex;
    flex-direction: column;
    max-width: 85%;
    animation: vbot-msg-appear 0.25s cubic-bezier(0, 0, 0.2, 1);
}

@keyframes vbot-msg-appear {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.vbot-msg.vbot-user {
    align-self: flex-end;
}

.vbot-msg.vbot-bot {
    align-self: flex-start;
}

.vbot-bubble {
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
    position: relative;
}

.vbot-user .vbot-bubble {
    background: linear-gradient(135deg, #00b050 0%, #008f4c 100%);
    color: #ffffff;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 176, 80, 0.25);
    font-weight: 500;
}

.vbot-bot .vbot-bubble {
    background: var(--vbot-bot-bubble);
    color: #0f172a;
    border-bottom-left-radius: 4px;
    border: 1px solid #e2e8f0;
}

.vbot-msg-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
    padding: 0 4px;
    font-size: 11px;
    color: var(--vbot-text-muted);
}

.vbot-user .vbot-msg-meta {
    justify-content: flex-end;
}

.vbot-tts-btn {
    background: none;
    border: none;
    color: var(--vbot-text-muted);
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    transition: all 0.2s ease;
}

.vbot-tts-btn:hover {
    color: var(--vbot-primary);
    background: #e2e8f0;
}

/* Quick Suggestion Pills (Clean Light Styling - No Emojis) */
.vbot-suggestions {
    padding: 10px 16px;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    white-space: nowrap;
    border-top: 1px solid #f1f5f9;
    background: #f8fafc;
}

.vbot-suggestions::-webkit-scrollbar {
    display: none;
}

.vbot-chip {
    padding: 7px 14px;
    border-radius: 20px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #334155;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
}

.vbot-chip i {
    color: #00b050;
    font-size: 12px;
}

.vbot-chip:hover {
    background: var(--vbot-primary);
    color: #ffffff;
    border-color: var(--vbot-primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 176, 80, 0.3);
}

.vbot-chip:hover i {
    color: #ffffff;
}

/* Footer Control Bar */
.vbot-footer-controls {
    padding: 12px 16px;
    background: #ffffff;
    border-top: 1px solid var(--vbot-border);
    display: flex;
    align-items: center;
    gap: 10px;
}

.vbot-mic-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00b050 0%, #008f4c 100%);
    border: none;
    color: #ffffff;
    font-size: 17px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 176, 80, 0.35);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    position: relative;
}

.vbot-mic-btn:hover {
    transform: scale(1.06);
    box-shadow: 0 6px 20px rgba(0, 176, 80, 0.5);
}

.vbot-mic-btn.vbot-recording {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    animation: vbot-mic-pulse 1.2s infinite;
}

@keyframes vbot-mic-pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { transform: scale(1.1); box-shadow: 0 0 0 14px rgba(239, 68, 68, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.vbot-input-form {
    flex: 1;
    display: flex;
    align-items: center;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 25px;
    padding: 4px 6px 4px 14px;
    transition: all 0.2s ease;
}

.vbot-input-form:focus-within {
    border-color: var(--vbot-primary);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(0, 176, 80, 0.15);
}

.vbot-text-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #0f172a;
    font-size: 13.5px;
    font-family: var(--vbot-font);
}

.vbot-text-input::placeholder {
    color: #94a3b8;
}

.vbot-send-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--vbot-primary);
    border: none;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    transition: all 0.2s ease;
}

.vbot-send-btn:hover {
    background: var(--vbot-primary-hover);
    transform: scale(1.05);
}

/* Settings Modal Overlay - Light Theme */
.vbot-settings-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.98);
    z-index: 999998;
    display: flex;
    flex-direction: column;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease;
}

.vbot-settings-overlay.vbot-show {
    opacity: 1;
    visibility: visible;
}

.vbot-settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--vbot-border);
    margin-bottom: 16px;
}

.vbot-settings-header h3 {
    margin: 0;
    font-size: 16px;
    color: #0f172a;
}

.vbot-settings-group {
    margin-bottom: 16px;
}

.vbot-settings-group label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--vbot-text-muted);
    margin-bottom: 6px;
}

.vbot-select, .vbot-range, .vbot-input {
    width: 100%;
    padding: 10px 12px;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    color: #0f172a;
    font-size: 13px;
    outline: none;
}

.vbot-select option {
    background: #ffffff;
    color: #0f172a;
}

.vbot-range {
    padding: 0;
    accent-color: var(--vbot-primary);
}

/* Scroll to top button fix & clean vertical stacking above Ask AI */
#back-to-top {
    position: fixed !important;
    z-index: 999980 !important;
    bottom: 82px !important;
    right: 36px !important;
    display: none;
}

#back-to-top a {
    width: 42px !important;
    height: 42px !important;
    line-height: 40px !important;
    font-size: 18px !important;
    color: #ffffff !important;
    border-radius: 50% !important;
    background: #00b050 !important;
    border: none !important;
    box-shadow: 0 4px 15px rgba(0, 176, 80, 0.35) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.25s ease !important;
    text-decoration: none !important;
}

#back-to-top a:hover {
    background: #008f4c !important;
    transform: translateY(-2px) scale(1.05) !important;
    box-shadow: 0 6px 20px rgba(0, 176, 80, 0.5) !important;
    color: #ffffff !important;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .vbot-trigger-btn {
        bottom: 16px !important;
        right: 14px !important;
        padding: 7px 13px !important;
        font-size: 12px !important;
    }

    .vbot-mascot-wrap {
        width: 44px !important;
        height: 56px !important;
        bottom: calc(100% - 8px) !important;
        left: 36% !important;
        right: auto !important;
        transform: translateX(-50%) !important;
    }

    .vbot-speech-bubble {
        right: 15px !important;
        font-size: 11.5px !important;
        padding: 6px 12px !important;
    }

    #back-to-top {
        bottom: 80px !important;
        right: 20px !important;
    }

    .vbot-drawer-container {
        bottom: 135px;
        right: 15px;
        left: 15px;
        width: auto;
        height: 500px;
    }
}

