/* ════════════════════════════════════════
   MAILBOX — Panel styles
════════════════════════════════════════ */

/* NOTE: display is controlled by .side-panel / .side-panel.active in hud.css */
#panel-mailbox {
  flex-direction: column;
  gap: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
}

/* ── Header ───────────────────────────────────────────────────────────────── */
.mbx-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  border-bottom: 1px solid rgba(180,140,50,0.25);
  flex-shrink: 0;
  background: rgba(0,0,0,0.15);
}
.mbx-title {
  font-family: var(--font-ui);
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.mbx-mark-all {
  background: none;
  border: none;
  color: var(--text-dim);
  font-family: var(--font-ui);
  font-size: 9px;
  cursor: pointer;
  transition: color 0.12s;
  padding: 0;
}
.mbx-mark-all:hover { color: var(--text-gold); }

/* ── Mail list ────────────────────────────────────────────────────────────── */
.mbx-list {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}
.mbx-list::-webkit-scrollbar       { width: 4px; }
.mbx-list::-webkit-scrollbar-track { background: transparent; }
.mbx-list::-webkit-scrollbar-thumb { background: rgba(180,140,50,0.3); border-radius: 2px; }

.mbx-empty {
  text-align: center;
  color: var(--text-dim);
  font-size: 10px;
  font-family: var(--font-ui);
  padding: 20px 12px;
  line-height: 1.6;
}

/* ── Mail row ─────────────────────────────────────────────────────────────── */
.mbx-mail-row {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  padding: 7px 10px;
  border-bottom: 1px solid rgba(180,140,50,0.08);
  cursor: pointer;
  transition: background 0.12s;
  position: relative;
}
.mbx-mail-row:hover           { background: rgba(180,140,50,0.06); }
.mbx-mail-row.selected        { background: rgba(180,140,50,0.1); }
.mbx-mail-row.unread          { }
.mbx-mail-row:last-child      { border-bottom: none; }

.mbx-unread-dot {
  position: absolute;
  left: 3px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-gold);
}

.mbx-mail-icon {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.38);
  border: 1px solid rgba(180,140,50,0.22);
  border-radius: 4px;
  overflow: hidden;
}

.mbx-mail-body {
  flex: 1;
  min-width: 0;
}

.mbx-mail-subject {
  font-family: var(--font-ui);
  font-size: 10px;
  color: var(--text-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}
.mbx-mail-row.unread .mbx-mail-subject { color: #fff; font-weight: bold; }

.mbx-rar-badge {
  font-family: var(--font-title);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
  line-height: 1.4;
}

.mbx-mail-preview {
  font-family: var(--font-ui);
  font-size: 9px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}

.mbx-mail-date {
  font-family: var(--font-ui);
  font-size: 8px;
  color: var(--text-dim);
  flex-shrink: 0;
  margin-top: 2px;
  white-space: nowrap;
}

/* ── Gold badge on mail row ───────────────────────────────────────────────── */
.mbx-gold-badge {
  font-family: var(--font-ui);
  font-size: 9px;
  color: #f0c040;
  font-weight: bold;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 2px;
}
.mbx-gold-badge.collected { color: var(--text-dim); text-decoration: line-through; }

/* ── Mail detail panel ────────────────────────────────────────────────────── */
.mbx-detail {
  border-top: 1px solid rgba(180,140,50,0.2);
  background: rgba(0,0,0,0.15);
  flex-shrink: 0;
  max-height: 200px;
  overflow-y: auto;
  padding: 10px;
  display: none;
  flex-direction: column;
  gap: 8px;
}
.mbx-detail.visible { display: flex; }
.mbx-detail::-webkit-scrollbar { width: 3px; }
.mbx-detail::-webkit-scrollbar-thumb { background: rgba(180,140,50,0.3); border-radius: 2px; }

.mbx-detail-subject {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: bold;
  color: var(--text-gold);
  line-height: 1.3;
}

.mbx-detail-body {
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.5;
}

.mbx-detail-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.mbx-collect-btn {
  padding: 5px 10px;
  background: rgba(40,120,40,0.25);
  border: 1px solid rgba(80,180,80,0.4);
  border-radius: 3px;
  color: #7ddc7d;
  font-family: var(--font-ui);
  font-size: 9px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.12s;
}
.mbx-collect-btn:hover    { background: rgba(40,120,40,0.45); }
.mbx-collect-btn:disabled { opacity: 0.4; cursor: default; }

.mbx-collect-gold {
  padding: 5px 10px;
  background: rgba(180,140,0,0.2);
  border: 1px solid rgba(200,160,0,0.4);
  border-radius: 3px;
  color: #f0c040;
  font-family: var(--font-ui);
  font-size: 9px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.12s;
  white-space: nowrap;
}
.mbx-collect-gold:hover    { background: rgba(180,140,0,0.35); }
.mbx-collect-gold:disabled { opacity: 0.4; cursor: default; }

.mbx-delete-btn {
  padding: 5px 8px;
  background: rgba(80,20,20,0.3);
  border: 1px solid rgba(160,50,50,0.35);
  border-radius: 3px;
  color: #e57373;
  font-family: var(--font-ui);
  font-size: 9px;
  cursor: pointer;
  transition: background 0.12s;
  margin-left: auto;
}
.mbx-delete-btn:hover { background: rgba(120,30,30,0.5); }

/* ── Mailbox badge on side-nav ────────────────────────────────────────────── */
#snb-mailbox {
  position: relative;
}
.mbx-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 14px;
  height: 14px;
  padding: 0 3px;
  border-radius: 7px;
  background: #e53935;
  color: #fff;
  font-family: var(--font-ui);
  font-size: 8px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  box-shadow: 0 1px 4px rgba(0,0,0,0.7);
  z-index: 2;
}
.mbx-badge[data-count="0"] { display: none; }
