/* Tüm öğelerde box-sizing kontrol altına alınır */
.whatsapp-widget * {
    box-sizing: border-box !important;
}

/* Ana widget */
.whatsapp-widget {
    position: fixed;
    z-index: 2147483647;
    left: 0;
    right: 0;
}

.whatsapp-widget.bottom-right { 
    bottom: 0; 
    justify-content: flex-end; 
    display: flex; 
    flex-direction: column; 
    align-items: flex-end; 
}
.whatsapp-widget.bottom-left  { 
    bottom: 0; 
    justify-content: flex-start; 
    display: flex; 
    flex-direction: column; 
    align-items: flex-start; 
}
.whatsapp-widget.top-right    { 
    top: 0; 
    justify-content: flex-end; 
    display: flex; 
    flex-direction: column; 
    align-items: flex-end; 
}
.whatsapp-widget.top-left     { 
    top: 0; 
    justify-content: flex-start; 
    display: flex; 
    flex-direction: column; 
    align-items: flex-start; 
}

/* WhatsApp ikon - TÜM ARKAPLAN VE GÖLGE KALDIRILDI */
.whatsapp-icon {
    width: 60px;
    height: 60px;
    cursor: pointer;
    margin: 15px;
    z-index: 2147483647;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.whatsapp-icon:hover {
    transform: scale(1.1);
}

.whatsapp-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Sohbet kutusu */
.whatsapp-chatbox {
    background-image: url('https://e0.pxfuel.com/wallpapers/722/149/desktop-wallpaper-message-background-whatsapp-message-background-thumbnail.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    padding: 0;
    width: 350px;
    max-width: calc(100vw - 40px);
    box-shadow: 0 -2px 15px rgba(0,0,0,0.2);
    border-radius: 12px 12px 0 0;
    color: #2b2a2a;
    font-family: sans-serif;
    overflow: hidden;
    margin: 10px 15px;
    border: 1px solid #ddd;
}

/* WhatsApp Header - Artık inline style ile renk ayarlanacak */
.whatsapp-header {
    padding: 15px;
    display: flex;
    align-items: center;
    color: white;
    border-bottom: 1px solid rgba(0,0,0,0.1);
    width: 100%;
}

/* Avatar container */
.whatsapp-avatar {
    position: relative;
    margin-right: 12px;
    flex-shrink: 0;
}

/* Avatar image */
.whatsapp-avatar img {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: 2px solid white;
    object-fit: cover;
}

/* Çevrimiçi gösterge */
.online-indicator {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    background: #4ade80;
    border: 2px solid white;
    border-radius: 50%;
}

/* Kişi bilgileri */
.whatsapp-person-info {
    flex: 1;
    text-align: left;
}

.person-name {
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 2px;
    line-height: 1.2;
}

.person-description {
    font-size: 13px;
    opacity: 0.9;
    line-height: 1.2;
}

/* Giriş mesajı balonu - Font normal yapıldı */
.whatsapp-bubble {
    background: #fff;
    color: #333;
    border-radius: 10px 10px 10px 0;
    padding: 12px 15px;
    margin: 15px;
    max-width: 85%;
    font-size: 14px;
    font-family: sans-serif;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
    position: relative;
    line-height: 1.4;
    font-weight: normal !important;
}

.whatsapp-bubble::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: -8px;
    width: 0;
    height: 0;
    border: 8px solid transparent;
    border-top-color: #fff;
    border-right-color: #fff;
    border-bottom: 0;
    border-left: 0;
    margin-left: -1px;
}

/* Mesaj ve butonun tek satıra yerleşmesi */
.whatsapp-input-row {
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 25px;
    padding: 0 8px;
    border: 1px solid #ccc;
    margin: 15px;
    height: 48px;
    min-height: 48px;
    max-height: 48px;
    box-sizing: border-box;
}

/* Mesaj kutusu (input) - Font normal yapıldı */
.whatsapp-input-row input[type="text"] {
    border: none;
    outline: none;
    flex: 1;
    padding: 10px 15px;
    font-size: 14px;
    border-radius: 25px;
    background: transparent;
    font-family: sans-serif;
    font-weight: normal !important;
}

.whatsapp-input-row input[type="text"]::placeholder {
    color: #999;
    font-weight: normal !important;
}

/* Gönder butonu */
.whatsapp-send-btn {
    background: #25d366 !important;
    border: none !important;
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    max-width: 40px !important;
    max-height: 40px !important;
    border-radius: 50% !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    margin-left: 6px !important;
    line-height: 0 !important;
    box-sizing: border-box !important;
    flex-shrink: 0 !important;
    cursor: pointer !important;
    transition: background 0.3s ease !important;
}

.whatsapp-send-btn:hover {
    background: #1ebe5d !important;
}

.whatsapp-send-btn svg {
    width: 18px !important;
    height: 18px !important;
    display: block !important;
    fill: white !important;
}

/* Mobil uyumluluk - KÜÇÜLTÜLDÜ */
@media (max-width: 480px) {
    .whatsapp-chatbox {
        width: 85vw; /* Ekran genişliğinin %85'i */
        max-width: 300px; /* Maksimum genişlik */
        border-radius: 12px;
        margin: 10px;
        transform: scale(0.85); /* %15 küçültme */
        transform-origin: bottom right; /* Sağ alt köşeden küçült */
    }
    
    .whatsapp-widget.bottom-right .whatsapp-chatbox {
        transform-origin: bottom right;
    }
    
    .whatsapp-widget.bottom-left .whatsapp-chatbox {
        transform-origin: bottom left;
    }
    
    .whatsapp-widget.top-right .whatsapp-chatbox {
        transform-origin: top right;
    }
    
    .whatsapp-widget.top-left .whatsapp-chatbox {
        transform-origin: top left;
    }
    
    .whatsapp-widget.bottom-right,
    .whatsapp-widget.bottom-left {
        bottom: 0;
    }
    
    .whatsapp-icon {
        width: 50px; /* Mobilde biraz daha küçük ikon */
        height: 50px;
        margin: 10px;
    }
    
    .whatsapp-bubble {
        margin: 12px;
        max-width: 90%;
        font-size: 13px; /* Mobilde font biraz küçültüldü */
        padding: 10px 12px;
    }
    
    .whatsapp-input-row {
        margin: 12px;
        height: 42px; /* Mobilde input alanı küçültüldü */
        min-height: 42px;
        max-height: 42px;
    }
    
    .whatsapp-input-row input[type="text"] {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .whatsapp-send-btn {
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
        min-height: 36px !important;
        max-width: 36px !important;
        max-height: 36px !important;
    }
    
    .whatsapp-send-btn svg {
        width: 16px !important;
        height: 16px !important;
    }
    
    .whatsapp-header {
        padding: 12px;
    }
    
    .whatsapp-avatar img {
        width: 40px;
        height: 40px;
    }
    
    .person-name {
        font-size: 15px;
    }
    
    .person-description {
        font-size: 12px;
    }
}

/* Çok küçük ekranlar için ek ayar */
@media (max-width: 360px) {
    .whatsapp-chatbox {
        width: 90vw;
        max-width: 280px;
        transform: scale(0.8); /* Daha da küçült */
    }
    
    .whatsapp-icon {
        width: 45px;
        height: 45px;
        margin: 8px;
    }
}