/* WhatsApp Simgesi Stilleri */
.whatsapp-float {
    position: fixed;
    width: 60px;
    height: 60px;
    bottom: 40px;
    left: 40px;
    background-color: #25d366;
    color: #FFF;
    border-radius: 50px;
    text-align: center;
    font-size: 30px;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
    /* Z-index'i ana stil dosyasındaki diğer öğelerden yüksek yaptık */
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    animation: pulse 2s infinite;
}

.whatsapp-float:hover {
    background-color: #128C7E;
    transform: scale(1.15);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.6);
    animation: none;
}

/* Nabız efekti */
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(37, 211, 102, 0); }
    100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

.whatsapp-chat-box {
    position: fixed;
    bottom: 110px;
    left: 40px;
    width: 90vw;
    max-width: 320px;
    min-width: 280px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
    z-index: 9999; /* Butonla aynı seviyede */
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.whatsapp-chat-box.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.whatsapp-header {
    background-color: #075E54;
    color: white;
    padding: 15px;
    border-radius: 10px 10px 0 0;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.whatsapp-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #075E54;
    flex-shrink: 0;
    background-color: #fff; /* Avatar arka planı beyaz olsun */
    overflow: hidden;
}

.whatsapp-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.whatsapp-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.whatsapp-name {
    font-weight: bold;
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.whatsapp-status {
    font-size: 12px;
    opacity: 0.8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
    margin-top: 2px;
}

.whatsapp-body {
    padding: 15px;
    background-color: #e5ddd5;
    min-height: 120px;
    border-radius: 0 0 10px 10px;
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* İsteğe bağlı WhatsApp arka plan deseni */
    background-image: url('https://user-images.githubusercontent.com/15075759/28719144-86dc0f70-73b1-11e7-911d-60d70fcded21.png');
}

.whatsapp-message {
    background-color: white;
    padding: 12px 15px;
    border-radius: 7.5px;
    margin-bottom: 10px;
    position: relative;
    box-shadow: 0 1px 0.5px rgba(0, 0, 0, 0.13);
    display: flex;
    flex-direction: column;
    justify-content: center;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.4;
    max-width: 85%; /* Mesaj balonunun genişliğini sınırladık */
}

.whatsapp-message:after {
    content: "";
    position: absolute;
    bottom: 0;
    left: -10px;
    width: 0;
    height: 0;
    border: 10px solid transparent;
    border-top-color: white;
    border-bottom: 0;
    border-left: 0;
}

.whatsapp-time {
    text-align: right;
    font-size: 11px;
    color: rgba(0, 0, 0, 0.45);
    margin-top: 5px;
    align-self: flex-end;
}

.whatsapp-footer {
    padding: 12px 15px;
    background-color: #f0f0f0;
    border-radius: 0 0 10px 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.whatsapp-input {
    flex: 1;
    border: none;
    padding: 10px 15px;
    border-radius: 20px;
    outline: none;
    font-size: 14px;
    min-width: 0;
    background-color: white;
    border: 1px solid #e0e0e0;
}

.whatsapp-send {
    background-color: #25d366;
    color: white;
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.3s;
    flex-shrink: 0;
    font-size: 16px;
}

.whatsapp-send:hover {
    background-color: #128C7E;
}

/* Yazıyor Efekti */
.typing-indicator {
    display: none;
    align-items: center;
    margin-bottom: 10px;
}

.typing-indicator.active {
    display: flex;
}

.typing-dots {
    display: flex;
    background-color: white;
    padding: 10px 15px;
    border-radius: 7.5px;
    box-shadow: 0 1px 0.5px rgba(0, 0, 0, 0.13);
}

.typing-dots span {
    height: 8px;
    width: 8px;
    background-color: #999;
    border-radius: 50%;
    display: block;
    margin: 0 2px;
    animation: typing 1.5s infinite ease-in-out;
}

.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-5px); opacity: 1; }
}

/* Responsive Düzeltmeler */
@media screen and (max-width: 767px) {
    .whatsapp-float {
        width: 50px; height: 50px; bottom: 20px; left: 20px; font-size: 25px;
    }
    .whatsapp-chat-box {
        bottom: 80px; left: 20px; width: calc(100vw - 40px);
    }
}