/* FD Chatbot Widget Styles */
/* Ferhat Dijital - ferhatyigit.com */

#fd-chatbot-container {
    position: fixed;
    bottom: 24px;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    direction: ltr;
}

/* ========== FAB Butonları ========== */
#fd-fab-group {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
}

.fd-fab {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-decoration: none;
}

.fd-fab:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.fd-fab:active {
    transform: scale(0.95);
}

.fd-fab-whatsapp {
    background: #25D366;
}

.fd-fab-chat {
    position: relative;
}

/* Pulse animasyonu */
.fd-fab-chat::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: inherit;
    opacity: 0;
    animation: fd-pulse 2s ease-in-out infinite;
}

@keyframes fd-pulse {
    0%, 100% { opacity: 0; transform: scale(1); }
    50% { opacity: 0.3; transform: scale(1.15); }
}

/* ========== Chat Penceresi ========== */
#fd-chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    max-width: calc(100vw - 32px);
    height: 520px;
    max-height: calc(100vh - 140px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.18);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: opacity 0.25s ease, transform 0.25s ease;
    transform-origin: bottom right;
}

#fd-chat-window.fd-hidden {
    opacity: 0;
    transform: scale(0.9) translateY(10px);
    pointer-events: none;
}

#fd-chat-window.fd-visible {
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: auto;
}

/* Sol konumda ise */
[style*="left:"] #fd-chat-window {
    right: auto;
    left: 0;
    transform-origin: bottom left;
}

[style*="left:"] #fd-fab-group {
    align-items: flex-start;
}

/* ========== Header ========== */
#fd-chat-header {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #fff;
    flex-shrink: 0;
}

.fd-chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.fd-chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.5px;
}

.fd-chat-title {
    font-weight: 600;
    font-size: 15px;
}

.fd-chat-subtitle {
    font-size: 12px;
    opacity: 0.85;
}

#fd-chat-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    transition: background 0.15s;
}

#fd-chat-close:hover {
    background: rgba(255,255,255,0.2);
}

/* ========== Mesaj Alanı ========== */
#fd-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #f0f2f5;
}

/* Scrollbar */
#fd-chat-messages::-webkit-scrollbar {
    width: 5px;
}
#fd-chat-messages::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 10px;
}

/* Mesaj balonları */
.fd-msg {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 12px;
    word-wrap: break-word;
    animation: fd-fadeIn 0.2s ease;
    font-size: 14px;
    line-height: 1.5;
}

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

.fd-msg-bot {
    align-self: flex-start;
    background: #fff;
    color: #1a1a1a;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}

.fd-msg-user {
    align-self: flex-end;
    background: #dcf8c6;
    color: #1a1a1a;
    border-bottom-right-radius: 4px;
}

.fd-msg-time {
    display: block;
    font-size: 11px;
    opacity: 0.55;
    margin-top: 4px;
    text-align: right;
}

/* Yazıyor animasyonu */
.fd-typing {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
}

.fd-typing span {
    width: 8px;
    height: 8px;
    background: #aaa;
    border-radius: 50%;
    animation: fd-typing 1.2s infinite;
}

.fd-typing span:nth-child(2) { animation-delay: 0.2s; }
.fd-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes fd-typing {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-6px); opacity: 1; }
}

/* ========== Input Alanı ========== */
#fd-chat-input-area {
    padding: 12px 16px;
    background: #fff;
    border-top: 1px solid #e8e8e8;
    flex-shrink: 0;
}

#fd-chat-input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    background: #f0f2f5;
    border-radius: 24px;
    padding: 6px 6px 6px 16px;
}

#fd-chat-input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    resize: none;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.4;
    max-height: 80px;
    padding: 6px 0;
    color: #1a1a1a;
}

#fd-chat-input::placeholder {
    color: #999;
}

#fd-chat-send {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: opacity 0.15s;
}

#fd-chat-send:hover {
    opacity: 0.85;
}

#fd-chat-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.fd-chat-powered {
    text-align: center;
    font-size: 11px;
    color: #aaa;
    margin-top: 8px;
}

/* ========== Responsive ========== */
@media (max-width: 480px) {
    #fd-chatbot-container {
        bottom: 16px;
        right: 16px !important;
        left: auto !important;
    }
    
    #fd-chat-window {
        width: calc(100vw - 32px);
        height: calc(100vh - 120px);
        bottom: 72px;
        right: -8px;
    }
    
    .fd-fab {
        width: 54px;
        height: 54px;
    }
}

/* ========== Utility ========== */
.fd-hidden {
    display: none !important;
}
