/**
 * Datei: messages.css
 * Modul: Messages (Nachrichten)
 * Autor: MARKS MEDIA
 *
 * Zweck:
 *   Enthält ausschließlich modulbezogenes Styling
 *   für den Frontend-Messenger im Benutzer-Dashboard.
 *   Alle globalen Eingabe- und Button-Styles liegen im Theme.
 */

/* ============================================================
   1. Container-Struktur
============================================================ */
#mp-messages {
	display: flex;
	flex-direction: row;
	gap: 20px;
	min-height: 500px;
	width: 100%;
}
@media (max-width: 800px) {
	#mp-messages {
		flex-direction: column;
	}
}

/* ============================================================
   2. Thread-Liste (linke Spalte)
============================================================ */
.mp-messages-sidebar {
	flex: 0 0 35%;
	max-width: 350px;
	background: var(--color-8);
	border: 1px solid var(--color-6);
	border-radius: 6px;
	display: flex;
	flex-direction: column;
}
#mp-thread-list {
	flex: 1;
	overflow-y: auto;
	padding: 8px;
}

/* Suchfeld */
.mp-messages-sidebar input#mp-message-search {
	width: 100%;
	padding: 8px 4px;
	font-size: 14px;
	border: none;
	border-bottom: 2px solid var(--color-6);
	border-radius: 0;
	background: transparent;
	outline: none;
	color: var(--color-4);
	transition: border-color 0.2s ease;
}
.mp-messages-sidebar input#mp-message-search:focus {
	border-bottom-color: var(--color-1);
}

/* Thread-Einträge */
.mp-thread-item {
	background: var(--color-8);
	border: 1px solid var(--color-6);
	border-radius: 5px;
	padding: 10px 12px;
	margin-bottom: 8px;
	cursor: pointer;
	position: relative;
	transition: background-color 0.2s;
}
.mp-thread-item:hover {
	background-color: var(--color-7);
}
.mp-thread-item.active {
	background-color: var(--color-7);
	border-color: var(--color-1);
}
.mp-thread-last {
	font-size: 14px;
	margin-bottom: 4px;
	line-height: 1.3;
}
.mp-thread-time {
	font-size: 12px;
	text-align: right;
}

/* Badge oben rechts */
.mp-thread-unread-badge {
    position: absolute;        /* NEU */
    top: 6px;                  /* NEU */
    right: 6px;                /* NEU */
    padding: 2px 6px;
    font-size: 12px;
    font-weight: 700;
    background: var(--color-2);
    color: #fff;
    border-radius: 8px;
	z-index: 5;
    line-height: 1;            /* sauberere Darstellung */
}

/* ============================================================
   3. Nachrichtenbereich (rechte Spalte)
============================================================ */
.mp-messages-content {
	flex: 1;
	display: flex;
	flex-direction: column;
	background: var(--color-8);
	border: 1px solid var(--color-6);
	border-radius: 6px;
}

#mp-thread-view {
	flex: 1;
	padding: 15px;
	overflow-y: auto;
	border-bottom: 1px solid var(--color-6);

	/* WICHTIG für Ausrichtung */
	display: flex;
	flex-direction: column;
}

/* ============================================================
   Nachrichten-Blöcke
============================================================ */
.mp-thread-message {
	display: flex;
	flex-direction: column;
	margin-bottom: 10px;

	max-width: 75%;
	align-self: flex-start;  /* Standard: andere Nachrichten links */
}

/* Eigene Nachrichten (SELF) – rechts */
.mp-thread-message.self {
	align-self: flex-end !important;
	text-align: right; /* Zeitstempel rechts, wenn gewünscht */
}

/* Andere Nachrichten (OTHER) – links */
.mp-thread-message.other {
	align-self: flex-start;
	text-align: left;
}

/* ============================================================
   Textblasen
============================================================ */
.mp-thread-bubble {
	width: auto;
	display: inline-block;
	padding: 10px 14px;
	font-size: 14px;
	line-height: 1.4;
	box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}

.mp-thread-message.self .mp-thread-bubble {
	background-color: var(--color-1);
	color: var(--color-8);
	border-radius: 12px 12px 0 12px;
}

.mp-thread-message.other .mp-thread-bubble {
	background-color: var(--color-7);
	border-radius: 12px 12px 12px 0;
}

/* ============================================================
   Zeit-Meta
============================================================ */
.mp-thread-meta {
	margin-top: 3px;
	font-size: 11px;
	color: var(--color-5);
	text-align: right;
}

/* ============================================================
   4. Eingabeformular (untere Leiste)
============================================================ */
#mp-message-form {
	display: flex;
	gap: 10px;
	padding: 0;
	border-radius: 0 0 6px 6px;
}
#mp-message-text {
	flex: 1;
	min-height: 40px;
	max-height: 120px;
	resize: vertical;
	padding: 8px 4px;
	font-size: 14px;
	border: none;
	border-bottom: 2px solid var(--color-6);
	border-radius: 0;
	background: transparent;
	outline: none;
	transition: border-color 0.2s ease;
}
#mp-message-text:focus {
	border-bottom-color: var(--color-1);
}


/* ============================================================
   5. Scrollbar-Design
============================================================ */
#mp-thread-list::-webkit-scrollbar,
#mp-thread-view::-webkit-scrollbar {
	width: 8px;
}
#mp-thread-list::-webkit-scrollbar-thumb,
#mp-thread-view::-webkit-scrollbar-thumb {
	background: rgba(0, 0, 0, 0.15);
	border-radius: 4px;
}
#mp-thread-list::-webkit-scrollbar-thumb:hover,
#mp-thread-view::-webkit-scrollbar-thumb:hover {
	background: rgba(0, 0, 0, 0.25);
}

/* ============================================================
   6. Button
============================================================ */

