/* ===== Fake Inbox — standalone stylesheet ===== */

.fi-inbox {
  display: flex;
  flex-direction: column;
  border: none;
  border-radius: 0.5rem;
  overflow: hidden;
  background: var(--bs-body-bg);
  height: 75vh;
  min-height: 420px;
  max-height: 700px;
  position: relative;
}

/* ---- Tabs ---- */

.fi-tabs {
  display: flex;
  flex-shrink: 0;
  background: var(--bs-secondary-bg);
}

.fi-tab {
  flex: 1;
  max-width: 160px;
  padding: 0.65rem 1rem;
  border: none;
  background: transparent;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.fi-tab:hover {
  background-color: var(--bs-tertiary-bg);
}

.fi-tab.active {
  border-bottom-color: #0d6efd;
}

.fi-tab-badge {
  background: #dc3545;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
  padding: 0.22rem 0.4rem;
  border-radius: 1rem;
  min-width: 1.1rem;
  text-align: center;
}

.fi-tab-badge:empty {
  display: none;
}

/* ---- Body (list + reading pane) ---- */

.fi-body {
  flex: 1;
  display: flex;
  min-height: 0;
}

/* ---- Email list (left pane) ---- */

.fi-list {
  width: 340px;
  flex-shrink: 0;
  overflow-y: auto;
  background: var(--bs-tertiary-bg);
}

.fi-list-empty {
  padding: 2rem 1rem;
  text-align: center;
  font-size: 0.9rem;
}

.fi-list-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  cursor: pointer;
  border-bottom: 1px solid var(--bs-secondary-bg);
  background: var(--bs-tertiary-bg);
  transition: background-color 0.15s ease;
}

.fi-list-item:hover {
  background-color: var(--bs-secondary-bg);
}

.fi-list-item.active {
  background-color: var(--bs-secondary-bg);
}

.fi-list-item.unread .fi-subject, .fi-list-item.unread .fi-from {
  font-weight: 700;
}

.fi-avatar {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #0d6efd;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 600;
}

.fi-avatar.fi-avatar-sm {
  width: 32px;
  height: 32px;
  font-size: 0.75rem;
}

.fi-avatar.fi-avatar-you {
  background: #6c757d;
}

.fi-list-text {
  min-width: 0;
  flex: 1;
}

.fi-from {
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.fi-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #0d6efd;
  flex-shrink: 0;
}

.fi-subject {
  font-size: 0.87rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fi-preview {
  font-size: 0.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fi-count-badge {
  flex-shrink: 0;
  font-size: 0.72rem;
  background: var(--bs-body-bg);
  border-radius: 1rem;
  padding: 0.1rem 0.45rem;
  align-self: flex-start;
  margin-top: 0.1rem;
}

/* ---- Reading pane (right side) ---- */

.fi-reading {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.fi-reading-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  text-align: center;
  padding: 1rem;
}

.fi-reading-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #e9ecef;
  flex-shrink: 0;
}

.fi-reading-header .fi-back-btn {
  display: none;
}

.fi-reading-subject {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0 0 0.35rem;
}

.fi-reading-meta {
  font-size: 0.85rem;
}

.fi-reading-body {
  padding: 1.25rem;
  overflow-y: auto;
  flex: 1;
}

/* ---- Individual messages within a thread ---- */

.fi-message {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.fi-message:last-child {
  margin-bottom: 0;
}

.fi-message-content {
  flex: 1;
  min-width: 0;
}

.fi-message-head {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.fi-message-from {
  font-weight: 600;
  font-size: 0.9rem;
}

.fi-message.fi-message-you .fi-message-from {
}

.fi-message-body {
  white-space: pre-wrap;
  line-height: 1.55;
  font-size: 0.93rem;
  background: #222;
  border-radius: 0.5rem;
  padding: 0.75rem 0.9rem;
}

.fi-message.fi-message-you .fi-message-body {
  background: #333;
}

/* ---- Mobile layout ---- */

@media (max-width: 700px) {
  .fi-inbox {
    height: 80vh;
    border-radius: 0.4rem;
  }
}

@media (max-width: 700px) {
  .fi-list {
    width: 100%;
    border-right: none;
  }
}

@media (max-width: 700px) {
  .fi-reading {
    position: absolute;
    inset: 0;
    top: 45px;
    background: var(--bs-tertiary-bg);
    z-index: 2;
  }
}

@media (max-width: 700px) {
  .fi-inbox:not(.fi-show-reading) .fi-reading {
    display: none;
  }
}

@media (max-width: 700px) {
  .fi-inbox.fi-show-reading .fi-list {
    display: none;
  }
}

@media (max-width: 700px) {
  .fi-inbox.fi-show-reading .fi-tabs {
    display: none;
  }
}

@media (max-width: 700px) {
  .fi-inbox.fi-show-reading .fi-reading {
    top: 0;
  }
}

@media (max-width: 700px) {
  .fi-reading-header .fi-back-btn {
    display: inline-flex;
  }
}

