/* ===== CONTENT AREA ===== */
.content-area {
  flex: 1;
  display: flex;
  overflow: hidden;
}

/* Video panel — slides in from top when active */
.video-panel {
  display: none;
  flex-direction: column;
  background: #0d0e10;
  border-bottom: 2px solid var(--rule);
  overflow: hidden;
  flex-shrink: 0;
  transition: height 0.3s ease;
}
.video-panel.open {
  display: flex;
  height: 200px;
}
.video-panel.has-screen { height: 240px; }

.video-grid {
  flex: 1;
  display: flex;
  gap: 6px;
  padding: 8px 10px;
  overflow-x: auto;
  align-items: center;
  justify-content: flex-start;
}

.v-tile {
  position: relative;
  background: #2a2820;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 284px;
  height: 160px;
  border: 1.5px solid transparent;
  transition: border-color 0.2s;
}
.v-tile.is-screen {
  width: 360px;
  height: 202px;
  border-color: rgba(212,116,42,0.4);
}
.v-tile.speaking { border-color: rgba(58,122,90,0.7); }

.v-tile-hover {
  position: absolute; inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(0,0,0,0.55);
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 2;
}
.v-tile:hover .v-tile-hover { opacity: 1; }
.v-tile-btn {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  color: white;
  font-size: 12px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.12s;
  white-space: nowrap;
}
.v-tile-btn:hover { background: rgba(255,255,255,0.28); }

.v-tile.theater {
  width: 568px;
  height: 320px;
}
.v-tile.theater.is-screen {
  width: 720px;
  height: 404px;
}

.v-tile video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.v-tile-av {
  width: 52px; height: 52px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 21px; font-weight: 700; color: white;
  font-family: 'DM Serif Display', serif;
}
.v-tile-label {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 6px 8px;
  background: linear-gradient(transparent, rgba(0,0,0,0.75));
  font-size: 13px; color: rgba(255,255,255,0.85);
  font-weight: 500;
  display: flex; align-items: center; gap: 4px;
}
.v-tile-label .muted-icon { font-size: 13px; margin-left: auto; opacity: 0.7; }
.screen-tag {
  position: absolute;
  top: 7px; left: 7px;
  font-size: 10px;
  font-family: 'DM Mono', monospace;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--amber);
  color: white;
  padding: 2px 6px; border-radius: 3px;
}

/* ===== CHAT ===== */
.chat-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* Vertical layout: video panel above chat */
.chat-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px 8px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.messages::-webkit-scrollbar { width: 5px; }
.messages::-webkit-scrollbar-track { background: transparent; }
.messages::-webkit-scrollbar-thumb { background: var(--rule); border-radius: 3px; }

/* Date divider */
.date-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 16px 0 8px;
  color: var(--ink3);
  font-size: 13px;
  font-family: 'DM Mono', monospace;
  letter-spacing: 0.06em;
}
.date-divider::before, .date-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--rule);
}

/* Message */
.msg-row {
  display: flex;
  gap: 12px;
  padding: 3px 6px;
  border-radius: 5px;
  transition: background 0.1s;
}
.msg-row:hover { background: var(--paper2); }
.msg-row.continuation { padding-top: 1px; padding-bottom: 1px; }
.msg-row.continuation .msg-meta { display: none; }
.msg-row.continuation .msg-av.placeholder {
  width: 38px; height: 0; min-height: 0;
  align-self: flex-start; margin-top: 0;
}

.msg-av {
  width: 38px; height: 38px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: white;
  flex-shrink: 0;
  font-family: 'DM Serif Display', serif;
  margin-top: 1px;
}
.msg-av.placeholder { background: transparent; }

.msg-body { flex: 1; min-width: 0; }
.msg-meta { display: flex; align-items: baseline; gap: 8px; margin-bottom: 2px; }
.msg-author {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
}
.msg-time {
  font-size: 10.5px;
  color: var(--ink3);
  font-family: 'DM Mono', monospace;
}
.msg-time-cont {
  display: block;
  font-size: 10px;
  color: var(--ink3);
  font-family: 'DM Mono', monospace;
  margin-left: 42px;
  margin-top: -2px;
  margin-bottom: 2px;
  opacity: 0;
  transition: opacity 0.15s;
}
.msg-row:hover .msg-time-cont { opacity: 1; }
.msg-text {
  font-size: 13.5px;
  color: var(--ink3);
  line-height: 1.55;
  word-break: break-word;
}

/* System message */
.sys-row {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 6px;
  font-size: 11.5px;
  color: var(--ink3);
  font-family: 'DM Mono', monospace;
}
.sys-row::before { content:''; flex:1; height:1px; background:var(--rule); }
.sys-row::after { content:''; flex:1; height:1px; background:var(--rule); }

/* Input */
.input-area {
  padding: 10px 20px 16px;
  flex-shrink: 0;
  display: flex;
  align-items: flex-end;
  gap: 10px;
}
.input-area > .input-shell {
  flex: 1;
  min-width: 0;
}
.input-shell {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: var(--paper3);
  border: 1.5px solid var(--ink3);
  border-radius: 10px;
  padding: 6px 10px 6px 16px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.input-shell:focus-within {
  border-color: var(--ink3);
  box-shadow: 0 0 0 3px rgba(0,0,0,0.04);
}
.chat-input {
  flex: 1;
  background: none; border: none; outline: none;
  font-family: 'DM Sans', sans-serif;
  font-size: 13.5px;
  color: var(--ink);
  resize: none;
  padding: 6px 0;
  max-height: 120px;
  line-height: 1.5;
}
.chat-input::placeholder { color: var(--ink3); }
.send-btn {
  width: 32px; height: 32px;
  background: var(--accent);
  border: none; border-radius: 7px;
  color: white;
  font-size: 16px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
  margin-bottom: 2px;
}
.send-btn:hover { opacity: 0.82; }

.quick-emojis {
  display: flex; gap: 2px; align-items: center;
  padding: 0 0 4px;
}
.qe-btn {
  background: none; border: none;
  font-size: 20px; cursor: pointer;
  padding: 3px 5px; border-radius: 5px;
  transition: background 0.12s; line-height: 1;
}
.qe-btn:hover { background: var(--paper2); }

/* ===== RIGHT PANEL ===== */
.right-panel {
  width: 240px;
  background: var(--paper);
  border-left: 1.5px solid var(--rule);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex-shrink: 0;
}

/* Three-view panel system */
.rp-view {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}
.rp-view-header {
  font-size: 13px;
  font-family: 'DM Mono', monospace;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink3);
  padding: 12px 14px 8px;
  border-bottom: 1px solid var(--rule);
  flex-shrink: 0;
  font-weight: 600;
}
.rp-view-tabs {
  display: flex;
  gap: 2px;
  padding: 8px 10px 4px;
  flex-shrink: 0;
}
.rp-tab {
  flex: 1;
  padding: 5px 4px;
  background: none;
  border: 1.5px solid var(--rule);
  border-radius: 6px;
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  color: var(--ink3);
  cursor: pointer;
  transition: all 0.15s;
}
.rp-tab:hover { background: var(--paper2); color: var(--ink); }
.rp-tab.active { background: var(--accent); border-color: var(--accent); color: white; }
.rp-view-body {
  flex: 1;
  overflow-y: auto;
  padding: 6px 0;
  min-height: 0;
}
.rp-view-body::-webkit-scrollbar { width: 0; }

.rp-section { display: flex; flex-direction: column; }
.rp-section.in-channel { flex-shrink: 0; border-bottom: 1.5px solid var(--rule); }
.rp-section.members-sect { flex: 1; overflow-y: auto; min-height: 0; }
.rp-section.members-sect::-webkit-scrollbar { width: 0; }

.rp-header {
  display: flex; align-items: center;
  padding: 12px 14px 8px; gap: 6px; flex-shrink: 0;
}
.rp-header-label {
  font-size: 12px; font-family: 'DM Mono', monospace;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink3); flex: 1;
}
.rp-collapse-btn {
  background: none; border: none; color: var(--ink3);
  cursor: pointer; font-size: 13px; line-height: 1;
  padding: 2px 5px; border-radius: 3px; transition: all 0.15s;
  font-family: 'DM Mono', monospace; font-weight: 500;
}
.rp-collapse-btn:hover { color: var(--ink); background: var(--paper2); }

/* In-channel row */
.ic-row {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 14px; border-radius: 5px; margin: 1px 6px;
  transition: background 0.12s;
}
.ic-row:hover { background: var(--paper2); }
.ic-av {
  width: 36px; height: 36px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: white; flex-shrink: 0;
  font-family: 'DM Serif Display', serif;
}
.ic-name {
  font-size: 12.5px; font-weight: 500; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  flex: 1; min-width: 0;
}
/* Activity icons */
.ic-acts { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }
.act-icon {
  width: 18px; height: 18px; border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; opacity: 0.18; transition: all 0.22s;
  position: relative;
}
.act-icon.lit-voice  { opacity:1; color: var(--green);  background: rgba(58,122,90,0.12); }
.act-icon.lit-muted  { opacity:1; color: var(--red);    background: rgba(192,57,43,0.09); }
.act-icon.lit-cam    { opacity:1; color: var(--blue);   background: rgba(42,90,138,0.11); }
.act-icon.lit-screen { opacity:1; color: var(--amber);  background: rgba(212,116,42,0.11); }
.act-icon.lit-text   { opacity:1; color: var(--ink3);   background: rgba(74,70,64,0.1); }

@keyframes voicePulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(58,122,90,0.45); }
  50%      { box-shadow: 0 0 0 3px rgba(58,122,90,0); }
}
.act-icon.lit-voice { animation: voicePulse 1.6s ease infinite; }

/* Typing animation inside text icon */
.type-dots { display:flex; gap:1.5px; align-items:center; }
.type-dots span { display:block; width:2px; height:6px; background:currentColor; border-radius:1px; animation: tdot 1.1s ease infinite; }
.type-dots span:nth-child(2){ animation-delay:.18s; }
.type-dots span:nth-child(3){ animation-delay:.36s; }
@keyframes tdot{ 0%,80%,100%{opacity:.25;transform:scaleY(.5)} 40%{opacity:1;transform:scaleY(1)} }

/* Members section */
.members-body { overflow: hidden; }
.members-body.collapsed { display: none; }
.rp-sub-label {
  font-size: 12px; font-family: 'DM Mono', monospace;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink3); padding: 8px 14px 4px;
}
.m-row {
  display: flex; align-items: center; gap: 9px;
  padding: 5px 14px; border-radius: 5px; margin: 1px 6px;
  transition: background 0.12s;
}
.m-row:hover { background: var(--paper2); }
.m-av {
  width: 36px; height: 36px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: white; flex-shrink: 0;
  font-family: 'DM Serif Display', serif; position: relative;
}
.m-av::after {
  content:''; position:absolute; bottom:-1px; right:-1px;
  width:8px; height:8px; border-radius:50%; border:2px solid var(--paper);
}
.m-av.online::after  { background: var(--green); }
.m-av.idle::after    { background: #e8a020; }
.m-av.dnd::after     { background: var(--red); }
.m-av.offline::after { background: var(--ink3); }
.m-info { flex:1; min-width:0; }
.m-name { font-size:12.5px; font-weight:500; color:var(--ink); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.m-sub  { font-size: 12px; color:var(--ink3); font-family:'DM Mono',monospace; }
.m-row.offline-row { opacity: 0.45; }
.m-row.offline-row:hover { opacity: 0.7; }


/* ── Mic / speaking indicators ───────────────────────────────────────────── */
.mic-icon {
  position: relative;
  font-size: 16px;
  line-height: 1;
  opacity: 0.4;
}
.mic-icon.speaking {
  opacity: 1;
  filter: drop-shadow(0 0 5px var(--green));
  animation: mic-pulse 1.4s ease-in-out infinite;
}
.mic-icon.muted {
  opacity: 1;
  filter: drop-shadow(0 0 4px var(--red));
}
.mic-cross {
  position: absolute;
  top: -4px; right: -6px;
  font-size: 10px;
  font-weight: 900;
  color: var(--red);
  line-height: 1;
}
/* Avatar glows green when speaking */
.speaking-av {
  box-shadow: 0 0 0 2.5px var(--green);
}
@keyframes mic-pulse {
  0%, 100% { filter: drop-shadow(0 0 3px var(--green)); }
  50%       { filter: drop-shadow(0 0 8px var(--green)); }
}
