/* EzzyFinda — styles for views/components/chat-popup.blade.php (moved from inline <style>) */

/* ── Chat widget base ────────────────────────────────────────────── */
#efChat {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    font-family: 'Jost', sans-serif;
}

/* ── FAB button ──────────────────────────────────────────────────── */
#efChatFab {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0D3B8C, #1A55CC);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 24px rgba(13,59,140,.38);
    transition: transform .2s, box-shadow .2s;
    position: relative;
    overflow: visible;
}

#efChatFab:hover {
    transform: scale(1.07);
    box-shadow: 0 10px 32px rgba(13,59,140,.48);
}

#efChatFab .fab-icon { transition: opacity .2s, transform .2s; }

#efChatFab .fab-close {
    position: absolute;
    opacity: 0;
    transform: rotate(-90deg) scale(.7);
    transition: opacity .2s, transform .2s;
}

#efChat.open #efChatFab .fab-icon {
    opacity: 0; transform: rotate(90deg) scale(.7);
}

#efChat.open #efChatFab .fab-close {
    opacity: 1; transform: rotate(0) scale(1);
}

/* Pulse ring on FAB */
#efChatFab::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: rgba(13,59,140,.25);
    animation: chatPulse 2.5s ease-out infinite;
}

#efChat.open #efChatFab::before { animation: none; opacity: 0; }

@keyframes chatPulse {
    0%   { transform: scale(1);   opacity: .8; }
    70%  { transform: scale(1.4); opacity: 0; }
    100% { transform: scale(1.4); opacity: 0; }
}

/* Notification badge */
#efChatBadge {
    position: absolute;
    top: -3px;
    right: -3px;
    width: 18px;
    height: 18px;
    background: #F26722;
    border-radius: 50%;
    border: 2px solid #fff;
    font-size: .6rem;
    font-weight: 800;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity .2s, transform .2s;
}

#efChat.open #efChatBadge { opacity: 0; transform: scale(0); }

/* ── Chat window ─────────────────────────────────────────────────── */
#efChatWindow {
    position: absolute;
    bottom: 72px;
    right: 0;
    width: 360px;
    max-height: 560px;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 20px 60px rgba(0,0,0,.18), 0 4px 16px rgba(0,0,0,.08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(12px) scale(.97);
    pointer-events: none;
    transition: opacity .22s cubic-bezier(.4,0,.2,1),
                transform .22s cubic-bezier(.4,0,.2,1);
}

#efChat.open #efChatWindow {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* ── Header ──────────────────────────────────────────────────────── */
#efChatHeader {
    background: linear-gradient(135deg, #071E8C 0%, #0D3B8C 60%, #1A55CC 100%);
    padding: 1rem 1.125rem .875rem;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

#efChatHeader::after {
    content: '';
    position: absolute;
    top: -30px; right: -30px;
    width: 120px; height: 120px;
    border-radius: 50%;
    background: rgba(255,255,255,.06);
    pointer-events: none;
}

.ef-chat-avatar {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,.18);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}

.ef-chat-status {
    display: flex; align-items: center; gap: 5px;
    font-size: .72rem; color: rgba(255,255,255,.7);
    margin-top: 1px;
}

.ef-chat-status-dot {
    width: 7px; height: 7px;
    background: #34D399; border-radius: 50%;
    animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {
    0%,100% { opacity: 1; }
    50%      { opacity: .4; }
}

/* ── Suggested questions ─────────────────────────────────────────── */
#efChatSuggestions {
    padding: .875rem 1rem .5rem;
    flex-shrink: 0;
    border-bottom: 1px solid #F1F5F9;
}

.ef-suggest-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: .3rem .75rem;
    background: #F8FAFC;
    border: 1.5px solid #E2E8F0;
    border-radius: 99px;
    font-size: .75rem;
    font-weight: 600;
    color: #334155;
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
    margin: 0 4px 4px 0;
    font-family: 'Jost', sans-serif;
}

.ef-suggest-chip:hover {
    background: var(--ef-blue);
    border-color: var(--ef-blue);
    color: #fff;
}

/* ── Messages ────────────────────────────────────────────────────── */
#efChatMessages {
    flex-grow: 1;
    overflow-y: auto;
    padding: .875rem 1rem;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: #E2E8F0 transparent;
    display: flex;
    flex-direction: column;
    gap: .625rem;
}

.ef-msg {
    display: flex;
    gap: 8px;
    max-width: 100%;
    animation: msgIn .2s ease;
}

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

.ef-msg.user { flex-direction: row-reverse; }

.ef-msg-avatar {
    width: 28px; height: 28px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--ef-blue-pale);
    display: flex; align-items: center; justify-content: center;
    font-size: .7rem;
    font-weight: 800;
    color: var(--ef-blue);
    margin-top: 2px;
}

.ef-msg.user .ef-msg-avatar {
    background: var(--ef-orange);
    color: #fff;
}

.ef-msg-bubble {
    max-width: 78%;
    padding: .6rem .875rem;
    border-radius: 16px;
    font-size: .85rem;
    line-height: 1.55;
    word-break: break-word;
}

.ef-msg.bot .ef-msg-bubble {
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    color: #1E293B;
    border-bottom-left-radius: 4px;
}

.ef-msg.user .ef-msg-bubble {
    background: var(--ef-blue);
    color: #fff;
    border-bottom-right-radius: 4px;
}

/* Typing indicator */
.ef-typing-dot {
    display: inline-flex;
    gap: 4px;
    align-items: center;
    padding: .5rem .75rem;
}

.ef-typing-dot span {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: #94A3B8;
    animation: typingBounce 1.2s infinite;
}

.ef-typing-dot span:nth-child(2) { animation-delay: .2s; }

.ef-typing-dot span:nth-child(3) { animation-delay: .4s; }

@keyframes typingBounce {
    0%,80%,100% { transform: translateY(0); }
    40%          { transform: translateY(-6px); background: var(--ef-blue); }
}

/* Link inside bot messages */
.ef-msg.bot .ef-msg-bubble a {
    color: var(--ef-blue);
    font-weight: 600;
    text-decoration: underline;
}

/* ── Input bar ───────────────────────────────────────────────────── */
#efChatInputBar {
    padding: .75rem 1rem;
    border-top: 1px solid #F1F5F9;
    display: flex;
    gap: 8px;
    align-items: flex-end;
    background: #fff;
    flex-shrink: 0;
}

#efChatInput {
    flex-grow: 1;
    border: 1.5px solid #E2E8F0;
    border-radius: 12px;
    padding: .55rem .875rem;
    font-family: 'Jost', sans-serif;
    font-size: .875rem;
    color: #1E293B;
    resize: none;
    outline: none;
    max-height: 100px;
    overflow-y: auto;
    line-height: 1.5;
    transition: border-color .15s;
    background: #F8FAFC;
}

#efChatInput:focus { border-color: var(--ef-blue); background: #fff; }

#efChatInput::placeholder { color: #94A3B8; }

#efChatSendBtn {
    width: 38px; height: 38px;
    border-radius: 10px;
    background: var(--ef-blue);
    border: none;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    transition: background .15s, transform .1s;
}

#efChatSendBtn:hover { background: #0a2f72; }

#efChatSendBtn:active { transform: scale(.93); }

#efChatSendBtn:disabled { opacity: .45; cursor: not-allowed; }

/* ── Footer branding ─────────────────────────────────────────────── */
#efChatFooter {
    padding: .35rem 1rem;
    text-align: center;
    font-size: .65rem;
    color: #CBD5E1;
    border-top: 1px solid #F8FAFC;
    flex-shrink: 0;
    background: #fff;
}

/* ── Mobile adjustments ──────────────────────────────────────────── */
@media (max-width: 480px) {
    #efChatWindow { width: calc(100vw - 24px); right: 0; left: 0; margin: 0 12px; }
    #efChat { right: 12px; bottom: 16px; }
}

.efChatWindow a{
    color:var(--ef-blue);
    font-weight:600;
    text-decoration:underline;
}
