/* ========== BN MY CHATS PAGE — 3-column layout ========== */

/* ── Layout ── */
.mc-layout {
  display: grid;
  grid-template-columns: minmax(400px, 1fr) 340px;
  gap: 0;
  height: calc(100vh - 72px);
}

.mc-col {
  border-right: 1px solid var(--neutral-800);
  overflow-y: auto;
  max-height: calc(100vh - 72px);
}
.mc-col:last-child {
  border-right: none;
}

/* Column 1: Messages — min-width prevents collapse on empty state */
.mc-col-messages {
  padding: 0 16px;
  min-width: 0;
}
.mc-layout.reader-open {
  grid-template-columns: minmax(400px, 1fr) 340px 420px;
}

/* Column 2: Announcements */
.mc-col-announcements {
  padding: 0;
}

/* Column 3: Reader */
.mc-col-reader {
  padding: 0;
  animation: mcSlideIn 0.25s ease-out;
}
@keyframes mcSlideIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── Header ── */
.mc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0 16px;
}
.mc-header-title {
  display: flex;
  align-items: center;
  gap: 10px;
}
.mc-header-title h2 {
  font-size: 24px;
  font-weight: 600;
  color: #fff;
  margin: 0;
}
.mc-total-unread {
  background: var(--purple-400);
  color: #000;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  min-width: 24px;
  text-align: center;
}
.mc-btn-new {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  color: #000;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 10px;
  border: none;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.2s;
}
.mc-btn-new:hover { opacity: 0.85; }
.mc-btn-new img { width: 16px; height: 16px; filter: brightness(0.1) !important; }

/* ── Search ── */
.mc-search {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--neutral-800);
  border: 1px solid var(--neutral-700);
  border-radius: 12px;
  padding: 10px 16px;
  margin-bottom: 16px;
}
.mc-search img { width: 18px; height: 18px; opacity: 0.5; }
.mc-search input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: #fff;
  font-size: 14px;
}
.mc-search input::placeholder { color: var(--neutral-500); }

/* ── Chat List ── */
.mc-chat-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* ── Chat Item ── */
.mc-chat-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s;
  position: relative;
}
.mc-chat-item:hover { background: var(--neutral-800); }
.mc-chat-item.unread { background: rgba(168, 85, 247, 0.06); }
.mc-chat-item.unread:hover { background: rgba(168, 85, 247, 0.1); }

/* Avatar */
.mc-avatar-wrap { position: relative; flex-shrink: 0; }
.mc-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--neutral-700);
}
.mc-status-dot {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #22c55e;
  border: 2px solid var(--neutral-900);
}

/* Body */
.mc-chat-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.mc-chat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.mc-chat-name {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mc-chat-item.unread .mc-chat-name { color: var(--purple-300); }
.mc-chat-time {
  font-size: 12px;
  color: var(--neutral-500);
  white-space: nowrap;
  flex-shrink: 0;
}
.mc-chat-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.mc-chat-preview {
  font-size: 13px;
  color: var(--neutral-400);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}
.mc-chat-item.unread .mc-chat-preview {
  color: var(--neutral-300);
  font-weight: 500;
}

/* Unread badge */
.mc-unread-badge {
  background: var(--purple-400);
  color: #000;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
  flex-shrink: 0;
}

/* Delete button */
.mc-delete-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  opacity: 0;
  transition: opacity 0.2s, background 0.2s;
  z-index: 5;
}
.mc-chat-item:hover .mc-delete-btn { opacity: 0.5; }
.mc-delete-btn:hover { opacity: 1 !important; background: rgba(255, 75, 75, 0.15); }
.mc-delete-btn img { width: 16px; height: 16px; filter: brightness(0) invert(0.6); }
.mc-delete-btn:hover img { filter: brightness(0) invert(0.4) sepia(1) saturate(10) hue-rotate(0deg); }

/* ── Empty State ── */
.mc-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 60px 20px;
  text-align: center;
}
.mc-empty-icon { width: 48px; height: 48px; opacity: 0.3; filter: invert(1); }
.mc-empty p { color: var(--neutral-500); font-size: 15px; margin: 0; }
.mc-btn-explore {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--purple-400);
  color: #000;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 24px;
  border-radius: 10px;
  text-decoration: none;
  margin-top: 8px;
  transition: opacity 0.2s;
}
.mc-btn-explore:hover { opacity: 0.85; }

/* ── Skeleton Loading ── */
.mc-skeleton { pointer-events: none; }
.mc-skeleton .mc-avatar { background: var(--neutral-700); }
.mc-shimmer {
  border-radius: 6px;
  background: linear-gradient(110deg, var(--neutral-800) 30%, var(--neutral-700) 50%, var(--neutral-800) 70%);
  background-size: 200% 100%;
  animation: mcShimmer 1.5s linear infinite;
}
.mc-shimmer-name { height: 16px; width: 120px; margin-bottom: 6px; }
.mc-shimmer-msg { height: 13px; width: 200px; }
@keyframes mcShimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}


/* ═══════════════════════════════════════════════════
   COLUMN 2: ANNOUNCEMENTS
   ═══════════════════════════════════════════════════ */

.mc-ann-header {
  padding: 20px 20px 12px;
  border-bottom: 1px solid var(--neutral-800);
}
.mc-ann-header h3 {
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.mc-ann-count {
  background: var(--purple-400);
  color: #000;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}

.mc-ann-list {
  display: flex;
  flex-direction: column;
}

/* Announcement Item */
.mc-ann-item {
  display: flex;
  gap: 12px;
  padding: 16px 20px;
  border: none;
  border-bottom: 1px solid var(--neutral-800);
  background: none;
  cursor: pointer;
  text-align: left;
  color: inherit;
  transition: background 0.15s;
  width: 100%;
}
.mc-ann-item:hover {
  background: var(--neutral-800);
}
.mc-ann-item.active {
  background: rgba(168, 85, 247, 0.08);
  border-left: 3px solid var(--purple-400);
}

.mc-ann-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--neutral-800);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.mc-ann-icon img {
  width: 18px;
  height: 18px;
  filter: invert(1);
  opacity: 0.7;
}

.mc-ann-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.mc-ann-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.mc-ann-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  white-space: nowrap;
}
.mc-ann-date {
  font-size: 11px;
  color: var(--neutral-500);
  white-space: nowrap;
}
.mc-ann-title {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mc-ann-preview {
  font-size: 12px;
  color: var(--neutral-400);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


/* ═══════════════════════════════════════════════════
   COLUMN 3: READING PANE
   ═══════════════════════════════════════════════════ */

.mc-reader {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.mc-reader-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--neutral-800);
}
.mc-reader-close {
  display: flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: var(--neutral-400);
  font-size: 13px;
  cursor: pointer;
  padding: 4px 0;
  transition: color 0.2s;
}
.mc-reader-close:hover { color: #fff; }
.mc-reader-close svg { flex-shrink: 0; }

.mc-reader-content {
  padding: 24px 20px;
  flex: 1;
  overflow-y: auto;
}
.mc-reader-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.mc-reader-title {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 20px;
  line-height: 1.3;
}
.mc-reader-body {
  font-size: 14px;
  color: var(--neutral-300);
  line-height: 1.7;
}
.mc-reader-body p {
  margin: 0 0 16px;
}
.mc-reader-body strong {
  color: #fff;
  font-weight: 600;
}
.mc-reader-list {
  margin: 0 0 16px;
  padding: 0 0 0 20px;
}
.mc-reader-list li {
  margin-bottom: 6px;
  color: var(--neutral-300);
}
.mc-reader-list li::marker {
  color: var(--purple-400);
}


/* ═══════════════════════════════════════════════════
   MOBILE TABS (hidden on desktop)
   ═══════════════════════════════════════════════════ */

.mc-mobile-tabs {
  display: none; /* Hidden on desktop */
}

/* ═══════════════════════════════════════════════════
   DELETE MODAL
   ═══════════════════════════════════════════════════ */

.mc-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: mcFadeIn 0.2s ease;
}
.mc-modal {
  background: var(--neutral-800);
  border: 1px solid var(--neutral-700);
  border-radius: 20px;
  padding: 28px;
  max-width: 400px;
  width: calc(100% - 32px);
}
.mc-modal h3 { font-size: 20px; font-weight: 600; color: #fff; margin: 0 0 8px; }
.mc-modal p { font-size: 14px; color: var(--neutral-400); margin: 0 0 24px; line-height: 1.5; }
.mc-modal strong { color: #fff; }
.mc-modal-actions { display: flex; gap: 12px; justify-content: flex-end; }
.mc-btn-cancel {
  padding: 10px 20px;
  border-radius: 10px;
  border: 1px solid var(--neutral-600);
  background: transparent;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}
.mc-btn-cancel:hover { background: var(--neutral-700); }
.mc-btn-confirm {
  padding: 10px 20px;
  border-radius: 10px;
  border: none;
  background: #ef4444;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}
.mc-btn-confirm:hover { opacity: 0.85; }

@keyframes mcFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}


/* ═══════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════ */

/* Tablet: hide reader, show as overlay */
@media (max-width: 1200px) {
  .mc-layout {
    grid-template-columns: 1fr 300px;
  }
  .mc-layout.reader-open {
    grid-template-columns: 1fr 300px;
  }
  /* Reader becomes a fixed overlay */
  .mc-col-reader {
    position: fixed;
    top: 72px;
    right: 0;
    bottom: 0;
    width: 420px;
    background: var(--neutral-900);
    border-left: 1px solid var(--neutral-700);
    z-index: 100;
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.4);
  }
}

/* Mobile: tab-based single column */
@media (max-width: 768px) {
  .mc-layout {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 72px);
    overflow: hidden;
  }
  .mc-layout.reader-open {
    display: flex;
    flex-direction: column;
  }

  /* ── Mobile Tab Bar ── */
  .mc-mobile-tabs {
    display: flex;
    gap: 0;
    padding: 8px 12px 0;
    border-bottom: 1px solid var(--neutral-800);
    flex-shrink: 0;
  }
  .mc-mobile-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 0;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--neutral-500);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
  }
  .mc-mobile-tab.active {
    color: #fff;
    border-bottom-color: var(--purple-400);
  }
  .mc-tab-badge {
    background: var(--purple-400);
    color: #000;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 8px;
    min-width: 18px;
    text-align: center;
  }

  /* Tab visibility */
  .mc-mobile-hidden { display: none !important; }
  .mc-mobile-visible { display: flex !important; }

  .mc-col {
    border-right: none;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
  }
  .mc-col-messages {
    padding: 0 12px;
    flex-direction: column;
  }
  .mc-col-announcements {
    flex-direction: column;
    border-top: none;
  }

  /* Hide "New Chat" button on mobile — tab bar replaces it */
  .mc-btn-new { display: none; }

  /* Reader becomes full overlay on mobile */
  .mc-col-reader {
    position: fixed;
    inset: 0;
    width: 100%;
    background: var(--neutral-900);
    z-index: 200;
    box-shadow: none;
    border: none;
    animation: mcSlideUp 0.25s ease-out;
    overflow-y: auto;
  }
  @keyframes mcSlideUp {
    from { opacity: 0; transform: translateY(100%); }
    to   { opacity: 1; transform: translateY(0); }
  }

  .mc-header-title h2 { font-size: 20px; }
  .mc-avatar { width: 48px; height: 48px; }
  .mc-chat-item { padding: 10px 8px; }
  .mc-chat-name { font-size: 14px; }
  .mc-chat-preview { font-size: 12px; }
  .mc-chat-body { min-width: 0; overflow: hidden; }
  .mc-delete-btn { opacity: 0.4; }

  /* Announcements compact on mobile */
  .mc-ann-item { padding: 12px 16px; }
  .mc-ann-icon { width: 32px; height: 32px; }
  .mc-ann-title { font-size: 13px; }
  .mc-ann-preview { font-size: 11px; }
}
