/* Public ask page (u.html) — builds on the tokens/components in styles.css */

.nav-slim { max-width: 640px; }

.ask-wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 16px 20px 64px;
}

.hidden { display: none !important; }
.center { text-align: center; }
.muted { color: var(--text-muted); }
.muted-sm { color: var(--text-muted); font-size: 12px; font-weight: 500; }

/* ---------- Cards ---------- */
.ask-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  backdrop-filter: blur(14px);
  padding: 28px 24px;
  margin-bottom: 18px;
  animation: cardIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(18px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

/* ---------- Profile head ---------- */
.profile-head { text-align: center; margin-bottom: 22px; }

.avatar {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  font-size: 36px;
  font-weight: 900;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), #d946ef, var(--accent));
  background-size: cover;
  background-position: center;
  box-shadow: 0 12px 36px rgba(139, 92, 246, 0.45);
  animation: avatarPop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes avatarPop {
  from { transform: scale(0.6); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.profile-head h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.5px; }
.handle { color: var(--secondary); font-weight: 600; font-size: 14px; margin-top: 2px; }
.bio { margin-top: 10px; font-size: 15px; }

/* ---------- Mode switch ---------- */
.mode-switch {
  display: flex;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 16px;
}
.mode {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  padding: 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}
.mode.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
}

/* ---------- Composer ---------- */
.composer textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 16px;
  font-size: 16px;
  font-family: inherit;
  color: var(--text);
  resize: vertical;
  min-height: 110px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.composer textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.18);
}
.composer textarea::placeholder { color: rgba(244, 241, 250, 0.38); }

.composer-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}
.counter { font-size: 13px; color: var(--text-muted); font-variant-numeric: tabular-nums; }

.btn-ghost {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: var(--text);
  padding: 13px 22px;
  font-size: 15px;
}

.composer-msg { min-height: 22px; margin-top: 10px; font-size: 14px; font-weight: 600; }
.composer-msg.err { color: #f87171; }
.composer-msg.ok { color: #34d399; }

.anon-note {
  margin-top: 18px;
  font-size: 12.5px;
  color: rgba(244, 241, 250, 0.45);
  text-align: center;
  line-height: 1.5;
}

.big-emoji { font-size: 52px; margin-bottom: 12px; }

/* ---------- Voice recorder ---------- */
.recorder {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 10px 6px;
}

.rec-button {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 2px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.04);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.15s ease;
  flex-shrink: 0;
}
.rec-button:hover { transform: scale(1.05); border-color: var(--accent); }

.rec-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #f43f5e;
  transition: border-radius 0.25s ease, transform 0.25s ease;
}

/* Recording: dot becomes a square, button pulses */
.recorder[data-rec-state="recording"] .rec-button {
  border-color: #f43f5e;
  animation: recPulse 1.4s ease-in-out infinite;
}
.recorder[data-rec-state="recording"] .rec-dot {
  border-radius: 7px;
  transform: scale(0.72);
}
@keyframes recPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(244, 63, 94, 0.4); }
  50% { box-shadow: 0 0 0 14px rgba(244, 63, 94, 0); }
}

.rec-info { display: flex; flex-direction: column; gap: 3px; }
.rec-label { font-weight: 700; font-size: 15px; }
.rec-timer { color: var(--text-muted); font-size: 13px; font-variant-numeric: tabular-nums; }

.rec-preview audio { width: 100%; margin-top: 6px; }

/* ---------- Success ---------- */
.sent-check {
  width: 76px;
  height: 76px;
  margin: 0 auto 16px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 36px;
  font-weight: 900;
  color: #fff;
  background: linear-gradient(135deg, #34d399, var(--secondary));
  animation: checkPop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes checkPop {
  0% { transform: scale(0); }
  70% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

.sent-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

/* ---------- My sent messages ---------- */
.mine-title { font-size: 15px; font-weight: 800; margin-bottom: 14px; }

.mine-list { list-style: none; display: flex; flex-direction: column; gap: 12px; }

.mine-item {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 12px 16px;
}
.mine-q { font-size: 14.5px; }
.mine-meta { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.mine-reply {
  margin-top: 10px;
  padding: 10px 12px;
  border-left: 3px solid var(--secondary);
  background: rgba(34, 211, 238, 0.07);
  border-radius: 0 10px 10px 0;
  font-size: 14px;
}
.mine-reply b { color: var(--secondary); font-size: 12px; display: block; margin-bottom: 2px; }

.get-own { text-align: center; font-size: 14px; color: var(--text-muted); margin-top: 6px; }
.get-own a { color: var(--secondary); font-weight: 700; text-decoration: none; }

/* ---------- Spinner ---------- */
.ask-state[data-state="loading"] { display: grid; place-items: center; padding: 80px 0; }

.spinner {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 3px solid var(--glass-border);
  border-top-color: var(--primary);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
