/**
 * Public Frontend Stylesheet for Cubixsol AI Assistant Floating Widget.
 * Features Theme CSS Isolation Shield, Equalizer Animations, and Custom Branding.
 *
 * @package Cubixsol_AI_Voice_Chat_Assistant
 */


.aiva-svg-status {
    width: 16px;
    height: 16px;
    display: inline-block;
    vertical-align: -2px;
    margin-right: 6px;
    flex-shrink: 0;
}

.aiva-svg-status.warning {
    color: #f59e0b;
}

.aiva-svg-status.error {
    color: #ef4444;
}

.aiva-svg-status.success {
    color: #10b981;
}

/* Floating Launcher Button */
.aiva-launcher-btn {
    position: fixed;
    bottom: 15px;
    right: 30px;
    width: 65px;
    height: 65px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0d9488 0%, #0f172a 100%);
    color: #fff;
    box-shadow: 0 8px 30px rgba(13, 148, 136, 0.4);
    cursor: pointer;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
}

/* Bottom Left Position Modifiers */
.aiva-launcher-btn.aiva-pos-bottom-left {
    left: 30px;
    right: auto;
}

.aiva-widget-container.aiva-pos-bottom-left {
    left: 30px;
    right: auto;
}

/* Trigger Button Styles */
.aiva-launcher-btn.aiva-trigger-pill {
    width: auto;
    height: auto;
    border-radius: 50px;
    padding: 12px 22px;
    gap: 10px;
}

.aiva-launcher-btn.aiva-trigger-pill .aiva-launcher-text {
    font-size: 13.5px;
    font-weight: 700;
    white-space: nowrap;
    letter-spacing: 0.2px;
}

.aiva-launcher-btn.aiva-trigger-pill .aiva-launcher-pulse {
    border-radius: 50px;
}

.aiva-launcher-btn.aiva-trigger-badge {
    width: auto;
    height: auto;
    border-radius: 30px;
    padding: 10px 18px;
    gap: 8px;
}

.aiva-launcher-btn.aiva-trigger-badge .aiva-launcher-text {
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.aiva-launcher-btn.aiva-trigger-badge .aiva-launcher-pulse {
    border-radius: 30px;
}

/* Shift launcher and widget if WhatsApp widget is present at bottom-right */
body:has(#omnichat-widget-container.omnichat-pos-bottom-right) .aiva-launcher-btn.aiva-pos-bottom-right,
body:has(.ht-ctc-chat) .aiva-launcher-btn.aiva-pos-bottom-right,
body:has(.joinchat) .aiva-launcher-btn.aiva-pos-bottom-right,
body.aiva-shifted-up .aiva-launcher-btn.aiva-pos-bottom-right {
    bottom: 110px;
}

body:has(#omnichat-widget-container.omnichat-pos-bottom-right) .aiva-widget-container.aiva-pos-bottom-right,
body:has(.ht-ctc-chat) .aiva-widget-container.aiva-pos-bottom-right,
body:has(.joinchat) .aiva-widget-container.aiva-pos-bottom-right,
body.aiva-shifted-up .aiva-widget-container.aiva-pos-bottom-right {
    bottom: 170px;
    max-height: calc(100vh - 210px);
}

.aiva-launcher-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 35px rgba(13, 148, 136, 0.5);
}

.aiva-launcher-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
}

.aiva-launcher-svg {
    width: 30px;
    height: 30px;
    color: #ffffff;
    fill: currentColor;
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.25));
    transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.aiva-launcher-btn:hover .aiva-launcher-svg {
    transform: scale(1.14);
}

/* Pulsing effect around launcher */
.aiva-launcher-pulse {
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border-radius: 50%;
    border: 2px solid rgba(13, 148, 136, 0.4);
    animation: aiva-pulsing 2s infinite;
    pointer-events: none;
    z-index: -1;
}

@keyframes aiva-pulsing {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    100% {
        transform: scale(1.3);
        opacity: 0;
    }
}

/* Main Widget Window Container */
.aiva-widget-container {
    position: fixed;
    bottom: 90px;
    right: 30px;
    width: 380px;
    height: 600px;
    max-height: calc(100vh - 130px);
    z-index: 99998;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    animation: aiva-slideUp 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

@keyframes aiva-slideUp {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.aiva-card {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 20px;
    position: relative;
}

/* Header UI */
.aiva-widget-header {
    background: linear-gradient(135deg, #0f172a 0%, #0f766e 100%);
    color: #fff;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1.5px solid rgba(45, 212, 191, 0.3);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    position: relative;
    z-index: 100;
}

.aiva-bot-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.aiva-avatar {
    background: rgba(255, 255, 255, 0.18);
    border: 1.5px solid rgba(255, 255, 255, 0.35);
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    padding: 0;
    box-sizing: border-box;
    overflow: hidden;
    flex-shrink: 0;
}

.aiva-avatar-svg {
    width: 22px;
    height: 22px;
    color: #ffffff;
    fill: currentColor;
}

.aiva-title-box h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.2;
    letter-spacing: -0.2px;
}

.aiva-status-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 3px;
}

.aiva-status-dot.online {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 8px #4ade80;
}

.aiva-status-text {
    font-size: 11px;
    color: #94a3b8;
    font-weight: 500;
}

.aiva-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.aiva-icon-btn {
    background: rgba(255, 255, 255, 0.12) !important;
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
    color: #ffffff !important;
    cursor: pointer;
    width: 28px;
    height: 28px;
    border-radius: 10px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.aiva-icon-btn:hover {
    background: rgba(255, 255, 255, 0.25) !important;
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2) !important;
}

.aiva-icon-btn .dashicons {
    font-family: "dashicons" !important;
    font-size: 16px !important;
    width: 16px !important;
    height: 16px !important;
    line-height: 16px !important;
    display: inline-block !important;
}

/* Chat Scroll Area */
.aiva-chat-body {
    flex: 1;
    padding: 18px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    scroll-behavior: smooth;
    background: #f8fafc;
}

.aiva-chat-body::-webkit-scrollbar {
    width: 6px;
}

/* Audio replay button next to bot messages */
.aiva-msg.bot {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

/* Replay Audio Controls Row & Unified Capsule Visualizer */
.aiva-audio-controls-row {
    display: inline-flex;
    align-items: center;
    margin-top: 6px;
}

.aiva-replay-btn {
    background: rgba(13, 148, 136, 0.08);
    border: 1.5px solid rgba(13, 148, 136, 0.25);
    color: #0d9488;
    height: 32px;
    border-radius: 20px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 0 14px;
    font-size: 12.5px;
    font-weight: 600;
    gap: 6px;
    box-shadow: 0 2px 6px rgba(13, 148, 136, 0.08);
}

.aiva-replay-btn:hover {
    background: #f0fdfa;
    border-color: #0d9488;
    color: #0f766e;
    box-shadow: 0 4px 14px rgba(13, 148, 136, 0.2);
    transform: translateY(-1px);
}

/* Playing active unified capsule state */
.aiva-replay-btn.playing {
    background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%) !important;
    border: 1.5px solid #2dd4bf !important;
    color: #ffffff !important;
    padding: 0 14px 0 12px !important;
    gap: 8px !important;
    box-shadow: 0 4px 16px rgba(13, 148, 136, 0.45), 0 0 10px rgba(45, 212, 191, 0.3) !important;
}

.aiva-replay-btn.playing .dashicons {
    color: #ffffff !important;
}

.aiva-replay-btn .dashicons {
    font-family: "dashicons" !important;
    font-size: 15px !important;
    width: 15px !important;
    height: 15px !important;
    line-height: 15px !important;
}

/* Integrated Voice Equalizer Wavelength Inside Button Capsule */
.aiva-equalizer-bars {
    display: none;
    align-items: flex-end;
    gap: 2.5px;
    height: 15px;
    padding-left: 8px;
    margin-left: 2px;
    border-left: 1px solid rgba(255, 255, 255, 0.35);
    box-sizing: border-box;
}

.aiva-replay-btn.playing .aiva-equalizer-bars {
    display: inline-flex !important;
    animation: aiva-popIn 0.25s ease;
}

.aiva-equalizer-bars .bar {
    width: 2.5px;
    background: #ffffff;
    border-radius: 3px;
    height: 3px;
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.6);
    animation: aiva-equalizer-bounce 1.1s ease-in-out infinite alternate;
}

.aiva-equalizer-bars .bar-1 {
    height: 5px;
    animation-delay: 0.1s;
}

.aiva-equalizer-bars .bar-2 {
    height: 12px;
    animation-delay: 0.35s;
}

.aiva-equalizer-bars .bar-3 {
    height: 15px;
    animation-delay: 0.15s;
}

.aiva-equalizer-bars .bar-4 {
    height: 8px;
    animation-delay: 0.45s;
}

.aiva-equalizer-bars .bar-5 {
    height: 13px;
    animation-delay: 0.25s;
}

@keyframes aiva-equalizer-bounce {
    0% {
        height: 3px;
        opacity: 0.45;
    }

    50% {
        height: 14px;
        opacity: 1;
    }

    100% {
        height: 5px;
        opacity: 0.75;
    }
}

.aiva-chat-body::-webkit-scrollbar-track {
    background: transparent;
}

.aiva-chat-body::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.08);
    border-radius: 10px;
}

/* Message Bubbles */
.aiva-msg {
    display: flex;
    flex-direction: column;
    max-width: 88%;
    animation: aiva-popIn 0.3s ease;
}

@keyframes aiva-popIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

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

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

.aiva-bubble {
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 13.5px;
    line-height: 1.5;
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
    word-wrap: break-word !important;
    overflow-x: hidden !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.bot .aiva-bubble {
    background: #fff;
    color: #1e293b;
    border-bottom-left-radius: 4px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.user .aiva-bubble {
    background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
    color: #fff;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.25);
}

/* Product Recommendation Card Design */
.aiva-products-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 5px;
    width: 100%;
}

.aiva-product-card {
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
    display: flex;
    align-items: center;
    padding: 10px;
    gap: 12px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.aiva-product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
}

.aiva-prod-thumb {
    width: 65px;
    height: 65px;
    object-fit: cover;
    border-radius: 8px;
    background: #f1f5f9;
}

.aiva-prod-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.aiva-prod-info h4 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.aiva-prod-price {
    font-size: 13px;
    font-weight: 700;
    color: #0f766e;
}

.aiva-prod-link {
    font-size: 11px;
    color: #0d9488;
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    margin-top: 2px;
}

.aiva-prod-link:hover {
    text-decoration: underline;
}

/* Footer Section */
.aiva-widget-footer {
    padding: 8px 12px 12px 12px;
    background: #f8fafc;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.aiva-status-indicator {
    font-size: 11px;
    color: #64748b;
    font-weight: 500;
    text-align: center;
    min-height: 15px;
}

/* Microphone Area */
.aiva-mic-outer-wrapper {
    position: relative;
    width: 48px;
    height: 48px;
}

.aiva-mic-box {
    position: relative;
    width: 48px;
    height: 48px;
    z-index: 2;
}

.aiva-mic-btn {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid #0d9488;
    color: #0d9488;
    box-shadow: 0 6px 20px rgba(13, 148, 136, 0.25);
    padding: 7px;
    box-sizing: border-box;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    outline: none;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.aiva-mic-btn:hover {
    color: #0f766e;
    border-color: #0f766e;
    box-shadow: 0 8px 25px rgba(13, 148, 136, 0.35);
    transform: scale(1.06);
}

.aiva-mic-btn .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.aiva-mic-custom-icon {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
    display: block;
    transition: transform 0.2s ease;
}

.aiva-mic-btn:hover .aiva-mic-custom-icon {
    transform: scale(1.08);
}

/* Microphone Pulsing Waves in Listening/Speaking states */
.aiva-mic-ring,
.aiva-mic-ring2 {
    position: absolute;
    top: 0;
    left: 0;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(13, 148, 136, 0.15);
    pointer-events: none;
    display: none;
    z-index: 1;
}

/* Widget state styling triggers */
.aiva-widget-container.listening .aiva-mic-btn {
    background: #ffffff !important;
    border: 3px solid #0d9488 !important;
    box-shadow: 0 0 25px rgba(13, 148, 136, 0.55), 0 4px 15px rgba(13, 148, 136, 0.3) !important;
}

.aiva-widget-container.listening #aiva-agent-status {
    color: #0d9488 !important;
    font-weight: 700 !important;
}

.aiva-widget-container.listening .aiva-mic-ring {
    display: block;
    background: rgba(45, 212, 191, 0.4);
    animation: aiva-ripple 1.5s infinite linear;
}

.aiva-widget-container.listening .aiva-mic-ring2 {
    display: block;
    background: rgba(13, 148, 136, 0.25);
    animation: aiva-ripple 1.5s infinite linear 0.75s;
}

.aiva-widget-container.speaking .aiva-mic-btn {
    background: #ffffff !important;
    border: 3px solid #0d9488 !important;
    box-shadow: 0 0 25px rgba(13, 148, 136, 0.55), 0 4px 15px rgba(13, 148, 136, 0.3) !important;
}

.aiva-widget-container.speaking #aiva-agent-status {
    color: #0d9488 !important;
    font-weight: 700 !important;
}

.aiva-widget-container.speaking .aiva-mic-ring {
    display: block;
    background: rgba(45, 212, 191, 0.4);
    animation: aiva-ripple 1.5s infinite linear;
}

.aiva-widget-container.speaking .aiva-mic-ring2 {
    display: block;
    background: rgba(13, 148, 136, 0.25);
    animation: aiva-ripple 1.5s infinite linear 0.75s;
}

.aiva-widget-container.thinking .aiva-mic-btn {
    background: rgba(13, 148, 136, 0.12) !important;
    border: 2.5px solid #0d9488 !important;
    color: #0d9488 !important;
    box-shadow: 0 0 20px rgba(13, 148, 136, 0.35), 0 4px 14px rgba(13, 148, 136, 0.2) !important;
    animation: aiva-bounce 1s infinite alternate;
}

.aiva-widget-container.thinking #aiva-agent-status,
.aiva-widget-container.thinking .aiva-status-indicator {
    color: #0d9488 !important;
    font-weight: 600 !important;
}

.aiva-widget-container.thinking .aiva-mic-btn .dashicons {
    color: #0d9488 !important;
}


@keyframes aiva-ripple {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    100% {
        transform: scale(1.6);
        opacity: 0;
    }
}

@keyframes aiva-bounce {
    from {
        transform: translateY(0);
    }

    to {
        transform: translateY(-8px);
    }
}

/* Fallback Keyboard Input wrapper */
.aiva-input-box {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    background: #fff !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    border-radius: 12px !important;
    padding: 4px 6px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02) !important;
    box-sizing: border-box !important;
}

.aiva-input-box input {
    flex: 1 !important;
    border: none !important;
    background: transparent !important;
    padding: 6px 10px !important;
    font-size: 13px !important;
    outline: none !important;
    box-shadow: none !important;
    color: #334155 !important;
    height: 32px !important;
    line-height: 32px !important;
    margin: 0 !important;
}

.aiva-avatar {
    font-size: 16px;
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.aiva-avatar .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    line-height: 18px;
    color: #ffffff;
}

.aiva-send-btn {
    background: #0d9488 !important;
    color: #fff !important;
    border: none !important;
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    margin: 0 !important;
    line-height: 1 !important;
    transition: background 0.2s ease !important;
    flex-shrink: 0 !important;
    align-self: center !important;
}

.aiva-send-btn:hover {
    background: #0f766e;
}

.aiva-send-btn .dashicons {
    font-size: 16px !important;
    width: 16px !important;
    height: 16px !important;
    line-height: 16px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Stop Audio Button */
.aiva-speech-controls {
    margin-top: 5px;
    width: 100%;
    display: flex;
    justify-content: center;
}

.aiva-btn-small {
    background: #fee2e2;
    border: 1px solid #fecaca;
    color: #ef4444;
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 20px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
}

.aiva-btn-small:hover {
    background: #fecaca;
    color: #dc2626;
}

.aiva-btn-small .dashicons {
    font-size: 13px;
    width: 13px;
    height: 13px;
}

/* Custom Language Selector Dropdown in widget header */
.aiva-lang-custom-dropdown {
    position: relative;
    display: inline-block;
    margin-right: 4px;
}

.aiva-lang-toggle {
    background: rgba(255, 255, 255, 0.12) !important;
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
    color: #ffffff !important;
    font-size: 11.5px !important;
    font-weight: 600 !important;
    border-radius: 10px !important;
    padding: 4px 12px !important;
    outline: none !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    transition: all 0.2s ease !important;
    min-width: 85px;
    justify-content: space-between;
    font-family: 'Inter', sans-serif !important;
}

.aiva-lang-toggle:hover,
.aiva-lang-toggle:focus {
    background: rgba(255, 255, 255, 0.25) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2) !important;
}

.aiva-lang-toggle .dashicons {
    font-size: 12px !important;
    width: 12px !important;
    height: 12px !important;
    line-height: 12px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: transform 0.2s ease !important;
    margin: 0 !important;
}

.aiva-lang-custom-dropdown.open .aiva-lang-toggle .dashicons {
    transform: rotate(180deg) !important;
}

.aiva-lang-dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: #0f172a !important;
    border: 1.5px solid rgba(45, 212, 191, 0.4) !important;
    border-radius: 12px;
    padding: 6px;
    min-width: 145px;
    box-shadow: 0 16px 45px rgba(0, 0, 0, 0.65), 0 4px 15px rgba(0, 0, 0, 0.4) !important;
    z-index: 999999 !important;
}

.aiva-lang-option {
    padding: 9px 12px;
    font-size: 12.5px;
    font-weight: 500;
    color: #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.15s ease;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
}

.aiva-lang-option:hover {
    background: rgba(45, 212, 191, 0.18) !important;
    color: #2dd4bf !important;
}

.aiva-lang-option.active {
    background: #0d9488 !important;
    color: #ffffff !important;
    font-weight: 600 !important;
}

.aiva-lang-option .dashicons {
    font-size: 12px !important;
    width: 12px !important;
    height: 12px !important;
    line-height: 12px !important;
    margin: 0 !important;
}

/* Audio replay button next to bot messages */
.aiva-msg.bot {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.aiva-replay-btn {
    background: rgba(13, 148, 136, 0.08);
    border: none;
    color: #0d9488;
    height: 24px;
    border-radius: 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
    flex-shrink: 0;
    transition: all 0.2s ease;
    padding: 0 10px;
    font-size: 11px;
    font-weight: 600;
    gap: 4px;
    margin-top: 2px;
}

.aiva-replay-btn:hover {
    background: rgba(13, 148, 136, 0.15);
    opacity: 1;
    transform: scale(1.02);
}

.aiva-replay-btn .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

/* Stop Speech Pill Button */
.aiva-speech-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 6px;
}

.aiva-stop-speech-pill {
    background: rgba(13, 148, 136, 0.1);
    border: 1.5px solid rgba(13, 148, 136, 0.35);
    color: #0d9488;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 18px;
    border-radius: 20px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 10px rgba(13, 148, 136, 0.15);
    outline: none;
}

.aiva-stop-speech-pill:hover {
    background: #f0fdfa;
    border-color: #0d9488;
    color: #0f766e;
    box-shadow: 0 4px 14px rgba(13, 148, 136, 0.25);
    transform: translateY(-1px);
}

/* Mobile Responsiveness for small screen heights and widths */
@media (max-width: 480px) {
    .aiva-widget-container {
        bottom: 0 !important;
        right: 0 !important;
        width: 100% !important;
        height: 100% !important;
        max-height: 100% !important;
        border-radius: 0 !important;
    }

    .aiva-card {
        border-radius: 0 !important;
        border: none !important;
    }
}

/* Unified Brand Primary Typing Caret, Input Focus & Text Selection for Widget */
.aiva-widget-container input,
.aiva-widget-container textarea,
#aiva-text-input {
    caret-color: #0d9488 !important;
}

.aiva-input-box:focus-within {
    border-color: #0d9488 !important;
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.2), 0 2px 10px rgba(13, 148, 136, 0.1) !important;
}

.aiva-widget-container ::selection,
.aiva-widget-container input::selection,
.aiva-widget-container textarea::selection {
    background: rgba(13, 148, 136, 0.25) !important;
    color: #0f766e !important;
}

/* ==========================================================================
   Comprehensive Theme CSS Isolation Shield (Prevents Theme Style Bleed-Through)
   ========================================================================== */

/* 1. Global Button & Control Overrides */
.aiva-widget-container button,
.aiva-widget-container button:focus,
.aiva-widget-container button:hover,
.aiva-widget-container button:active,
.aiva-widget-container a.button,
.aiva-widget-container a.button:hover,
.aiva-widget-container a.button:focus {
    text-transform: none !important;
    letter-spacing: normal !important;
    box-sizing: border-box !important;
    text-shadow: none !important;
    outline: none !important;
    text-decoration: none !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
}

/* 2. Central Mic Button Isolation (.aiva-mic-btn) */
.aiva-widget-container .aiva-mic-btn,
.aiva-widget-container button.aiva-mic-btn {
    background: #ffffff !important;
    border: 2.5px solid #0d9488 !important;
    color: #0d9488 !important;
    box-shadow: 0 6px 20px rgba(13, 148, 136, 0.25) !important;
    outline: none !important;
}

.aiva-widget-container .aiva-mic-btn:hover,
.aiva-widget-container .aiva-mic-btn:focus,
.aiva-widget-container .aiva-mic-btn:active,
.aiva-widget-container button.aiva-mic-btn:hover,
.aiva-widget-container button.aiva-mic-btn:focus,
.aiva-widget-container button.aiva-mic-btn:active {
    background: #ffffff !important;
    border: 2.5px solid #0f766e !important;
    color: #0f766e !important;
    box-shadow: 0 8px 25px rgba(13, 148, 136, 0.35) !important;
    outline: none !important;
    transform: scale(1.06) !important;
}

.aiva-widget-container .aiva-mic-btn .dashicons {
    color: #0d9488 !important;
}

.aiva-widget-container .aiva-mic-btn:hover .dashicons {
    color: #0f766e !important;
}

/* 3. Audio Response Replay / Listen Button (.aiva-replay-btn) */
.aiva-widget-container .aiva-replay-btn,
.aiva-widget-container button.aiva-replay-btn {
    background: rgba(13, 148, 136, 0.08) !important;
    border: 1px solid rgba(13, 148, 136, 0.2) !important;
    color: #0d9488 !important;
    box-shadow: none !important;
    text-shadow: none !important;
    outline: none !important;
    padding: 0 12px !important;
    height: 26px !important;
    border-radius: 13px !important;
    font-size: 11.5px !important;
    font-weight: 600 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 5px !important;
    transition: all 0.2s ease !important;
}

.aiva-widget-container .aiva-replay-btn:hover,
.aiva-widget-container .aiva-replay-btn:focus,
.aiva-widget-container .aiva-replay-btn:active,
.aiva-widget-container button.aiva-replay-btn:hover,
.aiva-widget-container button.aiva-replay-btn:focus,
.aiva-widget-container button.aiva-replay-btn:active {
    background: rgba(13, 148, 136, 0.16) !important;
    border: 1px solid #0d9488 !important;
    color: #0f766e !important;
    box-shadow: 0 2px 8px rgba(13, 148, 136, 0.18) !important;
    outline: none !important;
    transform: scale(1.02) !important;
}

.aiva-widget-container .aiva-replay-btn.playing,
.aiva-widget-container .aiva-replay-btn.playing:hover,
.aiva-widget-container .aiva-replay-btn.playing:focus,
.aiva-widget-container .aiva-replay-btn.playing:active,
.aiva-widget-container button.aiva-replay-btn.playing {
    background: #0d9488 !important;
    border: 1px solid #0d9488 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.3) !important;
}

.aiva-widget-container .aiva-replay-btn .dashicons,
.aiva-widget-container .aiva-replay-btn .aiva-btn-text {
    color: inherit !important;
}

/* 4. Header Bar Controls (Language Toggle & Minimize) */
.aiva-widget-container .aiva-widget-header {
    background: linear-gradient(135deg, #0f172a 0%, #0f766e 100%) !important;
    border-bottom: 1.5px solid rgba(45, 212, 191, 0.3) !important;
    padding: 14px 18px !important;
    box-sizing: border-box !important;
}

.aiva-widget-container .aiva-lang-toggle,
.aiva-widget-container .aiva-lang-toggle:hover,
.aiva-widget-container .aiva-lang-toggle:focus {
    background: rgba(255, 255, 255, 0.12) !important;
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
    color: #ffffff !important;
    height: 28px !important;
    line-height: 28px !important;
    padding: 0 10px !important;
    border-radius: 10px !important;
    font-size: 11.5px !important;
    font-weight: 600 !important;
    outline: none !important;
    box-shadow: none !important;
    display: inline-flex !important;
    align-items: center !important;
}

.aiva-widget-container .aiva-lang-toggle:hover {
    background: rgba(255, 255, 255, 0.22) !important;
    border-color: rgba(255, 255, 255, 0.4) !important;
}

.aiva-widget-container #aiva-widget-minimize,
.aiva-widget-container #aiva-widget-minimize:hover,
.aiva-widget-container #aiva-widget-minimize:focus {
    background: rgba(255, 255, 255, 0.12) !important;
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
    color: #ffffff !important;
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    line-height: 1 !important;
    border-radius: 10px !important;
    outline: none !important;
    box-shadow: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.aiva-widget-container #aiva-widget-minimize:hover {
    background: rgba(255, 255, 255, 0.22) !important;
    border-color: rgba(255, 255, 255, 0.4) !important;
}


/* 5. Submit Arrow Button */
.aiva-widget-container #aiva-send-btn,
.aiva-widget-container button#aiva-send-btn {
    background: #0d9488 !important;
    border: none !important;
    color: #ffffff !important;
    box-shadow: 0 2px 6px rgba(13, 148, 136, 0.3) !important;
    outline: none !important;
}

.aiva-widget-container #aiva-send-btn:hover,
.aiva-widget-container button#aiva-send-btn:hover {
    background: #0f766e !important;
    box-shadow: 0 4px 10px rgba(13, 148, 136, 0.4) !important;
}
/* Quick reply buttons */
#aiva-widget .aiva-quick-replies {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    margin: 2px 0 10px !important;
    padding: 0 !important;
    animation: aiva-pop-in 0.25s ease-out;
}
#aiva-widget .aiva-quick-chip {
    appearance: none !important;
    background: #ffffff !important;
    color: #0f766e !important;
    border: 1px solid #99d5cf !important;
    border-radius: 999px !important;
    padding: 6px 12px !important;
    margin: 0 !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    font-size: 12.5px !important;
    font-weight: 500 !important;
    line-height: 1.3 !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    cursor: pointer !important;
    box-shadow: none !important;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease !important;
    max-width: 100% !important;
    white-space: normal !important;
    text-align: left !important;
}
#aiva-widget .aiva-quick-chip:hover,
#aiva-widget .aiva-quick-chip:focus-visible {
    background: #0d9488 !important;
    color: #ffffff !important;
    border-color: #0d9488 !important;
    outline: none !important;
}
@keyframes aiva-pop-in {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
    #aiva-widget .aiva-quick-replies { animation: none; }
}

/* Language menu: scroll when many languages are enabled */
.aiva-lang-dropdown-menu {
    max-height: 260px !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    scrollbar-width: thin;
}
.aiva-lang-option {
    white-space: nowrap;
}
/* Right-to-left languages (Arabic, Urdu, Hebrew, Persian) */
#aiva-widget .aiva-bubble[dir="auto"] {
    unicode-bidi: plaintext;
}
#aiva-widget #aiva-text-query[dir="rtl"] {
    text-align: right;
}

/* ==========================================================================
   Launcher & icon isolation shield
   Some themes recolour every SVG on the page (e.g. "svg path { fill: #000 }"
   or "svg { fill: #111 !important }"), which turned the launcher microphone
   black. ID-level selectors with !important keep our icons white everywhere.
   ========================================================================== */
#aiva-launcher.aiva-launcher-btn {
    background: linear-gradient(135deg, #0d9488 0%, #0f172a 100%) !important;
    color: #ffffff !important;
    border: 0 !important;
    outline: none !important;
    text-decoration: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    box-sizing: border-box !important;
}
#aiva-launcher .aiva-launcher-icon {
    color: #ffffff !important;
    background: transparent !important;
    flex-shrink: 0 !important;
}
#aiva-launcher .aiva-launcher-svg {
    display: block !important;
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
    max-width: none !important;
    color: #ffffff !important;
    fill: #ffffff !important;
    stroke: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    background: transparent !important;
}
#aiva-launcher .aiva-launcher-svg *,
#aiva-launcher .aiva-launcher-svg path {
    fill: #ffffff !important;
    stroke: none !important;
    opacity: 1 !important;
}
#aiva-launcher .aiva-launcher-text {
    color: #ffffff !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    text-shadow: none !important;
    background: transparent !important;
}

/* Header avatar icon */
#aiva-widget .aiva-avatar {
    color: #ffffff !important;
}
#aiva-widget .aiva-avatar-svg,
#aiva-widget .aiva-avatar-svg *,
#aiva-widget .aiva-avatar-svg path {
    fill: #ffffff !important;
    color: #ffffff !important;
    stroke: none !important;
    opacity: 1 !important;
    max-width: none !important;
}

/* Other widget SVGs follow the colour of their own container */
#aiva-widget .aiva-svg-status path,
#aiva-widget .aiva-btn-svg path {
    fill: currentColor !important;
}

/* Icon fonts inside the widget keep the widget's colours */
#aiva-widget .dashicons,
#aiva-launcher .dashicons {
    font-family: dashicons !important;
    color: inherit !important;
}
