/* Premium AI Sales Agent Widget Styles */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600&display=swap');

:root {
    --ai-primary: #09090b;
    /* Zinc 950 - Professional */
    --ai-secondary: #18181b;
    /* Zinc 900 */
    --ai-bg-solid: #ffffff;
    --ai-border-light: #e4e4e7;
    /* Zinc 200 */
    --ai-text-main: #09090b;
    /* Zinc 950 */
    --ai-text-muted: #71717a;
    /* Zinc 500 */
    --ai-msg-ai-bg: #f4f4f5;
    /* Zinc 100 */
    --ai-msg-user-bg: var(--ai-secondary);
    --ai-shadow-heavy: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --ai-shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --ai-radius-lg: 16px;
    --ai-radius-sm: 12px;
    --ai-font: 'Outfit', sans-serif;
}

#ai-sales-agent-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 999999;
    font-family: var(--ai-font);
    -webkit-font-smoothing: antialiased;
}

/* Floating Action Button (FAB) */
.ai-sales-agent-toggle-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--ai-primary);
    color: white;
    border: none;
    box-shadow: var(--ai-shadow-heavy);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
    padding: 0 !important;
}

.ai-sales-agent-toggle-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 25px -5px rgba(9, 9, 11, 0.3);
    background: #27272a;
    /* Zinc 800 */
}

.elizabeth-notification-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: white;
    color: var(--ai-primary);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--ai-primary);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    animation: badge-pulse 2s infinite;
}

@keyframes badge-pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
        box-shadow: 0 0 10px rgba(255, 255, 255, 0.6);
    }

    100% {
        transform: scale(1);
    }
}


.ai-sales-agent-toggle-btn svg {
    width: 30px;
    height: auto;
}

/* Chat Container */
.ai-sales-agent-container {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 650px;
    max-height: calc(100dvh - 120px);
    background: var(--ai-bg-solid);
    border-radius: var(--ai-radius-lg);
    box-shadow: var(--ai-shadow-heavy);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--ai-border-light);
    animation: ai-slide-up-fade 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    transform-origin: bottom right;
}

@keyframes ai-slide-up-fade {
    0% {
        opacity: 0;
        transform: scale(0.9) translateY(40px);
    }

    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Premium Header */
.ai-sales-agent-header {
    background: var(--ai-primary);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    color: white;
}

.ai-header-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ai-header-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.ai-header-info h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
    color: white;
    letter-spacing: -0.2px;
}

.ai-header-info p {
    margin: 0;
    font-size: 12px;
    color: #a1a1aa;
    /* Zinc 400 */
    display: flex;
    align-items: center;
    gap: 4px;
}

.ai-status-dot {
    width: 8px;
    height: 8px;
    background-color: #10b981;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

.ai-sales-agent-close-btn {
    background: transparent;
    border: none;
    color: #a1a1aa;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s;
}

.ai-sales-agent-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* Messages Area */
.ai-sales-agent-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: rgba(250, 250, 250, 0.5);
    /* Zinc 50 with opacity */
}

.ai-sales-agent-messages::-webkit-scrollbar {
    width: 6px;
}

.ai-sales-agent-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

.ai-message {
    max-width: 82%;
    padding: 14px 18px;
    font-size: 14px;
    line-height: 1.5;
    animation: ai-message-pop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    word-break: break-word;
    position: relative;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
}

@keyframes ai-message-pop {
    0% {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }

    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.ai-message-ai,
.ai-message-system {
    background: var(--ai-msg-ai-bg);
    color: var(--ai-text-main);
    align-self: flex-start;
    border-radius: var(--ai-radius-sm) var(--ai-radius-sm) var(--ai-radius-sm) 4px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.ai-message-user {
    background: var(--ai-msg-user-bg);
    color: white;
    align-self: flex-end;
    border-radius: var(--ai-radius-sm) var(--ai-radius-sm) 4px var(--ai-radius-sm);
    box-shadow: 0 4px 15px rgba(24, 24, 27, 0.15);
    /* Zinc 900 shadow */
}

/* Input Area */
.ai-sales-agent-input-area {
    padding: 18px 24px;
    background: rgba(255, 255, 255, 0.9);
    border-top: 1px solid var(--ai-border-light);
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.ai-sales-agent-input-area textarea {
    flex: 1;
    border: 1px solid var(--ai-border-light);
    border-radius: 20px;
    padding: 10px 18px;
    font-size: 16px;
    font-family: inherit;
    resize: none;
    max-height: 120px;
    outline: none;
    transition: all 0.3s ease;
    background: #f4f4f5;
    /* Zinc 100 */
    color: var(--ai-text-main);
    height: inherit !important;
    line-height: inherit;
}

.ai-sales-agent-input-area textarea:focus {
    border-color: var(--ai-primary);
    background: white;
    box-shadow: 0 0 0 3px rgba(9, 9, 11, 0.1);
}

.ai-sales-agent-send-btn {
    background: var(--ai-text-main);
    color: white;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    padding: 0 !important;
}

.ai-sales-agent-send-btn:hover:not(:disabled) {
    background: var(--ai-primary);
    transform: scale(1.08) rotate(-10deg);
    box-shadow: 0 4px 12px rgba(9, 9, 11, 0.3);
}

.ai-sales-agent-send-btn:disabled {
    background: #d4d4d8;
    /* Zinc 300 */
    cursor: not-allowed;
    transform: none;
}

/* Typing Indicator Overlay */
.ai-typing-indicator {
    display: flex;
    gap: 5px;
    padding: 16px 20px;
    background: var(--ai-msg-ai-bg);
    border-radius: var(--ai-radius-sm) var(--ai-radius-sm) var(--ai-radius-sm) 4px;
    align-self: flex-start;
    width: fit-content;
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.ai-typing-dot {
    width: 6px;
    height: 6px;
    background: var(--ai-primary);
    border-radius: 50%;
    animation: ai-typing-bounce 1.4s infinite ease-in-out both;
    opacity: 0.6;
}

.ai-typing-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.ai-typing-dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes ai-typing-bounce {

    0%,
    80%,
    100% {
        transform: scale(0);
        opacity: 0.4;
    }

    40% {
        transform: scale(1.2);
        opacity: 1;
    }
}

@media (max-width: 480px) {
    #ai-sales-agent-widget {
        bottom: 20px;
        right: 20px;
    }

    .ai-sales-agent-container {
        width: calc(100vw - 40px);
        height: calc(100dvh - 120px);
        max-height: calc(100dvh - 120px);
        bottom: 80px;
    }
}

/* Onboarding Form Styles */
.ai-sales-agent-onboarding {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
    background: rgba(250, 250, 250, 0.5);
}

.ai-onboarding-content {
    background: white;
    padding: 30px;
    border-radius: var(--ai-radius-sm);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
    width: 100%;
    text-align: center;
    border: 1px solid var(--ai-border-light);
}

.ai-onboarding-content h4 {
    margin: 0 0 10px 0;
    font-size: 22px;
    font-weight: 600;
    color: var(--ai-text-main);
}

.ai-onboarding-content p {
    margin: 0 0 20px 0;
    font-size: 14px;
    color: var(--ai-text-muted);
}

.ai-form-group {
    margin-bottom: 20px;
}

.ai-form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--ai-border-light);
    border-radius: 12px;
    font-family: inherit;
    font-size: 16px;
    outline: none;
    transition: all 0.3s ease;
    background: #f4f4f5;
    text-align: center;
}

.ai-form-group input:focus {
    border-color: var(--ai-primary);
    background: white;
    box-shadow: 0 0 0 3px rgba(9, 9, 11, 0.1);
}

.ai-sales-agent-start-btn {
    background: var(--ai-primary);
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 15px;
    font-weight: 500;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    box-shadow: var(--ai-shadow-soft);
}

.ai-sales-agent-start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px -5px rgba(9, 9, 11, 0.2);
    background: #27272a;
}

.ai-form-error {
    color: #ef4444;
    font-size: 13px;
    margin: -10px 0 16px;
}

.ai-message-ai a {
    color: var(--ai-primary);
    text-decoration: underline;
    text-underline-offset: 2px;
    word-break: break-all;
}

.ai-message-ai a:hover {
    opacity: 0.7;
}