/* Chat élève <-> professeur : page élève (mon-prof.html), fil de messages et lien de navigation.
   Le panel prof (prof.html) a sa propre feuille : css/panel.css. */

/* ---------- Fil de messages ---------- */
.pc-thread {
  --pc-mine-bg: #ef4a34;
  --pc-mine-fg: #fff;
  --pc-theirs-bg: #fff;
  --pc-theirs-fg: #14141a;
  --pc-theirs-border: #e6ddc8;
  --pc-muted: #83838a;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.pc-thread.pc-theme-dark {
  --pc-theirs-bg: #1f2028;
  --pc-theirs-fg: #f2f2f5;
  --pc-theirs-border: #3a3a44;
  --pc-muted: #8f8f99;
}

.pc-day {
  align-self: center;
  margin: 0.6rem 0 0.15rem;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--pc-muted);
}

.pc-row {
  display: flex;
  width: 100%;
}

.pc-row--mine {
  justify-content: flex-end;
}

.pc-bubble {
  max-width: min(84%, 480px);
  padding: 0.55rem 0.8rem 0.4rem;
  border-radius: 16px;
  font-size: 0.95rem;
  line-height: 1.45;
}

.pc-row--mine .pc-bubble {
  background: var(--pc-mine-bg);
  color: var(--pc-mine-fg);
  border-bottom-right-radius: 5px;
}

.pc-row--theirs .pc-bubble {
  background: var(--pc-theirs-bg);
  color: var(--pc-theirs-fg);
  border: 1px solid var(--pc-theirs-border);
  border-bottom-left-radius: 5px;
}

.pc-author {
  display: block;
  margin-bottom: 0.15rem;
  font-size: 0.72rem;
  font-weight: 800;
  color: #c93620;
}

.pc-theme-dark .pc-author {
  color: #ff8a72;
}

.pc-body {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.pc-meta {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.25rem;
  font-size: 0.68rem;
  opacity: 0.75;
  font-variant-numeric: tabular-nums;
}

.pc-receipt--read {
  font-weight: 800;
  opacity: 1;
}

.pc-empty {
  margin: auto;
  padding: 1.5rem 1rem;
  max-width: 34ch;
  text-align: center;
  color: var(--pc-muted, #83838a);
  font-size: 0.92rem;
  line-height: 1.5;
}

/* ---------- Page élève (mon-prof.html) ---------- */
.pc-page {
  max-width: 760px;
}

.pc-notice {
  margin: 0 0 1rem;
  padding: 0.8rem 1rem;
  border-radius: 12px;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.5;
}

.pc-notice--info {
  background: #fdf0c7;
  color: #6b4d0a;
}

.pc-notice--error {
  background: #fde4de;
  color: #a12a17;
}

.pc-card {
  background: #fff;
  border: 1px solid var(--border, #e6ddc8);
  border-radius: 16px;
  box-shadow: var(--shadow-md, 0 8px 24px rgba(20, 20, 26, 0.08));
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.pc-card[hidden] {
  display: none;
}

.pc-card__head {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid var(--border, #e6ddc8);
}

/* Rond du professeur (initiales ou photo) : le fond et la couleur viennent de css/chat-avatars.css (.chat-av) */
.pc-avatar {
  width: 2.75rem;
  height: 2.75rem;
  font-size: 1rem;
}

.pc-card__who {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.pc-card__name {
  font-size: 1.02rem;
  font-weight: 800;
  color: #14141a;
  overflow-wrap: anywhere;
}

.pc-card__sub {
  font-size: 0.78rem;
  font-weight: 600;
  color: #83838a;
}

.pc-messages {
  height: min(58vh, 520px);
  min-height: 260px;
  overflow-y: auto;
  padding: 1rem 1.1rem;
  background: #f7f2ea;
}

.pc-messages.pc-thread {
  justify-content: flex-start;
}

.pc-compose {
  display: flex;
  align-items: flex-end;
  gap: 0.6rem;
  padding: 0.8rem 1rem;
  border-top: 1px solid var(--border, #e6ddc8);
  background: #fff;
}

.pc-compose textarea {
  flex: 1 1 auto;
  min-height: 2.75rem;
  max-height: 8rem;
  resize: vertical;
  padding: 0.65rem 0.8rem;
  border: 1.5px solid var(--border, #d5c9a8);
  border-radius: 10px;
  font: inherit;
  font-size: 0.95rem;
  line-height: 1.4;
  color: #14141a;
  background: #fff;
}

.pc-compose textarea:focus {
  outline: 2px solid #ef4a34;
  outline-offset: 1px;
  border-color: #ef4a34;
}

.pc-compose .btn {
  flex: 0 0 auto;
  min-height: 2.75rem;
}

.pc-counter {
  align-self: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: #c93620;
  white-space: nowrap;
}

.pc-hint {
  margin: 0;
  padding: 0.55rem 1.1rem 0.8rem;
  font-size: 0.76rem;
  font-weight: 600;
  color: #83838a;
  background: #fff;
}

.pc-page-links {
  margin-top: 1rem;
  font-size: 0.9rem;
}

@media (prefers-reduced-motion: no-preference) {
  .pc-compose .btn { transition: background 0.15s ease, transform 0.15s ease; }
}

@media (max-width: 560px) {
  .pc-messages { height: min(62vh, 480px); }
  .pc-bubble { max-width: 92%; }
  .pc-compose { padding: 0.6rem; }
}

.pc-compose .visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
