/* ================================================
   WhatsApp Style für MyBB mit XThreads
   ================================================ */

/* Container für die Chat-Ansicht */
.whatsapp_thread {
    background: #e5ddd5;
    background-image: url(https://user-images.githubusercontent.com/15075759/28719144-86dc0f70-73b1-11e7-911d-60d70fcded21.png);
    padding: 20px 10px;
    max-width: 900px;
    margin: 0 auto;
}

/* Einzelne Chat-Message Container */
.whatsapp_message {
    margin: 10px 0;
    clear: both;
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

/* Nachrichten vom aktuellen User (rechts) */
.whatsapp_message.own {
    flex-direction: row-reverse;
}

/* Avatar Styling */
.whatsapp_avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
}

.whatsapp_avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

/* Message Bubble */
.whatsapp_bubble {
    max-width: 65%;
    padding: 8px 12px;
    border-radius: 8px;
    position: relative;
    word-wrap: break-word;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* Bubble von anderen Usern (links, weiß) */
.whatsapp_message:not(.own) .whatsapp_bubble {
    background: #ffffff;
    border-radius: 0 8px 8px 8px;
}

/* Bubble vom aktuellen User (rechts, grün) */
.whatsapp_message.own .whatsapp_bubble {
    background: #dcf8c6;
    border-radius: 8px 0 8px 8px;
}

/* Username in der Bubble */
.whatsapp_username {
    font-weight: bold;
    color: #075e54;
    font-size: 13px;
    margin-bottom: 2px;
}

.whatsapp_message.own .whatsapp_username {
    color: #128c7e;
}

/* Message Content */
.whatsapp_content {
    font-size: 14px;
    line-height: 1.4;
    color: #303030;
    margin-bottom: 2px;
}

/* Timestamp und Status Container */
.whatsapp_meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    font-size: 11px;
    color: #667781;
    margin-top: 4px;
}

/* Timestamp */
.whatsapp_time {
    font-size: 11px;
}

/* Gelesen/Ungelesen Status (Häkchen) */
.whatsapp_status {
    display: inline-flex;
    align-items: center;
}

/* Einzelnes Häkchen (gesendet) */
.whatsapp_status.sent::after {
    content: "✓";
    color: #667781;
    font-size: 16px;
    line-height: 1;
}

/* Doppel-Häkchen (gelesen) */
.whatsapp_status.read::after {
    content: "✓✓";
    color: #4fc3f7;
    font-size: 16px;
    line-height: 1;
    font-weight: bold;
}

/* MyBB Standard-Elemente ausblenden */
.whatsapp_thread .post_author,
.whatsapp_thread .post_head,
.whatsapp_thread .post_controls,
.whatsapp_thread .postbit_buttons {
    display: none !important;
}

/* Thread-Header anpassen */
.whatsapp_thread .thread_header {
    background: #075e54;
    color: white;
    padding: 15px;
    border-radius: 8px 8px 0 0;
    margin: -20px -10px 20px -10px;
}

.whatsapp_thread .thread_header h1 {
    color: white;
    font-size: 18px;
    margin: 0;
}

/* Quick Reply Box WhatsApp-Style */
.whatsapp_thread .quick_reply {
    background: #f0f0f0;
    padding: 15px;
    border-radius: 0 0 8px 8px;
    margin: 20px -10px -20px -10px;
}

.whatsapp_thread .quick_reply textarea {
    border-radius: 20px;
    border: 1px solid #ddd;
    padding: 10px 15px;
    font-size: 14px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .whatsapp_bubble {
        max-width: 80%;
    }
    
    .whatsapp_avatar {
        width: 32px;
        height: 32px;
    }
}

/* Animation für neue Nachrichten */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.whatsapp_message {
    animation: slideIn 0.3s ease-out;
}