.ea-ai {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 99999;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.ea-wrap {
    position: relative;
    width: 42px;
    height: 42px;
    cursor: pointer;
}

/* Circular FAB Trigger */
.ea-btn-trigger {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6c5ce7, #4f46e5);
    box-shadow: 0 4px 16px rgba(79, 70, 229, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    color: #ffffff;
    border: 1.5px solid rgba(255, 255, 255, 0.25);
}

.ea-wrap:hover .ea-btn-trigger {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.45);
}

.ea-btn-trigger svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
}

/* Pulsing Badge Dot */
.ea-badge-dot {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 10px;
    height: 10px;
    background: #10b981;
    border-radius: 50%;
    border: 1.5px solid #ffffff;
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
    animation: ea-pulse 1.8s infinite;
}

.ea-bubble {
    position: absolute;
    right: 50px;
    bottom: 2px;
    width: 155px;
    padding: 7px 10px;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.12);
    color: #0f172a;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.35;
    opacity: 0;
    transform: translateY(8px) scale(0.92);
    animation: ea-show 0.8s 1s forwards;
    pointer-events: none;
    border: 1px solid rgba(226, 232, 240, 0.9);
}

.ea-bubble:after {
    content: "";
    position: absolute;
    right: -6px;
    bottom: 12px;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-left: 6px solid #ffffff;
}

.ea-bubble-hidden {
    opacity: 0 !important;
    transform: translateY(6px) scale(0.9) !important;
    transition: opacity 0.35s ease, transform 0.35s ease;
    pointer-events: none;
}

/* Chat Feed Window */
.ea-chat {
    position: fixed;
    right: 20px;
    bottom: 74px;
    width: 310px;
    height: 410px;
    max-height: calc(100vh - 100px);
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 12px 36px rgba(15, 23, 42, 0.2);
    overflow: hidden;
    opacity: 0;
    transform: translateY(12px) scale(0.95);
    pointer-events: none;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    border: 1px solid rgba(226, 232, 240, 0.85);
}

.ea-chat.open {
    opacity: 1;
    transform: none;
    pointer-events: auto;
}

/* Top Header Bar */
.ea-headbar {
    flex: 0 0 auto;
    height: 48px;
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    color: #ffffff;
    display: flex;
    align-items: center;
    padding: 0 12px;
    box-sizing: border-box;
    gap: 7px;
}

.ea-icon {
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.18);
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 15px;
    flex-shrink: 0;
}

.ea-title {
    font-weight: 700;
    font-size: 12.5px;
    letter-spacing: -0.01em;
    line-height: 1.15;
}

.ea-status {
    font-size: 9.5px;
    opacity: 0.9;
    margin-top: 1px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.ea-status-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #10b981;
    display: inline-block;
}

.ea-head-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 11px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.ea-head-btn:hover {
    background: rgba(255, 255, 255, 0.28);
    transform: scale(1.05);
}

/* Chat Messages Container */
.ea-messages {
    flex: 1 1 auto;
    min-height: 0;
    padding: 10px 12px;
    overflow-y: auto;
    background: #f8fafc;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.ea-msg {
    max-width: 90%;
    padding: 8px 11px;
    border-radius: 11px;
    font-size: 12px;
    line-height: 1.45;
    word-break: break-word;
}

.ea-botmsg {
    background: #ffffff;
    color: #1e293b;
    align-self: flex-start;
    border-bottom-left-radius: 3px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
}

.ea-usermsg {
    align-self: flex-end;
    background: linear-gradient(135deg, #4f46e5, #4338ca);
    color: #ffffff;
    border-bottom-right-radius: 3px;
    box-shadow: 0 2px 6px rgba(79, 70, 229, 0.22);
}

/* Markdown Elements inside Chat */
.ea-botmsg strong {
    color: #0f172a;
    font-weight: 700;
}

.ea-botmsg .ea-heading {
    font-size: 12.5px;
    font-weight: 800;
    color: #4f46e5;
    margin: 3px 0 2px;
}

.ea-botmsg .ea-list {
    margin: 3px 0;
    padding-left: 14px;
}

.ea-botmsg .ea-list li {
    margin-bottom: 2px;
}

.ea-botmsg .ea-inline-code {
    background: #f1f5f9;
    color: #e11d48;
    padding: 1px 4px;
    border-radius: 3px;
    font-family: monospace;
    font-size: 11px;
    border: 1px solid #e2e8f0;
}

.ea-botmsg .ea-link {
    color: #4f46e5;
    text-decoration: underline;
    font-weight: 600;
}

/* Code Block Card */
.ea-code-card {
    margin: 5px 0;
    background: #0f172a;
    border-radius: 7px;
    overflow: hidden;
    border: 1px solid #334155;
}

.ea-code-header {
    background: #1e293b;
    padding: 3px 7px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: monospace;
    font-size: 9.5px;
    color: #94a3b8;
    text-transform: uppercase;
}

.ea-copy-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #cbd5e1;
    font-size: 9.5px;
    padding: 1px 5px;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.ea-copy-btn:hover {
    background: #4f46e5;
    color: #fff;
}

.ea-code-body {
    margin: 0;
    padding: 6px 8px;
    overflow-x: auto;
    font-family: monospace;
    font-size: 10.5px;
    color: #f8fafc;
    line-height: 1.35;
}

/* Quick Action Chips */
.ea-quick-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 2px;
}

.ea-chip {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #334155;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 10.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.ea-chip:hover {
    background: #eef2ff;
    border-color: #4f46e5;
    color: #4f46e5;
    transform: translateY(-1px);
}

/* Typing Dots Animation */
.ea-typing-box {
    padding: 6px 10px;
    width: fit-content;
}

.ea-typing-dots {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 12px;
}

.ea-typing-dots span {
    width: 5px;
    height: 5px;
    background: #94a3b8;
    border-radius: 50%;
    animation: ea-typing-bounce 1.3s infinite ease-in-out;
}

.ea-typing-dots span:nth-child(1) { animation-delay: 0s; }
.ea-typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.ea-typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes ea-typing-bounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1.1); opacity: 1; background: #4f46e5; }
}

/* Input Row */
.ea-input {
    flex: 0 0 auto;
    height: 44px;
    display: flex;
    align-items: center;
    padding: 4px 8px;
    border-top: 1px solid #e2e8f0;
    box-sizing: border-box;
    background: #ffffff;
    gap: 5px;
}

.ea-input input {
    flex: 1;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    outline: none;
    padding: 5px 10px;
    font-family: inherit;
    font-size: 11.5px;
    min-width: 0;
    background: #f8fafc;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.ea-input input:focus {
    border-color: #4f46e5;
    background: #ffffff;
}

.ea-input button {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    border: 0;
    border-radius: 50%;
    background: #4f46e5;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.ea-input button:hover {
    background: #4338ca;
    transform: scale(1.05);
}

@keyframes ea-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.8; }
}

@keyframes ea-show {
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Compact Mobile Viewport - Reduces chat popup size */
@media (max-width: 600px) {
    .ea-ai {
        right: 12px;
        bottom: 12px;
    }
    .ea-wrap {
        width: 38px;
        height: 38px;
    }
    .ea-btn-trigger {
        width: 38px;
        height: 38px;
    }
    .ea-btn-trigger svg {
        width: 18px;
        height: 18px;
    }
    .ea-bubble {
        right: 46px;
        width: 125px;
        font-size: 10px;
        padding: 5px 8px;
    }
    .ea-chat {
        top: auto;
        bottom: 60px;
        left: auto;
        right: 12px;
        width: calc(100vw - 24px);
        max-width: 290px;
        height: 340px;
        max-height: 52vh;
        border-radius: 12px;
        box-shadow: 0 8px 28px rgba(15, 23, 42, 0.22);
    }
    .ea-headbar {
        height: 42px;
        padding: 0 10px;
    }
    .ea-icon {
        width: 24px;
        height: 24px;
        font-size: 13px;
    }
    .ea-title {
        font-size: 11.5px;
    }
    .ea-status {
        font-size: 8.5px;
    }
    .ea-head-btn {
        width: 22px;
        height: 22px;
        font-size: 10px;
    }
    .ea-messages {
        padding: 8px 10px;
        gap: 6px;
    }
    .ea-msg {
        max-width: 92%;
        padding: 6px 9px;
        font-size: 11px;
        line-height: 1.4;
    }
    .ea-chip {
        font-size: 9.5px;
        padding: 2.5px 6.5px;
    }
    .ea-input {
        height: 40px;
        padding: 3px 6px;
    }
    .ea-input input {
        font-size: 10.5px;
        padding: 4px 8px;
    }
    .ea-input button {
        width: 26px;
        height: 26px;
    }
}

.ea-ai.ea-open .ea-wrap,
.ea-ai.ea-open .ea-bubble {
    display: none;
}

