/* ============================================================
   debate.css — Debate Arena styles
   ============================================================ */

.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 0 0;
  margin-bottom: 2rem;
  flex-wrap: nowrap;
  width: 100%;
}

.nav-back {
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
  text-decoration: none;
  background: rgba(255,255,255,0.10);
  border: 0.5px solid rgba(255,255,255,0.20);
  border-radius: 999px;
  padding: 5px 14px;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.nav-back:hover {
  background: rgba(255,255,255,0.18);
  color: #ffffff;
}

.nav-center {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-logo {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.50);
}

.nav-mode {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 12px;
  border-radius: 999px;
}

.debate-mode {
  background: rgba(168,158,245,0.15);
  color: #a89ef5;
  border: 0.5px solid rgba(168,158,245,0.35);
}

.nav-provider {
  font-size: 11px;
  color: rgba(255,255,255,0.30);
  background: rgba(255,255,255,0.06);
  border: 0.5px solid rgba(255,255,255,0.10);
  border-radius: 999px;
  padding: 3px 10px;
}


/* ── Page header ──────────────────────────────────────────── */
.page-header {
  text-align: center;
  padding: 0 1rem 2rem;
}

.page-header h1 {
  font-size: 36px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
}

.page-header h1 span { color: #a89ef5; }

.page-tagline {
  font-size: 14px;
  color: rgba(255,255,255,0.50);
  max-width: 460px;
  margin: 0 auto;
  line-height: 1.6;
}

.header-divider {
  height: 1px;
  background: linear-gradient(to right,
    transparent, rgba(255,255,255,0.08), transparent);
  margin: 0 0 2rem;
}


/* ── Section label ────────────────────────────────────────── */
.section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.30);
  margin-bottom: 0.85rem;
}


/* ── Agent cards ──────────────────────────────────────────── */
.agents-section { margin-bottom: 2rem; }

#agentCards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.agent-card {
  background: rgba(255,255,255,0.04);
  border: 1.5px solid;
  border-radius: 16px;
  padding: 1.25rem 0.85rem 1rem;
  text-align: center;
  backdrop-filter: blur(12px);
  transition: transform 0.18s ease, box-shadow 0.18s ease,
              background 0.18s ease;
}

.agent-card:hover {
  transform: translateY(-3px);
  background: rgba(255,255,255,0.07);
  box-shadow: 0 8px 32px rgba(0,0,0,0.35);
}

.agent-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  margin: 0 auto 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.agent-name        { font-size: 13px; font-weight: 600; color: #ffffff; margin-bottom: 3px; }
.agent-role        { font-size: 11px; color: rgba(255,255,255,0.55); margin-bottom: 3px; }
.agent-institution { font-size: 10px; color: rgba(255,255,255,0.30); font-style: italic; }


/* ── Topic section ────────────────────────────────────────── */
.topic-section { margin-bottom: 1.25rem; }

.topic-controls {
  display: flex;
  gap: 10px;
  align-items: center;
}

#topicSelect {
  flex: 1;
  font-size: 14px;
  padding: 0.7rem 1rem;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  background: rgba(255,255,255,0.06);
  color: #ffffff;
  cursor: pointer;
  outline: none;
  transition: border-color 0.18s ease;
  appearance: auto;
}

#topicSelect:focus    { border-color: #a89ef5; }
#topicSelect:disabled { opacity: 0.35; cursor: not-allowed; }
#topicSelect option   { background: #1a1928; color: #ffffff; }

#startBtn {
  font-size: 14px;
  font-weight: 600;
  padding: 0.7rem 1.6rem;
  border-radius: 10px;
  border: none;
  background: #534AB7;
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.18s ease, transform 0.18s ease,
              opacity 0.18s ease;
}

#startBtn:hover:not(:disabled) {
  background: #3C3489;
  transform: translateY(-1px);
}

#startBtn:disabled { opacity: 0.35; cursor: not-allowed; }

#topicBanner {
  font-size: 13px;
  font-weight: 500;
  color: #a89ef5;
  background: rgba(83,74,183,0.15);
  border: 0.5px solid rgba(83,74,183,0.35);
  border-radius: 10px;
  padding: 0.6rem 1rem;
  margin-top: 0.75rem;
  line-height: 1.5;
}

#topicBanner.hidden { display: none; }


/* ── Debate feed ──────────────────────────────────────────── */
.feed-section { margin-bottom: 1.25rem; }

#debateFeed {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  min-height: 380px;
  max-height: 540px;
  overflow-y: auto;
  padding: 1.5rem;
  scroll-behavior: smooth;
  backdrop-filter: blur(12px);
}

#debateFeed::-webkit-scrollbar       { width: 4px; }
#debateFeed::-webkit-scrollbar-track { background: transparent; }
#debateFeed::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.12);
  border-radius: 99px;
}

.feed-empty {
  text-align: center;
  color: rgba(255,255,255,0.20);
  font-size: 14px;
  padding: 5rem 2rem;
  line-height: 2;
}


/* ── Messages ─────────────────────────────────────────────── */
.message-wrap {
  margin-bottom: 1.25rem;
  animation: fadeSlideIn 0.24s ease both;
}

.message-wrap--student {
  display: flex;
  justify-content: flex-end;
}

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.message {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 1.1rem 1.25rem;
  max-width: 86%;
}

.message--student {
  background: rgba(83,74,183,0.18);
  border-color: rgba(83,74,183,0.35);
  max-width: 68%;
}

.message--moderator {
  background: rgba(255,255,255,0.03);
  border: 1px dashed rgba(255,255,255,0.12);
  max-width: 100%;
}

.message--typing {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 0.9rem 1.25rem;
}

.message-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 0.65rem;
}

.message-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.message-meta       { display: flex; flex-direction: column; gap: 1px; }
.message-name       { font-size: 13px; font-weight: 600; }
.message-role       { font-size: 11px; color: rgba(255,255,255,0.50); }
.message-institution{ font-size: 10px; color: rgba(255,255,255,0.28); font-style: italic; }

.message-text {
  font-size: 14px;
  color: rgba(255,255,255,0.88);
  line-height: 1.75;
}

.message-text p            { margin-bottom: 0.5rem; }
.message-text p:last-child { margin-bottom: 0; }

.summary-badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.45);
  border: 0.5px solid rgba(255,255,255,0.14);
  border-radius: 999px;
  padding: 3px 10px;
}

.typing-dots       { display: flex; gap: 5px; padding: 4px 2px; }

.typing-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,0.30);
  animation: typingBounce 1.3s infinite ease-in-out;
}

.typing-dots span:nth-child(2) { animation-delay: 0.18s; }
.typing-dots span:nth-child(3) { animation-delay: 0.36s; }

@keyframes typingBounce {
  0%, 80%, 100% { transform: translateY(0);    opacity: 0.35; }
  40%           { transform: translateY(-5px); opacity: 1;    }
}

.message-actions { margin-top: 0.75rem; }

.vote-btn {
  font-size: 11px;
  font-weight: 500;
  color: rgba(255,255,255,0.35);
  background: transparent;
  border: 0.5px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  padding: 3px 12px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.vote-btn:hover:not(:disabled) {
  background: rgba(168,158,245,0.15);
  color: #a89ef5;
  border-color: rgba(168,158,245,0.35);
}

.vote-btn.voted {
  background: rgba(168,158,245,0.15);
  color: #a89ef5;
  border-color: rgba(168,158,245,0.35);
  cursor: default;
}

.vote-count { font-weight: 700; }


/* ── Q&A section ──────────────────────────────────────────── */
#qaSection {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  padding: 1.4rem 1.5rem;
  margin-bottom: 1rem;
  backdrop-filter: blur(12px);
}

#qaSection.hidden { display: none; }

.qa-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.28);
  margin-bottom: 0.75rem;
}

.qa-controls { display: flex; gap: 10px; }

#studentQ {
  flex: 1;
  font-size: 14px;
  padding: 0.7rem 1rem;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  background: rgba(255,255,255,0.07);
  color: #ffffff;
  outline: none;
  transition: border-color 0.18s ease, background 0.18s ease;
}

#studentQ:focus        { border-color: #6ecfad; background: rgba(255,255,255,0.10); }
#studentQ::placeholder { color: rgba(255,255,255,0.25); }

#askBtn {
  font-size: 13px;
  font-weight: 600;
  padding: 0.7rem 1.4rem;
  border-radius: 10px;
  border: none;
  background: #0F6E56;
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.18s ease, transform 0.18s ease;
}

#askBtn:hover:not(:disabled) {
  background: #085041;
  transform: translateY(-1px);
}

#askBtn:disabled { opacity: 0.35; cursor: not-allowed; }


/* ── Status bar ───────────────────────────────────────────── */
#statusBar {
  text-align: center;
  font-size: 12px;
  color: rgba(255,255,255,0.25);
  padding: 0.75rem 0 0;
  letter-spacing: 0.02em;
}


/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 700px) {
  #agentCards             { grid-template-columns: repeat(2, 1fr); }
  .message                { max-width: 100%; }
  .message--student       { max-width: 90%; }
  .topic-controls         { flex-direction: column; }
  #startBtn               { width: 100%; }
  .page-header h1         { font-size: 26px; }
}
/* ── Custom topic input ───────────────────────────────────── */
.custom-topic-wrap {
  margin-top: 10px;
}

.custom-topic-wrap input {
  width: 100%;
  font-size: 14px;
  padding: 0.7rem 1rem;
  border: 1px solid rgba(168,158,245,0.35);
  border-radius: 10px;
  background: rgba(83,74,183,0.10);
  color: #ffffff;
  outline: none;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.custom-topic-wrap input:focus {
  border-color: #a89ef5;
  background: rgba(83,74,183,0.18);
}

.custom-topic-wrap input::placeholder {
  color: rgba(255,255,255,0.25);
}

.custom-topic-wrap.hidden { display: none; }


/* ── Prompt refiner for Q&A ───────────────────────────────── */
.refiner-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(168,158,245,0.20);
  border-radius: 16px;
  padding: 1.1rem 1.25rem;
  backdrop-filter: blur(12px);
  margin-bottom: 0.85rem;
}

.refiner-title {
  font-size: 13px;
  font-weight: 600;
  color: #a89ef5;
  margin-bottom: 4px;
}

.refiner-sub {
  font-size: 12px;
  color: rgba(255,255,255,0.40);
  margin-bottom: 0.75rem;
  line-height: 1.55;
}

.refiner-card textarea {
  width: 100%;
  font-size: 13px;
  padding: 0.65rem 0.9rem;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 8px;
  background: rgba(255,255,255,0.06);
  color: #ffffff;
  outline: none;
  resize: vertical;
  line-height: 1.6;
  font-family: inherit;
  transition: border-color 0.18s ease;
  margin-bottom: 0.65rem;
}

.refiner-card textarea:focus        { border-color: #a89ef5; }
.refiner-card textarea::placeholder { color: rgba(255,255,255,0.22); }

.refine-btn {
  width: 100%;
  font-size: 13px;
  font-weight: 600;
  padding: 0.65rem;
  border-radius: 10px;
  border: 1px solid rgba(168,158,245,0.40);
  background: rgba(168,158,245,0.12);
  color: #a89ef5;
  cursor: pointer;
  transition: all 0.18s ease;
}

.refine-btn:hover:not(:disabled) {
  background: rgba(168,158,245,0.22);
  transform: translateY(-1px);
}

.refine-btn:disabled { opacity: 0.40; cursor: not-allowed; }

.refined-box {
  margin-top: 0.85rem;
  background: rgba(168,158,245,0.06);
  border: 1px solid rgba(168,158,245,0.25);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  animation: fadeSlideIn 0.22s ease both;
}

.refined-box.hidden { display: none; }

.refined-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #a89ef5;
  margin-bottom: 0.5rem;
}

.refined-text {
  font-size: 13px;
  color: rgba(255,255,255,0.85);
  line-height: 1.65;
  margin-bottom: 0.75rem;
}

.refined-actions { display: flex; gap: 8px; }

.use-btn {
  font-size: 12px;
  font-weight: 600;
  padding: 5px 16px;
  border-radius: 999px;
  border: none;
  background: #534AB7;
  color: #fff;
  cursor: pointer;
  transition: background 0.18s ease;
}

.use-btn:hover { background: #3C3489; }

.discard-btn {
  font-size: 12px;
  font-weight: 500;
  padding: 5px 14px;
  border-radius: 999px;
  border: 0.5px solid rgba(255,255,255,0.15);
  background: transparent;
  color: rgba(255,255,255,0.40);
  cursor: pointer;
  transition: all 0.18s ease;
}

.discard-btn:hover {
  color: #ffffff;
  border-color: rgba(255,255,255,0.30);
}

.clear-btn {
  font-size: 12px;
  font-weight: 500;
  padding: 5px 14px;
  border-radius: 999px;
  border: 0.5px solid rgba(168,158,245,0.25);
  background: transparent;
  color: #a89ef5;
  cursor: pointer;
  transition: all 0.18s ease;
  margin-left: auto;
}

.clear-btn:hover {
  background: rgba(168,158,245,0.10);
  border-color: rgba(168,158,245,0.45);
}