/* ==========================================================================
   RPG SMS & MESSENGER LOOK (PREFIX: SMS_)
   ========================================================================== */

/* Hintergrund für die gesamte SMS-Seite */
.sms-body-bg {
    background-color: #141414 !important; 
}

/* 1. Chat-Header (Jetzt exakt so breit wie der Verlauf) */
.sms-chat-header {
    background: #1f2c34;
    border-bottom: 1px solid #2f3b43;
    padding: 15px 20px;
    margin: 0 auto; /* Zentriert den Header */
    max-width: 800px; /* Hier die gleiche Breite wie deine .sms-chat-history eintragen */
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    border-left: 1px solid #1e293b;
    border-right: 1px solid #1e293b;
}

.sms-chat-header-content {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
}

.sms-back-arrow {
    color: var(--accent); 
    font-size: 1.4rem;
    font-weight: bold;
    cursor: pointer;
}

.sms-chat-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sms-chat-title {
    color: #ffffff !important;
    font-size: 1.15rem !important;
    font-weight: 600;
    margin: 0 !important;
    line-height: 1.2;
}

.sms-online-dot {
    color: #00e676; 
    font-size: 0.8rem;
    font-weight: 500;
    margin-left: auto;
}

/* 2. Chat-Verlauf (Sprechblasen-Feld) */
.sms-chat-history {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 30px 20px;
    max-width: 800px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    box-sizing: border-box;
    background-color: var(--dark);

    min-height: 500px;
}

.sms-message-row {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    max-width: 75%;
    width: 100%;
}

/* --- LINKS (Empfangene Nachrichten von anderen) --- */
.sms-received {
    align-self: flex-start; /* Drückt die fremde Nachricht nach LINKS */
}

.sms-received .sms-bubble {
    color: #ffffff;
    border-radius: 15px 15px 15px 3px; /* Rundung für links */
}

.sms-received .sms-sender-name {
    font-size: 0.8rem;
    color: #8696a0;
    margin-bottom: 3px;
    margin-left: 5px;
    font-weight: 600;
}

/* --- RECHTS (Deine eigenen Nachrichten) --- */
.sms-sent {
    align-self: flex-end; /* Drückt deine eigene Nachricht nach RECHTS */
    flex-direction: row-reverse; /* Dreht Avatar und Blase für rechts um */
}

.sms-sent .sms-bubble {
    color: #ffffff;
    border-radius: 15px 15px 3px 15px; /* Rundung für rechts */
}

.sms-sent .sms-sender-name {
    display: none; /* Deinen eigenen Namen musst du rechts nicht sehen */
}

/* --- ACTIONS FÜR EDIT / QUOTE --- */
/* Buttons spiegeln sich jetzt passend zur neuen Ausrichtung */
.sms-sent .sms-actions { left: -80px; }
.sms-received .sms-actions { right: -80px; }

/* --- ALLGEMEINE SPRECHBLASEN-STYLES --- */
.sms-avatar-wrap {
    width: 75px;
    height: 75px;
    flex-shrink: 0;
}

.sms-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 1.5px solid #2a3942;
}

.sms-bubble-container {
    display: flex;
    flex-direction: column;
    position: relative;
}

.sms-bubble {
    padding: 10px 14px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.3);
    font-size: 0.95rem;
    line-height: 1.45;
}

.sms-text {
    word-break: break-word;
}

.sms-meta {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 4px;
}

.sms-time {
    font-weight: 500;
}

/* --- AKTIONEN (BEARBEITEN / ZITIEREN) IMMER SICHTBAR --- */
.sms-actions {
    display: flex;
    gap: 12px; /* Etwas mehr Abstand für Touch-Bedienung */
    margin-top: 5px;
    opacity: 0.5; /* Dezent halbtransparent */
    transition: opacity 0.2s ease;
}

/* Beim Drüberfahren oder Antippen werden sie voll sichtbar */
.sms-bubble-container:hover .sms-actions,
.sms-actions:active {
    opacity: 1;
}

/* Ausrichtung der Buttons passend zur Sprechblase */
.sms-sent .sms-actions {
    justify-content: flex-end; /* Eigene Posts (rechts) -> Buttons rechtsbündig */
}

.sms-received .sms-actions {
    justify-content: flex-start; /* Fremde Posts (links) -> Buttons linksbündig */
}

/* Styling der Links als kleine, unaufdringliche Text-Buttons */
.sms-actions a {
    color: #8696a0 !important; /* Unauffälliges Grau */
    font-size: 0.50rem !important;
    text-decoration: none !important;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 4px;
    transition: color 0.1s ease;
}

/* Farb-Highlight beim Hovern (Desktop) */
.sms-actions a:hover {
    color: #ffffff !important; /* Wird beim Hovern weiß */
}

/* --- QUICKREPLY --- */
.sms-quickreply-wrapper {
    max-width: 800px;
    margin: 20px auto 40px auto;
    padding: 0 10px;
}

.sms-qr-container {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #1f2c34;
    padding: 8px 12px;
    border-radius: 25px;
}

.sms-qr-textarea {
    flex-grow: 1;
    background: transparent !important;
    border: none !important;
    color: #fff !important;
    font-size: 0.95rem;
    padding: 8px 12px;
    outline: none;
    resize: none;
    height: 38px !important;
    line-height: 1.4;
    font-family: inherit;
}

.sms-btn-send {
    background: var(--light) !important;
    color: var(--accent) !important;
    border: none !important;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    transition: transform 0.1s ease;
}

.sms-btn-send:active {
    transform: scale(0.9);
}

.sms-chat-pagination {
    max-width: 800px;
    margin: 10px auto 30px auto;
    text-align: center;
}


/* --- ZITATE INNERHALB DER SMS-BUBBLES --- */
.sms-bubble blockquote,
.sms-bubble .blockquote {
    background: rgba(0, 0, 0, 0.3) !important; /* Abgedunkelter, transparenter Zitier-Kasten */
    border-left: 3px solid rgba(255, 255, 255, 0.4) !important; /* Dezenter Streifen links */
    color: #ffffff !important; /* Textfarbe auf weiß zwingen */
    padding: 8px 12px !important;
    margin: 5px 0 10px 0 !important;
    border-radius: 6px;
    font-size: 0.85rem !important;
}

/* Zitier-Überschrift ("User schrieb:") */
.sms-bubble blockquote cite,
.sms-bubble .blockquote cite {
    color: rgba(255, 255, 255, 0.7) !important;
    font-weight: 600;
    font-style: normal;
    display: block;
    margin-bottom: 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 2px;
}