/* ==========================================
   WHATSAPP-STYLE POSTBIT CSS
   Angepasst für dein bestehendes Design
   ========================================== */

/* Container */
.whatsapp_post_container {
    width: 100%;
    clear: both;
	background-image: url(../../../images_nightsky/postbit_background.png);
	background-repeat: repeat-x;
	padding: 20px;
}

/* Post Wrapper */
.whatsapp_post {
    display: flex;
    gap: 12px;
    max-width: 75%;
   margin: 0px 20px;
    animation: slideIn 0.3s ease;
    align-items: flex-start;
}

/* Eigene Posts = RECHTS (grün) */
.whatsapp_post.own {
    margin-left: auto;
    flex-direction: row-reverse;
}

/* Andere Posts = LINKS (weiß) */
.whatsapp_post.other {
    margin-right: auto;
    flex-direction: row;
}

/* ========================================
   AVATAR
   ========================================== */

.whatsapp_avatar {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    position: relative;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    margin: 10px;
}

.whatsapp_avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Online Indicator */
.whatsapp_online_indicator {
    position: absolute;
    bottom: 1px;
    right: 1px;
    width: 18px;
    height: 18px;
    background: #25d366;
    border: 2px solid white;
    border-radius: 50%;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);
}

/* ========================================
   CHAT BUBBLE
   ========================================== */

.whatsapp_bubble {
    background: #dcf8c6; /* WhatsApp Grün */
    border-radius: 12px;
    padding: 12px 14px;
    /* position: relative; */
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
    word-wrap: break-word;
    min-width: 400px;
    margin: 10px 0px 10px 10px;
}

/* Eigene Posts = Grün */
.whatsapp_post.own .whatsapp_bubble {
    background: #dcf8c6;
    border-bottom-right-radius: 3px;
}

/* Andere Posts = Weiß */
.whatsapp_post.other .whatsapp_bubble {
    background: #ffffff;
    border-bottom-left-radius: 3px;
}

/* Bubble Tail (Spitze) */
.whatsapp_bubble::before {
    content: "";
    position: absolute;
    bottom: 0;
    width: 0;
    height: 0;
    border-style: solid;
}

/* Tail für eigene Posts (rechts) */
.whatsapp_post.own .whatsapp_bubble::before {
    right: -8px;
    border-width: 0 0 12px 10px;
    border-color: transparent transparent #dcf8c6 transparent;
}

/* Tail für andere Posts (links) */
.whatsapp_post.other .whatsapp_bubble::before {
    left: -8px;
    border-width: 0 10px 12px 0;
    border-color: transparent #ffffff transparent transparent;
}

/* ========================================
   HEADER (Username & Zeit)
   ========================================== */

.whatsapp_header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
    gap: 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    padding-bottom: 8px;
}

.whatsapp_user_info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.whatsapp_profillink {
    font-weight: 700;
    font-size: 15px;
    color: #075e54;
}

.whatsapp_profillink a {
    color: #075e54;
    text-decoration: none;
}

.whatsapp_profillink a:hover {
    text-decoration: underline;
}

.whatsapp_usertitle {
    font-size: 11px;
    color: #667781;
    font-style: italic;
}

.whatsapp_charaname {
    font-size: 12px;
    color: #075e54;
    font-weight: 500;
}

.whatsapp_charaname a {
    color: #075e54;
    text-decoration: none;
}

.whatsapp_time_info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    white-space: nowrap;
}

.whatsapp_date {
    font-size: 11px;
    color: #667781;
}

.whatsapp_time {
    font-size: 10px;
    color: #8696a0;
}

/* ========================================
   BETREFF
   ========================================== */

.whatsapp_subject {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    padding: 6px 8px;
    background: rgba(0, 0, 0, 0.04);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #075e54;
}

/* ========================================
   MESSAGE (Nachricht)
   ========================================== */

.whatsapp_message {
    font-size: 14px;
    line-height: 1.6;
    color: #000000;
    margin: 8px 0;
}

/* Blockquote innerhalb */
.whatsapp_message blockquote {
    border-left: 3px solid #075e54;
    padding-left: 12px;
    margin: 10px 0;
    font-style: italic;
    opacity: 0.85;
    background: rgba(0, 0, 0, 0.03);
    padding: 8px 12px;
    border-radius: 4px;
}

/* Bilder in Posts */
.whatsapp_message img {
    max-width: 100%;
    border-radius: 8px;
    margin: 8px 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* ========================================
   FOOTER (Wordcount & Status)
   ========================================== */

.whatsapp_footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: 6px;
    gap: 12px;
    font-size: 11px;
    color: #667781;
}

.whatsapp_wordcount {
    display: flex;
    align-items: center;
    gap: 4px;
}

.whatsapp_wordcount i {
    font-size: 10px;
}

.whatsapp_status {
    font-size: 12px;
}

.whatsapp_status i {
    color: #53bdeb; /* Blau für "gelesen" */
}

.whatsapp_edited {
    font-size: 10px;
    font-style: italic;
    color: #8696a0;
}

/* ========================================
   CONTROLS (Author Change, Edit, Quote, PM)
   ========================================== */

.whatsapp_controls {
    display: flex;
    gap: 6px;
    margin-top: 6px;
    opacity: 0;
    transition: opacity 0.2s ease;
    flex-wrap: wrap;
}

.whatsapp_controls_author {
    flex-wrap: wrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.05);
    color: #667781;
    text-decoration: none;
    font-size: 12px;
    transition: all 0.2s ease;
}

.whatsapp_post:hover .whatsapp_controls {
    opacity: 1;
}

.whatsapp_control_btn,
.whatsapp_controls a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.05);
    color: #667781;
    text-decoration: none;
    font-size: 12px;
    transition: all 0.2s ease;
}

.whatsapp_control_btn:hover,
.whatsapp_controls a:hover {
    background: rgba(0, 0, 0, 0.12);
    color: #075e54;
    transform: scale(1.1);
}

/* ========================================
   DATUM-TRENNER
   ========================================== */

.whatsapp_date_separator {
    text-align: center;
    margin: 20px 0;
	padding: 20px;
}

.whatsapp_date_separator span {
    background: rgba(0, 0, 0, 0.08);
    padding: 6px 14px;
    border-radius: 12px;
    font-size: 12px;
    color: #667781;
    display: inline-block;
    font-weight: 500;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* ========================================
   ANIMATIONS
   ========================================== */

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   RESPONSIVE
   ========================================== */

@media (max-width: 1024px) {
    .whatsapp_post {
        max-width: 80%;
    }
}

@media (max-width: 768px) {
    .whatsapp_post {
        max-width: 90%;
    }
    
    .whatsapp_avatar {
        width: 42px;
        height: 42px;
    }
    
    .whatsapp_bubble {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    .whatsapp_header {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    
    .whatsapp_time_info {
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .whatsapp_post {
        max-width: 95%;
    }
    
    .whatsapp_avatar {
        width: 38px;
        height: 38px;
    }
}

/* ========================================
   DARK MODE SUPPORT
   ========================================== */

body.dark-mode .whatsapp_bubble,
.night .whatsapp_bubble {
    background: #056162 !important;
    color: #e9edef;
}

body.dark-mode .whatsapp_post.other .whatsapp_bubble,
.night .whatsapp_post.other .whatsapp_bubble {
    background: #1f2c33 !important;
}

body.dark-mode .whatsapp_message,
.night .whatsapp_message {
    color: #e9edef;
}

body.dark-mode .whatsapp_date_separator span,
.night .whatsapp_date_separator span {
    background: rgba(255, 255, 255, 0.1);
    color: #e9edef;
}

body.dark-mode .whatsapp_bubble::before,
.night .whatsapp_bubble::before {
    border-color: transparent transparent #056162 transparent;
}

body.dark-mode .whatsapp_post.other .whatsapp_bubble::before,
.night .whatsapp_post.other .whatsapp_bubble::before {
    border-color: transparent #1f2c33 transparent transparent;
}

/* ========================================
   ZUSÄTZLICHE ANPASSUNGEN
   ========================================== */

/* Falls scaleimages Klasse Probleme macht */
.whatsapp_message.scaleimages img {
    max-width: 100% !important;
    height: auto !important;
}

/* Post URL Link */
.whatsapp_controls .posturl {
    display: inline-flex;
    align-items: center;
}

/* Ignore/Deleted Bits */
.whatsapp_post_container .ignore_bit,
.whatsapp_post_container .deleted_bit {
    margin-bottom: 8px;
    padding: 8px 12px;
    background: rgba(237, 73, 86, 0.1);
    border-left: 3px solid #ed4956;
    border-radius: 6px;
    font-size: 12px;
    color: #ed4956;
}
