/* ========================================
   ELEET - Floating AI Chatbot Widget
   Isolated · Namespaced · Zero conflicts
   ======================================== */

/* ── Container ── */
.ctf-chat-wrap {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    font-family: var(--font, 'Outfit', sans-serif);
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    pointer-events: none;
}

/* ── Floating Mascot Button ── */
.ctf-chat-fab {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    border: none;
    background: transparent;
    cursor: pointer;
    pointer-events: auto;
    outline: none;
    padding: 0;
    position: relative;
    overflow: visible;
    animation: ctfFabFloat 4s ease-in-out infinite;
    transition: transform 0.3s cubic-bezier(0.16,1,0.3,1),
                box-shadow 0.3s ease,
                border-color 0.3s ease;
}

.ctf-chat-fab img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.ctf-chat-fab:hover {
    transform: scale(1.06);
    filter: drop-shadow(0 4px 16px rgba(50,140,193,0.35));
}

.ctf-chat-fab:active {
    transform: scale(0.94);
}

/* Glow ring behind fab */
.ctf-chat-fab::before {
    content: '';
    position: absolute;
    inset: -10px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(50,140,193,0.15) 0%, transparent 70%);
    animation: ctfGlow 3.5s ease-in-out infinite;
    z-index: -1;
}

@keyframes ctfFabFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

@keyframes ctfGlow {
    0%, 100% { opacity: 0.4; transform: scale(1); }
    50% { opacity: 0.9; transform: scale(1.15); }
}

/* ── Chat Panel ── */
.ctf-chat-panel {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 400px;
    height: 600px;
    max-height: 80vh;
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    overflow: hidden;

    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);

    transform-origin: bottom right;
    transform: scale(0.9) translateY(12px);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.3s cubic-bezier(0.16,1,0.3,1),
                opacity 0.25s ease-out,
                visibility 0.25s;
}

.ctf-chat-panel.ctf-open {
    transform: scale(1) translateY(0);
    opacity: 1;
    visibility: visible;
}

/* ── Header ── */
.ctf-chat-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
    background: transparent;
}

.ctf-chat-header img {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    object-fit: contain;
    flex-shrink: 0;
}

.ctf-chat-header-info {
    flex: 1;
    min-width: 0;
}

.ctf-chat-header-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: #f1f5f9;
    letter-spacing: 0.3px;
}

.ctf-chat-header-status {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 2px;
    font-size: 0.7rem;
    font-weight: 500;
    color: #4ADE80;
}

.ctf-chat-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #4ADE80;
    box-shadow: 0 0 6px rgba(74,222,128,0.5);
    animation: ctfPulse 2s ease-in-out infinite;
}

@keyframes ctfPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}

.ctf-chat-close {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: rgba(255,255,255,0.4);
    font-size: 1.1rem;
    cursor: pointer;
    border-radius: 8px;
    transition: color 0.2s, background 0.2s;
}

.ctf-chat-close:hover {
    color: #f1f5f9;
    background: rgba(255,255,255,0.06);
}

/* ── Messages ── */
.ctf-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ctf-chat-messages::-webkit-scrollbar { width: 4px; }
.ctf-chat-messages::-webkit-scrollbar-track { background: transparent; }
.ctf-chat-messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.06); border-radius: 4px; }

.ctf-chat-bubble {
    max-width: 84%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 0.82rem;
    line-height: 1.65;
    letter-spacing: 0.15px;
    animation: ctfMsgIn 0.25s ease-out;
}

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

.ctf-chat-bubble-user {
    align-self: flex-end;
    background: #328CC1;
    color: #fff;
    font-weight: 400;
    border-bottom-right-radius: 4px;
    box-shadow: 0 2px 12px rgba(50,140,193,0.2);
}

.ctf-chat-bubble-bot {
    align-self: flex-start;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.7);
    font-weight: 300;
    border-bottom-left-radius: 4px;
}

/* ── Suggestions ── */
.ctf-chat-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 16px 12px;
}

.ctf-chat-suggestions.ctf-hidden {
    display: none;
}

.ctf-chat-chip {
    padding: 7px 12px;
    font-size: 0.75rem;
    font-weight: 400;
    font-family: inherit;
    color: rgba(255,255,255,0.6);
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s, background 0.2s;
    letter-spacing: 0.15px;
}

.ctf-chat-chip:hover {
    border-color: rgba(50,140,193,0.35);
    color: #4DA3D4;
    background: rgba(50,140,193,0.06);
}

/* ── Typing ── */
.ctf-chat-typing {
    display: none;
    align-items: center;
    gap: 5px;
    padding: 0 16px 10px;
}

.ctf-chat-typing.ctf-visible {
    display: flex;
}

.ctf-chat-typing-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #328CC1;
    box-shadow: 0 0 8px rgba(50,140,193,0.4);
    animation: ctfTypeDot 1.4s infinite ease-in-out;
}

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

@keyframes ctfTypeDot {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.35; }
    30% { transform: translateY(-5px); opacity: 1; }
}

/* ── Input Bar ── */
.ctf-chat-inputbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
    background: transparent;
}

.ctf-chat-input {
    flex: 1;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 12px;
    padding: 10px 14px;
    color: #f1f5f9;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 300;
    letter-spacing: 0.15px;
    outline: none;
    transition: border-color 0.2s;
}

.ctf-chat-input::placeholder {
    color: rgba(255,255,255,0.35);
}

.ctf-chat-input:focus {
    border-color: rgba(50,140,193,0.4);
}

.ctf-chat-btn {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: rgba(255,255,255,0.4);
    cursor: pointer;
    border-radius: 8px;
    transition: color 0.2s, background 0.2s;
    font-size: 1.1rem;
}

.ctf-chat-btn:hover {
    color: #4DA3D4;
    background: rgba(50,140,193,0.08);
}

.ctf-chat-btn:disabled {
    opacity: 0.25;
    cursor: default;
}
.ctf-chat-btn:disabled:hover {
    color: rgba(255,255,255,0.4);
    background: none;
}

/* ── Responsive ── */
@media (max-width: 480px) {
    .ctf-chat-panel {
        width: min(92vw, 360px);
        right: 0;
        bottom: 74px;
        height: min(70vh, 520px);
    }
    .ctf-chat-fab {
        width: 58px;
        height: 58px;
    }
    .ctf-chat-wrap {
        bottom: 14px;
        right: 14px;
    }
}
