/* ═══════════════════════════════════════════
   ENTELA AI — Floating Chat Widget
   Ngjyra: Purple (#2B3FEA) — përshtatur me portfolio-n

   Shto në çdo faqe PËRVEÇ entela-ai.html:
   <link rel="stylesheet" href="chat-widget.css">
   <script src="chat-widget.js"></script>
   ═══════════════════════════════════════════ */

.eai-widget-btn {
    position: fixed;
    bottom: 22px;
    right: 22px;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2B3FEA 0%, #8DA0FF 100%);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 28px rgba(43, 63, 234, 0.35);
    transition: all 0.3s ease;
    z-index: 9999;
    font-size: 24px;
    color: #fff;
    line-height: 1;
}

.eai-widget-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 8px 32px rgba(43, 63, 234, 0.45);
}

.eai-widget-btn.open {
    transform: rotate(45deg) scale(0.9);
}

.eai-widget-btn .eai-pulse {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid #2B3FEA;
    animation: eaiPulse 2s ease-out infinite;
    pointer-events: none;
}

.eai-widget-btn.open .eai-pulse { display: none; }

/* ─── CHAT WINDOW ─── */

.eai-chat {
    position: fixed;
    bottom: 90px;
    right: 22px;
    width: 365px;
    max-width: calc(100vw - 28px);
    height: 490px;
    max-height: calc(100vh - 120px);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 16px 56px rgba(43, 63, 234, 0.14), 0 0 0 1px rgba(43, 63, 234, 0.06);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 9998;
    animation: eaiSlide 0.3s ease;
    font-family: 'DM Sans', 'Inter', system-ui, sans-serif;
}

.eai-chat.visible { display: flex; }

/* ─── HEADER ─── */

.eai-chat-header {
    background: linear-gradient(135deg, #2B3FEA 0%, #8DA0FF 100%);
    padding: 14px 16px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.eai-chat-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 800;
}

.eai-chat-header-info { flex: 1; }
.eai-chat-header-title { font-weight: 700; font-size: 14.5px; }
.eai-chat-header-sub { font-size: 11px; opacity: 0.8; }

.eai-chat-close {
    background: rgba(255, 255, 255, 0.18);
    border: none;
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 7px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.eai-chat-close:hover { background: rgba(255, 255, 255, 0.28); }

/* ─── MESSAGES ─── */

.eai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px 12px 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #fafafe;
}

.eai-msg {
    display: flex;
    animation: eaiMsg 0.25s ease;
}

.eai-msg.user { justify-content: flex-end; }
.eai-msg.assistant { justify-content: flex-start; }

.eai-msg-bubble {
    max-width: 82%;
    padding: 10px 14px;
    font-size: 13.5px;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
}

.eai-msg-bubble.user {
    border-radius: 14px 14px 3px 14px;
    background: linear-gradient(135deg, #2B3FEA 0%, #8DA0FF 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(43, 63, 234, 0.15);
}

.eai-msg-bubble.assistant {
    border-radius: 14px 14px 14px 3px;
    background: #fff;
    color: #1a1a2e;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.05);
}

/* ─── QUICK QUESTIONS ─── */

.eai-welcome-box {
    background: linear-gradient(135deg, rgba(43, 63, 234, 0.06), rgba(141, 160, 255, 0.06));
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 6px;
    border: 1px solid rgba(43, 63, 234, 0.08);
}

.eai-welcome-title {
    font-size: 15px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 6px;
}

.eai-welcome-text {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
}

.eai-quick-label {
    font-size: 11px;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 8px 0 4px;
}

.eai-header-status {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
    margin-right: 8px;
}

.eai-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #00B894;
    box-shadow: 0 0 6px rgba(0, 184, 148, 0.5);
}

.eai-quick-questions {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 2px;
}

.eai-quick-btn {
    padding: 9px 13px;
    border-radius: 10px;
    border: 1.5px solid rgba(43, 63, 234, 0.12);
    background: #fff;
    color: #2B3FEA;
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 8px;
}

.eai-quick-icon {
    font-size: 8px;
    color: #8DA0FF;
    flex-shrink: 0;
}

.eai-quick-btn:hover {
    background: rgba(43, 63, 234, 0.05);
    border-color: rgba(43, 63, 234, 0.25);
    transform: translateX(4px);
}

/* ─── TYPING ─── */

.eai-typing {
    display: none;
    justify-content: flex-start;
}

.eai-typing.visible { display: flex; }

.eai-typing-bubble {
    background: #fff;
    padding: 11px 16px;
    border-radius: 14px 14px 14px 3px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.05);
    display: flex;
    gap: 5px;
    align-items: center;
}

.eai-typing-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2B3FEA 0%, #8DA0FF 100%);
    display: inline-block;
}

.eai-typing-dot:nth-child(1) { animation: eaiDot 1.2s ease-in-out 0s infinite; }
.eai-typing-dot:nth-child(2) { animation: eaiDot 1.2s ease-in-out 0.15s infinite; }
.eai-typing-dot:nth-child(3) { animation: eaiDot 1.2s ease-in-out 0.3s infinite; }

/* ─── INPUT ─── */

.eai-chat-input-area {
    padding: 10px 12px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    background: #fff;
    display: flex;
    gap: 7px;
    align-items: flex-end;
    flex-shrink: 0;
}

.eai-chat-textarea {
    flex: 1;
    border: 1.5px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    padding: 9px 12px;
    font-size: 13.5px;
    font-family: inherit;
    resize: none;
    outline: none;
    background: #fafafe;
    color: #1a1a2e;
    line-height: 1.4;
    max-height: 76px;
    transition: border-color 0.2s;
}

.eai-chat-textarea::placeholder { color: #aaa; }
.eai-chat-textarea:focus { border-color: rgba(43, 63, 234, 0.4); }

.eai-chat-send {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: none;
    background: #ddd;
    color: #fff;
    font-size: 17px;
    cursor: default;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.eai-chat-send.active {
    background: linear-gradient(135deg, #2B3FEA 0%, #8DA0FF 100%);
    cursor: pointer;
    box-shadow: 0 3px 12px rgba(43, 63, 234, 0.25);
}

/* ─── FULL PAGE LINK ─── */

.eai-full-link {
    text-align: center;
    padding: 7px;
    border-top: 1px solid rgba(0, 0, 0, 0.04);
    background: #fff;
    flex-shrink: 0;
}

.eai-full-link a {
    font-size: 11.5px;
    color: #2B3FEA;
    text-decoration: none;
    font-weight: 600;
    transition: opacity 0.2s;
}

.eai-full-link a:hover { opacity: 0.7; }

/* ─── SCROLLBAR ─── */

.eai-chat-messages::-webkit-scrollbar { width: 3px; }
.eai-chat-messages::-webkit-scrollbar-track { background: transparent; }
.eai-chat-messages::-webkit-scrollbar-thumb { background: rgba(43, 63, 234, 0.12); border-radius: 10px; }

/* ─── ANIMATIONS ─── */

@keyframes eaiSlide { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes eaiMsg { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@keyframes eaiDot { 0%, 80%, 100% { transform: translateY(0); opacity: 0.3; } 40% { transform: translateY(-5px); opacity: 1; } }
@keyframes eaiPulse { 0% { transform: scale(1); opacity: 1; } 100% { transform: scale(1.5); opacity: 0; } }

/* ─── RESPONSIVE ─── */

@media (max-width: 480px) {
    .eai-chat {
        bottom: 0; right: 0;
        width: 100vw; max-width: 100vw;
        height: 100vh; max-height: 100vh;
        border-radius: 0;
    }
    .eai-widget-btn { bottom: 16px; right: 16px; }
}

@media (prefers-reduced-motion: reduce) {
    .eai-chat, .eai-msg { animation: none; }
    .eai-typing-dot { animation: none; opacity: 0.5; }
    .eai-widget-btn .eai-pulse { animation: none; display: none; }
}