/* Evoastra AI Assistant - Premium Modern UI/UX (2024 Design Standard) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --e-primary: #0066FF;
    --e-primary-dark: #0052CC;
    --e-accent: #66AAFF;
    --e-bg-light: #F8FAFC;
    --e-text-dark: #0F172A;
    --e-text-gray: #475569;
    --e-text-light: #94A3B8;
    --e-white: #FFFFFF;
    --e-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    --e-shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.15);
    --e-radius-full: 9999px;
    --e-radius-xl: 24px;
    --e-radius-lg: 16px;
    --e-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#evoastra-ai-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999999;
    font-family: 'Inter', sans-serif;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

/* Floating Launcher */
.evoastra-ai-icon {
    width: 60px;
    height: 60px;
    background: var(--e-primary);
    border-radius: var(--e-radius-full);
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 102, 255, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--e-white);
    transition: var(--e-transition);
    position: relative;
    z-index: 100;
}

.evoastra-ai-icon:hover {
    transform: scale(1.08) rotate(5deg);
    background: var(--e-primary-dark);
}

.evoastra-ai-icon svg {
    width: 28px;
    height: 28px;
}

.evoastra-ai-notification-dot {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    background: #FF4D4D;
    border: 2px solid var(--e-white);
    border-radius: 50%;
}

/* Chat Window */
.evoastra-ai-chatbox {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    max-width: 90vw;
    height: 600px;
    max-height: 80vh;
    background: var(--e-white);
    border-radius: var(--e-radius-xl);
    box-shadow: var(--e-shadow-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: var(--e-transition);
    transform-origin: bottom right;
}

.evoastra-ai-chatbox.evoastra-ai-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Header */
.evoastra-ai-header {
    padding: 20px 24px;
    background: var(--e-primary);
    color: var(--e-white);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.evoastra-ai-avatar {
    position: relative;
    width: 40px;
    height: 40px;
}

.evoastra-ai-avatar-circle {
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--e-white);
}

.evoastra-ai-avatar-circle svg {
    width: 20px;
    height: 20px;
}

.evoastra-ai-online-dot {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    background: #4ADE80;
    border: 2px solid var(--e-primary);
    border-radius: 50%;
}

.evoastra-ai-header-text {
    display: flex;
    flex-direction: column;
}

.evoastra-ai-name {
    font-weight: 600;
    font-size: 15px;
}

.evoastra-ai-status {
    font-size: 11px;
    opacity: 0.8;
}

.evoastra-ai-header-actions {
    display: flex;
    gap: 8px;
}

.evoastra-ai-header-actions button {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    color: var(--e-white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--e-transition);
}

.evoastra-ai-header-actions button:hover {
    background: rgba(255, 255, 255, 0.2);
}

.evoastra-ai-header-actions svg {
    width: 16px;
    height: 16px;
}

/* Body */
.evoastra-ai-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--e-bg-light);
    overflow: hidden;
    position: relative;
}

.evoastra-ai-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scrollbar-width: thin;
    overscroll-behavior: contain;
}

/* Welcome Card */
.evoastra-ai-welcome-card {
    background: var(--e-white);
    padding: 24px;
    border-radius: var(--e-radius-lg);
    text-align: center;
    box-shadow: var(--e-shadow);
    margin-bottom: 20px;
}

.evoastra-ai-welcome-logo {
    width: 48px;
    height: 48px;
    background: var(--e-primary);
    color: white;
    border-radius: 12px;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.evoastra-ai-welcome-logo svg {
    width: 24px;
    height: 24px;
}

.evoastra-ai-welcome-card h3 {
    margin: 0 0 8px;
    font-size: 18px;
    color: var(--e-text-dark);
}

.evoastra-ai-welcome-card p {
    margin: 0;
    font-size: 14px;
    color: var(--e-text-gray);
    line-height: 1.5;
}

/* Bubbles */
.evoastra-ai-message {
    max-width: 90%;
    padding: 12px 16px;
    font-size: 14px;
    line-height: 1.5;
    animation: fadeIn 0.3s ease;
}

.evoastra-ai-message-content p {
    margin: 0 0 10px 0;
}

.evoastra-ai-message-content p:last-child {
    margin: 0;
}

.evoastra-ai-message-content h1,
.evoastra-ai-message-content h2,
.evoastra-ai-message-content h3 {
    margin: 12px 0 8px 0;
    font-size: 15px;
    font-weight: 600;
}

.evoastra-ai-message-content ul,
.evoastra-ai-message-content ol {
    margin: 8px 0;
    padding-left: 20px;
}

.evoastra-ai-message-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
    font-size: 12px;
}

.evoastra-ai-message-content th,
.evoastra-ai-message-content td {
    border: 1px solid #E2E8F0;
    padding: 6px 8px;
    text-align: left;
}

.evoastra-ai-message-content th {
    background-color: #F8FAFC;
    font-weight: 600;
}

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

.evoastra-ai-message-bot {
    align-self: flex-start;
    background: var(--e-white);
    color: var(--e-text-dark);
    border-radius: 18px 18px 18px 4px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}

.evoastra-ai-message-user {
    align-self: flex-end;
    background: var(--e-primary);
    color: var(--e-white);
    border-radius: 18px 18px 4px 18px;
}

/* Quick Replies */
.evoastra-ai-quick-replies-wrap {
    padding: 10px 20px;
    background: var(--e-bg-light);
}

.evoastra-ai-quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.evoastra-ai-quick-btn {
    background: var(--e-white);
    border: 1px solid var(--e-primary);
    color: var(--e-primary);
    padding: 6px 14px;
    border-radius: var(--e-radius-full);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--e-transition);
}

.evoastra-ai-quick-btn:hover {
    background: var(--e-primary);
    color: var(--e-white);
}

/* Footer & Input */
.evoastra-ai-footer {
    padding: 16px 20px;
    background: var(--e-white);
    border-top: 1px solid #EEF2F6;
}

.evoastra-ai-input-wrap {
    display: flex;
    align-items: center;
    background: #F1F5F9;
    padding: 4px 6px 4px 16px;
    border-radius: var(--e-radius-lg);
    gap: 8px;
}

.evoastra-ai-input-wrap input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 10px 0;
    font-size: 14px;
    outline: none;
    color: var(--e-text-dark);
}

.evoastra-ai-send {
    width: 36px;
    height: 36px;
    background: var(--e-primary);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--e-transition);
}

.evoastra-ai-send:hover {
    background: var(--e-primary-dark);
    transform: scale(1.05);
}

.evoastra-ai-send svg {
    width: 18px;
    height: 18px;
}

.evoastra-ai-credit {
    margin-top: 10px;
    font-size: 10px;
    color: var(--e-text-light);
    text-align: center;
}

.evoastra-ai-credit a {
    color: var(--e-primary);
    text-decoration: none;
    font-weight: 600;
}

/* Lead Form */
.evoastra-ai-lead-form {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    background: var(--e-bg-light);
    z-index: 10;
}

.evoastra-ai-form-container {
    background: var(--e-white);
    padding: 20px;
    border-radius: var(--e-radius-lg);
    box-shadow: var(--e-shadow);
}

.evoastra-ai-form-container h4 {
    margin: 0 0 16px;
    font-size: 16px;
    color: var(--e-text-dark);
}

.evoastra-ai-form-container form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.evoastra-ai-form-container input {
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px;
    outline: none;
}

.evoastra-ai-form-container button {
    background: var(--e-primary);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

/* Typing Indicator */
#evoastra-ai-typing {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    width: fit-content;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: var(--e-text-light);
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1.0); }
}

/* Mobile */
@media (max-width: 480px) {
    .evoastra-ai-chatbox {
        bottom: 0;
        right: 0;
        width: 100vw;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }
}
