/* ============================================================
   AI SOHBET WİDGET'I STİLLERİ
   ============================================================
   Bootstrap temasıyla uyumlu modern tasarım.
   Koyu mavi tonları ve gölgeli görünüm.
   ============================================================ */

/* CSS Değişkenleri - Site Renk Paletine Uyumlu Tema */
:root {
    /* Ana renkler - site paleti */
    --chat-primary: #5161ce;
    --chat-primary-dark: #3d4db0;
    --chat-primary-light: #7c8cf8;
    --chat-accent: #7c3aed;
    --chat-accent-light: #a78bfa;

    /* Arka plan renkleri - koyu gradient tonları */
    --chat-bg-dark: #1e1e2e;
    --chat-bg-darker: #13131d;
    --chat-bg-glass: rgba(30, 30, 46, 0.95);

    /* Metin renkleri */
    --chat-text-light: #ffffff;
    --chat-text-muted: #a0a0b8;
    --chat-text-accent: #c4b5fd;

    /* Mesaj balonları - site renkleriyle uyumlu */
    --chat-user-bubble: linear-gradient(135deg, #5161ce 0%, #7c3aed 100%);
    --chat-bot-bubble: linear-gradient(135deg, #2A6A92 0%, #1e4a6e 100%);

    /* Gölgeler ve efektler */
    --chat-shadow: 0 15px 50px rgba(81, 97, 206, 0.25), 0 5px 20px rgba(0, 0, 0, 0.3);
    --chat-shadow-sm: 0 4px 15px rgba(81, 97, 206, 0.15);
    --chat-glow: 0 0 30px rgba(124, 58, 237, 0.3);
}

/* ============================================================
   FLOATING ACTION BUTTON (Sohbet Balonu)
   ============================================================ */
.chat-toggle-btn {
    position: fixed;
    bottom: 50px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--chat-primary) 0%, var(--chat-primary-dark) 100%);
    border: none;
    color: var(--chat-text-light);
    font-size: 24px;
    cursor: pointer;
    box-shadow: var(--chat-shadow);
    transition: all 0.3s ease;
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-toggle-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 15px 50px rgba(13, 110, 253, 0.4);
}

.chat-toggle-btn:active {
    transform: scale(0.95);
}

.chat-toggle-btn.hidden {
    transform: scale(0);
    opacity: 0;
    pointer-events: none;
}

/* ============================================================
   SOHBET PENCERESİ
   ============================================================ */
.chat-window {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 390px;
    height: 540px;
    background: linear-gradient(180deg, var(--chat-bg-dark) 0%, var(--chat-bg-darker) 100%);
    border-radius: 24px;
    box-shadow: var(--chat-shadow), var(--chat-glow);
    border: 1px solid rgba(124, 58, 237, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 9999;
    opacity: 0;
    transform: translateY(20px) scale(0.9);
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(20px);
}

.chat-window.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* Responsive - Mobil */
@media (max-width: 480px) {
    .chat-window {
        width: calc(100% - 20px);
        height: 70vh;
        right: 10px;
        bottom: 80px;
        border-radius: 15px;
    }

    .chat-toggle-btn {
        right: 15px;
        bottom: 15px;
        width: 55px;
        height: 55px;
    }
}

/* ============================================================
   BAŞLIK (Header)
   ============================================================ */
.chat-header {
    background: #2A6A92;
    padding: 18px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 20px rgba(81, 97, 206, 0.3);
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--chat-text-light);
    font-weight: 600;
    font-size: 16px;
}

.chat-header-info i {
    font-size: 22px;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.chat-close-btn {
    background: transparent;
    border: none;
    color: var(--chat-text-muted);
    font-size: 18px;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.chat-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--chat-text-light);
}

/* ============================================================
   MESAJLAR ALANI
   ============================================================ */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: linear-gradient(180deg, rgba(30, 30, 46, 0.5) 0%, rgba(19, 19, 29, 0.8) 100%);
}

/* Scrollbar Stilleri */
.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: rgba(30, 30, 46, 0.5);
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #5161ce 0%, #7c3aed 100%);
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #6172df 0%, #8d4afe 100%);
}

/* ============================================================
   MESAJ BALONLARI
   ============================================================ */
.chat-message {
    display: flex;
    max-width: 85%;
    animation: messageSlide 0.3s ease;
}

@keyframes messageSlide {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Kullanıcı Mesajı (Sağda) */
.user-message {
    align-self: flex-end;
    justify-content: flex-end;
}

.user-message .message-bubble {
    background: var(--chat-user-bubble);
    color: var(--chat-text-light);
    border-radius: 20px 20px 6px 20px;
    box-shadow: 0 4px 20px rgba(124, 58, 237, 0.25);
    border: 1px solid rgba(124, 58, 237, 0.2);
}

/* Bot Mesajı (Solda) */
.bot-message {
    align-self: flex-start;
    justify-content: flex-start;
}

.bot-message .message-bubble {
    background: var(--chat-bot-bubble);
    color: var(--chat-text-light);
    border-radius: 20px 20px 20px 6px;
    box-shadow: 0 4px 20px rgba(42, 106, 146, 0.25);
    border: 1px solid rgba(42, 106, 146, 0.2);
}

.message-bubble {
    padding: 14px 18px;
    line-height: 1.6;
    font-size: 14px;
    word-wrap: break-word;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}

.message-bubble:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2);
}

/* ============================================================
   YAZIYOR ANİMASYONU
   ============================================================ */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    color: var(--chat-text-muted);
    font-size: 13px;
}

.typing-dots {
    display: flex;
    gap: 4px;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    background: var(--chat-primary-light);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes typingBounce {

    0%,
    80%,
    100% {
        transform: scale(0.6);
        opacity: 0.5;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ============================================================
   MESAJ GİRİŞ ALANI
   ============================================================ */
.chat-input-area {
    padding: 16px 18px;
    background: linear-gradient(180deg, var(--chat-bg-darker) 0%, #0f0f17 100%);
    display: flex;
    gap: 12px;
    border-top: 1px solid rgba(124, 58, 237, 0.2);
}

.chat-input {
    flex: 1;
    background: rgba(81, 97, 206, 0.08);
    border: 1px solid rgba(124, 58, 237, 0.25);
    border-radius: 25px;
    padding: 14px 22px;
    color: var(--chat-text-light);
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
}

.chat-input::placeholder {
    color: var(--chat-text-muted);
}

.chat-input:focus {
    border-color: #7c3aed;
    background: rgba(124, 58, 237, 0.12);
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.15), 0 0 20px rgba(124, 58, 237, 0.2);
}

.chat-send-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #2A6A92;
    border: none;
    color: var(--chat-text-light);
    font-size: 17px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3);
}

.chat-send-btn:hover {
    background: #1a4d6b;
    transform: scale(1.08) translateY(-2px);
    box-shadow: 0 8px 25px rgba(42, 106, 146, 0.5);
}

.chat-send-btn:active {
    transform: scale(0.95);
}

.chat-send-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}