/* ─── AI Chat Widget Styles ────────────────────────────────── */

#fp-chat-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    font-family: var(--font-body, 'Outfit', sans-serif);
}

/* Toggle Button */
.chat-toggle-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent, #4ade80), #22c55e);
    border: none;
    box-shadow: 0 10px 25px rgba(74, 222, 128, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: #fff;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s;
}

.chat-toggle-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 15px 35px rgba(74, 222, 128, 0.6);
}

.chat-toggle-btn .close-icon {
    display: none;
    font-size: 24px;
}

#fp-chat-widget.open .chat-toggle-btn {
    background: #2B3D56;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

#fp-chat-widget.open .chat-toggle-btn .chat-icon {
    display: none;
}

#fp-chat-widget.open .chat-toggle-btn .close-icon {
    display: block;
}

/* Chat Window */
.chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 360px;
    max-width: calc(100vw - 40px);
    height: 500px;
    max-height: calc(100vh - 120px);
    background: rgba(14, 27, 46, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    
    transform-origin: bottom right;
    transform: scale(0.5);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s;
}

#fp-chat-widget.open .chat-window {
    transform: scale(1);
    opacity: 1;
    pointer-events: all;
}

/* Chat Header */
.chat-header {
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    gap: 15px;
}

.chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(74, 222, 128, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    border: 1px solid rgba(74, 222, 128, 0.5);
}

.chat-title h4 {
    margin: 0;
    font-size: 1.1rem;
    color: #fff;
    font-weight: 600;
}

.chat-title p {
    margin: 3px 0 0 0;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    gap: 5px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 8px #4ade80;
}

/* Chat Body */
.chat-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chat-body::-webkit-scrollbar {
    width: 6px;
}
.chat-body::-webkit-scrollbar-track {
    background: transparent;
}
.chat-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

.chat-msg {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 0.95rem;
    line-height: 1.5;
    animation: fadeIn 0.3s ease;
}

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

.msg-ai {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border-bottom-left-radius: 4px;
    align-self: flex-start;
}

.msg-user {
    background: linear-gradient(135deg, var(--accent, #4ade80), #22c55e);
    color: #fff;
    border-bottom-right-radius: 4px;
    align-self: flex-end;
}

.chat-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.suggestion-chip {
    background: rgba(74, 222, 128, 0.1);
    border: 1px solid rgba(74, 222, 128, 0.3);
    color: #4ade80;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.suggestion-chip:hover {
    background: rgba(74, 222, 128, 0.2);
}

/* Chat Input */
.chat-input-area {
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    gap: 10px;
}

.chat-input-area input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 10px 15px;
    color: #fff;
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
}

.chat-input-area input:focus {
    border-color: rgba(74, 222, 128, 0.5);
    background: rgba(255, 255, 255, 0.08);
}

.chat-send-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(74, 222, 128, 0.1);
    color: #4ade80;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.chat-send-btn:hover {
    background: var(--accent, #4ade80);
    color: #fff;
}

.chat-send-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
    margin-left: 2px;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 5px 0;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: rgba(255,255,255,0.5);
    border-radius: 50%;
    animation: typingBounce 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 typingBounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}
