/* Futia AI Chatbot Widget */

#futia-chatbot-toggle {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    border: none;
    cursor: pointer;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #fff;
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.4);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#futia-chatbot-toggle:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 28px rgba(139, 92, 246, 0.5);
}

#futia-chatbot-toggle .fc-close {
    display: none;
}

#futia-chatbot-toggle.is-open .fc-open { display: none; }
#futia-chatbot-toggle.is-open .fc-close { display: block; }

/* Chat Window */
#futia-chatbot {
    position: fixed;
    bottom: 92px;
    right: 24px;
    width: 380px;
    max-height: 520px;
    background: #0c0b14;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    z-index: 99998;
    display: none;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(139, 92, 246, 0.05);
    font-family: 'Sora', sans-serif;
}

#futia-chatbot.is-open {
    display: flex;
    animation: fcSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fcSlideUp {
    from { opacity: 0; transform: translateY(16px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Header */
.fc-header {
    padding: 16px 18px;
    background: rgba(139, 92, 246, 0.06);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    gap: 10px;
}

.fc-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8b5cf6, #06b6d4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #fff;
    flex-shrink: 0;
}

.fc-header-info h4 {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    margin: 0;
    font-family: 'Space Grotesk', sans-serif;
}

.fc-header-info span {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
}

/* Messages */
.fc-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 280px;
    max-height: 360px;
}

.fc-msg {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 13px;
    line-height: 1.6;
    color: #fff;
    word-wrap: break-word;
}

.fc-msg-bot {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-bottom-left-radius: 4px;
}

.fc-msg-user {
    align-self: flex-end;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(99, 102, 241, 0.15));
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-bottom-right-radius: 4px;
}

.fc-msg-typing {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.4);
    font-style: italic;
}

/* Input */
.fc-input-wrap {
    padding: 12px 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    gap: 8px;
}

.fc-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 10px 14px;
    font-family: 'Sora', sans-serif;
    font-size: 13px;
    color: #fff;
    outline: none;
    transition: border-color 0.2s ease;
}

.fc-input:focus {
    border-color: rgba(139, 92, 246, 0.4);
}

.fc-input::placeholder {
    color: rgba(255, 255, 255, 0.25);
}

.fc-send {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    border: none;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease;
    flex-shrink: 0;
}

.fc-send:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Quick actions */
.fc-quick {
    padding: 0 16px 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.fc-quick-btn {
    padding: 6px 12px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.5);
    font-size: 11px;
    font-family: 'Sora', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
}

.fc-quick-btn:hover {
    background: rgba(139, 92, 246, 0.1);
    border-color: rgba(139, 92, 246, 0.3);
    color: #c4b5fd;
}

/* Scrollbar */
.fc-messages::-webkit-scrollbar { width: 4px; }
.fc-messages::-webkit-scrollbar-track { background: transparent; }
.fc-messages::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 2px; }

/* Mobile — chatbot göster, tam genişlik */
@media (max-width: 768px) {
    #futia-chatbot-toggle {
        bottom: 16px;
        right: 16px;
    }
    #futia-chatbot {
        right: 8px;
        left: 8px;
        width: auto;
        bottom: 84px;
        max-height: 70vh;
    }
}

/* ── Online visitor counter ─────────────── */
.futia-online-counter {
    position: fixed;
    bottom: 36px;
    right: 96px;
    background: rgba(12, 11, 20, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-family: 'Sora', sans-serif;
    color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 99998;
    border: 1px solid rgba(255, 255, 255, 0.1);
    pointer-events: none;
    transition: opacity 0.3s ease;
}

body.futia-light .futia-online-counter {
    background: rgba(255, 255, 255, 0.9);
    color: #1a1a2e;
    border-color: rgba(0, 0, 0, 0.1);
}

.futia-online-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    flex-shrink: 0;
    animation: futia-online-pulse 2s ease infinite;
}

@keyframes futia-online-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.85); }
}

/* Mobile counter */
@media (max-width: 768px) {
    .futia-online-counter {
        bottom: 28px;
        right: 80px;
        font-size: 11px;
        padding: 5px 10px;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    #futia-chatbot.is-open { animation: none; }
    .futia-online-dot { animation: none; }
}

/* ══════════════════════════════════════════
   LIGHT THEME OVERRIDES
   ══════════════════════════════════════════ */
body.futia-light #futia-chatbot {
    background: #ffffff !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12) !important;
}
body.futia-light .fc-header {
    background: rgba(139, 92, 246, 0.04) !important;
    border-bottom-color: rgba(0, 0, 0, 0.06) !important;
}
body.futia-light .fc-header-info h4 {
    color: #1a1a2e !important;
}
body.futia-light .fc-header-info span {
    color: #7a7a8a !important;
}
body.futia-light .fc-messages {
    background: #ffffff !important;
}
body.futia-light .fc-msg-bot {
    background: #f0f0f5 !important;
    color: #1a1a2e !important;
}
body.futia-light .fc-msg-user {
    background: linear-gradient(135deg, #8b5cf6, #6366f1) !important;
    color: #ffffff !important;
}
body.futia-light .fc-quick {
    background: #f8f8fc !important;
    border-top-color: rgba(0, 0, 0, 0.06) !important;
}
body.futia-light .fc-quick-btn {
    background: #ffffff !important;
    border-color: rgba(0, 0, 0, 0.1) !important;
    color: #4a4a5a !important;
}
body.futia-light .fc-quick-btn:hover {
    background: rgba(139, 92, 246, 0.08) !important;
    border-color: rgba(139, 92, 246, 0.3) !important;
    color: #7c3aed !important;
}
body.futia-light .fc-input-wrap {
    background: #ffffff !important;
    border-top-color: rgba(0, 0, 0, 0.06) !important;
}
body.futia-light .fc-input {
    background: #f0f0f5 !important;
    color: #1a1a2e !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
}
body.futia-light .fc-input:focus {
    border-color: rgba(139, 92, 246, 0.4) !important;
    background: #ffffff !important;
}
body.futia-light .fc-input::placeholder {
    color: rgba(0, 0, 0, 0.35) !important;
}
body.futia-light .fc-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15) !important;
}
body.futia-light .fc-typing {
    background: #f0f0f5 !important;
    color: #4a4a5a !important;
}
