/**
 * /assets/css/messages-inbox.css
 *
 * Purpose:  Nachrichten-Inbox Seite Styles
 *           Message list, message detail, type icons
 * Deps:     app.css (CSS variables)
 * Load:     index.php
 * Version:  1.0.0
 */

/* =========================
   Tab Bar
   ========================= */
[data-msg-tab].--active {
  background: rgba(93,214,201,.12) !important;
  border-color: rgba(93,214,201,.35) !important;
  color: var(--accent) !important;
}

/* =========================
   Message List
   ========================= */
.msg-inbox__list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* =========================
   Message Row
   ========================= */
.msg-inbox-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: calc(var(--r, 12px));
  background: rgba(255,255,255,.02);
  border: 1px solid rgba(255,255,255,.06);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}

.msg-inbox-row:hover {
  border-color: rgba(93,214,201,.20);
  background: rgba(255,255,255,.04);
}

.msg-inbox-row.--unread {
  border-left: 3px solid rgba(93,214,201,.5);
  background: rgba(93,214,201,.03);
}

.msg-inbox-row.--unread .msg-inbox-row__subject {
  font-weight: 800;
  color: rgba(255,255,255,.95);
}

/* Icon */
.msg-inbox-row__icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 14px;
}

.msg-inbox-row__icon--direct {
  background: rgba(176,140,255,.12);
  color: rgba(176,140,255,.8);
}

.msg-inbox-row__icon--invitation {
  background: rgba(255,211,107,.12);
  color: rgba(255,211,107,.8);
}

.msg-inbox-row__icon--system {
  background: rgba(93,214,201,.12);
  color: rgba(93,214,201,.8);
}

.msg-inbox-row__icon--quest {
  background: rgba(77,163,255,.12);
  color: rgba(77,163,255,.8);
}

.msg-inbox-row__icon--event {
  background: rgba(255,107,107,.12);
  color: rgba(255,107,107,.8);
}

/* Content */
.msg-inbox-row__content {
  flex: 1;
  min-width: 0;
}

.msg-inbox-row__header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}

.msg-inbox-row__from {
  font-size: .82rem;
  font-weight: 700;
  color: rgba(255,255,255,.85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.msg-inbox-row__subject {
  font-size: .82rem;
  font-weight: 600;
  color: rgba(255,255,255,.65);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.msg-inbox-row__preview {
  font-size: .75rem;
  color: rgba(255,255,255,.4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 500px;
}

/* Meta */
.msg-inbox-row__time {
  font-size: .7rem;
  color: rgba(255,255,255,.35);
  white-space: nowrap;
  flex-shrink: 0;
}

.msg-inbox-row__actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity .15s ease;
}

.msg-inbox-row:hover .msg-inbox-row__actions {
  opacity: 1;
}

/* =========================
   Message Detail
   ========================= */
.msg-detail {
  padding: 20px;
  border-radius: calc(var(--r, 12px));
  background: rgba(255,255,255,.02);
  border: 1px solid rgba(255,255,255,.06);
}

.msg-detail__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.msg-detail__avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
}

.msg-detail__avatar--img {
  object-fit: cover;
}

.msg-detail__avatar--initials {
  background: linear-gradient(135deg, rgba(93,214,201,.15), rgba(176,140,255,.15));
  border: 2px solid rgba(93,214,201,.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
  color: rgba(255,255,255,.7);
}

.msg-detail__from {
  font-weight: 800;
  font-size: .9rem;
  color: rgba(255,255,255,.9);
}

.msg-detail__subject {
  font-size: 1.1rem;
  font-weight: 800;
  color: rgba(255,255,255,.95);
  margin-bottom: 4px;
}

.msg-detail__time {
  font-size: .75rem;
  color: rgba(255,255,255,.35);
}

.msg-detail__body {
  font-size: .88rem;
  line-height: 1.6;
  color: rgba(255,255,255,.75);
  white-space: pre-wrap;
  word-break: break-word;
}

.msg-detail__actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,.06);
}

/* =========================
   Empty State
   ========================= */
.msg-inbox__empty {
  text-align: center;
  padding: 40px 20px;
  color: rgba(255,255,255,.35);
}

.msg-inbox__empty i {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 12px;
  opacity: .4;
}

/* =========================
   Pagination
   ========================= */
.msg-inbox__pagination .btn {
  font-size: .8rem;
}

/* =========================
   Mobile
   ========================= */
@media(max-width: 576px) {
  .msg-inbox-row {
    padding: 10px;
    gap: 8px;
  }

  .msg-inbox-row__preview {
    display: none;
  }

  .msg-inbox-row__actions {
    opacity: 1;
  }

  .msg-detail {
    padding: 14px;
  }
}

/* =========================
   Reduced Motion
   ========================= */
@media(prefers-reduced-motion: reduce) {
  .msg-inbox-row {
    transition: none;
  }
}
