.chat-widget-wrapper {
    position: fixed;
    bottom: 25px;
    right: 25px;
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 99999;
}

.chat-bubble {
    background: white;
    padding: 10px 18px;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    border: 1px solid #e2e8f0;
    animation: floatChat 3s ease-in-out infinite;
}

/* 1. ANA SOHBET AÇMA BUTONU DÜZELTME */
.chat-btn {
    width: 60px !important;
    height: 60px !important;
    min-width: 60px !important;
    max-width: 60px !important;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 50% !important;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(37, 99, 235, 0.4);
    
    /* İkonu Ortalamak İçin */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* 2. MESAJ GÖNDERME (UÇAK) BUTONU DÜZELTME */
.chat-footer button {
    width: 45px !important;
    height: 45px !important;
    min-width: 45px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
}

/* İkonların Kendi İçinde Kaymasını Engelle */
.chat-btn i, .chat-footer button i {
    font-size: 20px !important;
    line-height: 1 !important;
    display: block !important;
    margin: 0 !important;
}

.chat-header-close { cursor:pointer; }

.chat-screen {
    position: fixed;
    bottom: 95px; right: 25px;
    width: 350px; height: 480px;
    background: white; border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    display: none; flex-direction: column;
    z-index: 99999; border: 1px solid #eee;
    opacity: 0; transform: translateY(20px);
    transition: opacity 0.4s, transform 0.4s;
}

.chat-screen.active { opacity: 1; transform: translateY(0); }

.chat-header { background: #2563eb; color: white; padding: 15px; display: flex; justify-content: space-between; align-items: center; font-weight: bold; }
/* Mesajların toplandığı ana gövde */
.chat-body {
    display: flex !important;
    flex-direction: column !important;
    padding: 15px !important;
    gap: 12px !important;
}

.message {
    padding: 12px 16px !important;
    border-radius: 15px !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    max-width: 85% !important; /* Mesajın çok yayılmasını engeller */
    width: fit-content !important; /* İçindeki metne göre genişler */
    word-wrap: break-word !important; /* Uzun kelimeleri böler */
    white-space: normal !important; /* Metnin doğal akışında kalmasını sağlar */
    display: inline-block !important; /* Kelimelerin alt alta binmesini önler */
    margin-bottom: 8px !important;
}
/* Bot Mesaj Baloncuğu */
.bot-message {
    background: #ffffff !important;
    color: #333 !important;
    align-self: flex-start !important;
    border: 1px solid #e0e0e0 !important;
    
    /* KRİTİK AYARLAR */
    display: block !important;           /* Satırı kaplamasına izin ver */
    width: fit-content !important;        /* İçindeki yazı kadar genişlesin */
    max-width: 90% !important;           /* Ekranın %90'ına kadar açılabilir */
    min-width: 100px !important;         /* Çok daralmasını engelle */
    
    padding: 12px 16px !important;
    border-radius: 12px !important;
    line-height: 1.5 !important;         /* Satır aralığını rahatlat */
    
    /* KELİME BÖLMEYİ KAPAT */
    word-break: normal !important;       /* Kelimeleri ortadan bölme */
    overflow-wrap: break-word !important; /* Sadece çok uzun link vb. varsa böl */
    white-space: pre-wrap !important;    /* Boşlukları ve alt satırları koru */
}

.user-message { background: #2563eb; color: white; align-self: flex-end; }
.chat-footer { padding: 10px; display: flex; gap: 5px; border-top: 1px solid #eee; }
.chat-footer input { flex: 1; padding: 10px; border-radius: 20px; border: 1px solid #ddd; outline: none; }
.chat-footer button { background: #2563eb; color: white; border: none; width: 35px; height: 35px; border-radius: 50%; cursor: pointer; }

@keyframes floatChat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }

@media (max-width: 480px) {
    .chat-screen { width: 90%; right: 5%; bottom: 80px; }
    .chat-bubble { display: none; }
}