/* static/css/practice_points.css */
/* Practice Points styling — light theme, matches EchoVQ platform palette */

/* ─── Tier accent tokens ─────────────────────────────────────────────
   --pp-color  = saturated accent for label / progress fill / chip border
   --pp-tint   = soft tinted background (used on chips, locked states) */
.pp-tier-bronze    { --pp-color: #b45309; --pp-tint: #fef3ec; }
.pp-tier-silver    { --pp-color: #4b5563; --pp-tint: #f3f4f6; }
.pp-tier-gold      { --pp-color: #d97706; --pp-tint: #fffbeb; }
.pp-tier-diamond   { --pp-color: #0891b2; --pp-tint: #ecfeff; }
.pp-tier-prismatic { --pp-color: #9333ea; --pp-tint: #f5f3ff; }

/* ─── Sidebar rank card ─── */
.pp-sidebar-card {
  display: block;
  padding: 10px 12px;
  margin: 12px 0;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.pp-sidebar-card:hover {
  border-color: var(--pp-color, #9333ea);
  transform: translateY(-1px);
}
.pp-sidebar-tier { font-size: 10px; letter-spacing: 1px; color: var(--pp-color); font-weight: 700; }
.pp-sidebar-pts  { font-size: 14px; font-weight: 700; color: #111827; margin-top: 2px; }
.pp-sidebar-bar  { height: 4px; background: #f3f4f6; border-radius: 999px; margin-top: 6px; overflow: hidden; }
.pp-sidebar-fill { height: 100%; background: var(--pp-color); transition: width 0.3s ease; }
.pp-sidebar-next { font-size: 9px; color: #9ca3af; margin-top: 4px; }
.pp-sidebar-card.pp-locked {
  background: #f5f3ff;
  border: 1px dashed #c4b5fd;
}
.pp-sidebar-card.pp-locked .pp-sidebar-tier { color: #7c3aed; }
.pp-locked-rank { color: #4b5563; opacity: 0.75; }
.pp-locked-cta { color: #9333ea !important; font-weight: 600; }

/* ─── Dashboard widget ─── */
.pp-dash-widget {
  display: block;
  padding: 16px;
  border-radius: 10px;
  background: #ffffff;
  color: #111827;
  text-decoration: none;
  border: 1px solid #e5e7eb;
  transition: border-color 0.15s ease;
}
.pp-dash-widget:hover { border-color: var(--pp-color, #9333ea); }
.pp-dash-icon  { font-size: 28px; }
.pp-dash-tier  { font-size: 11px; letter-spacing: 1px; color: var(--pp-color); margin-top: 8px; font-weight: 700; }
.pp-dash-pts   { font-size: 18px; font-weight: 700; color: #111827; }
.pp-dash-next  { font-size: 11px; color: #6b7280; margin-top: 4px; }
.pp-dash-bar   { height: 6px; background: #f3f4f6; border-radius: 999px; margin-top: 6px; overflow: hidden; }
.pp-dash-fill  { height: 100%; background: var(--pp-color); }
.pp-dash-recent { margin-top: 10px; padding-top: 10px; border-top: 1px solid #f3f4f6; }
.pp-dash-recent-label { font-size: 9px; color: #9ca3af; letter-spacing: 1px; }
.pp-dash-recent-row { font-size: 11px; color: #4b5563; margin-top: 2px; }

/* ─── Achievements page hero ─── */
.pp-hero {
  padding: 20px;
  border-radius: 12px;
  background: #ffffff;
  color: #111827;
  border: 1px solid #e5e7eb;
  margin-bottom: 24px;
}
.pp-hero-label { font-size: 10px; letter-spacing: 1.5px; color: var(--pp-color); font-weight: 700; }
.pp-hero-row { display: flex; align-items: center; gap: 16px; margin-top: 8px; }
.pp-hero-emoji { font-size: 42px; }
.pp-hero-name  { font-size: 24px; font-weight: 700; color: #111827; }
.pp-hero-pts   { font-size: 14px; color: #6b7280; }
.pp-hero-bar-wrap { margin-top: 14px; }
.pp-hero-bar  { height: 8px; background: #f3f4f6; border-radius: 999px; overflow: hidden; }
.pp-hero-fill { height: 100%; background: var(--pp-color); transition: width 0.3s ease; }
.pp-hero-bar-meta { display: flex; justify-content: space-between; font-size: 11px; color: #9ca3af; margin-top: 4px; }
.pp-hero-links { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 12px; }
.pp-hero-history-link { color: #9333ea; text-decoration: none; font-size: 12px; font-weight: 600; }
.pp-hero-history-link:hover { text-decoration: underline; }

/* Locked hero (free user) */
.pp-hero-locked { position: relative; }
.pp-hero-locked .pp-hero-blur { filter: blur(3px); opacity: 0.5; pointer-events: none; }
.pp-hero-lock-overlay {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; padding: 16px; text-align: center;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 12px;
}
.pp-hero-lock-icon { font-size: 32px; }
.pp-hero-lock-title { font-size: 18px; font-weight: 700; color: #111827; }
.pp-hero-lock-copy { font-size: 13px; color: #4b5563; max-width: 320px; }
.pp-hero-lock-cta {
  padding: 10px 18px;
  background: linear-gradient(135deg, #a78bfa, #ec4899);
  color: #ffffff; border-radius: 8px;
  font-weight: 700; text-decoration: none;
}

/* ─── Rank ladder accordion ─── */
.pp-ladder { margin-bottom: 24px; }
.pp-ladder summary {
  cursor: pointer; padding: 12px 16px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px; color: #111827; font-weight: 600;
  list-style: none;
}
.pp-ladder summary::-webkit-details-marker { display: none; }
.pp-ladder summary::before { content: '▶'; font-size: 10px; color: #6b7280; transition: transform 0.15s; display: inline-block; margin-right: 6px; }
.pp-ladder details[open] summary::before { transform: rotate(90deg); }
.pp-ladder details[open] summary { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.pp-ladder-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
  padding: 12px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-top: none;
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
}
.pp-ladder-row {
  display: grid; grid-template-columns: 30px 30px 1fr auto;
  gap: 8px; align-items: center;
  padding: 8px 10px; border-radius: 6px;
  background: #f9fafb;
  border-left: 3px solid transparent;
}
.pp-ladder-row.earned {
  border-left-color: var(--pp-color);
  background: #ffffff;
}
.pp-ladder-row.locked { opacity: 0.55; }
.pp-ladder-num   { font-size: 10px; color: #9ca3af; font-family: monospace; }
.pp-ladder-emoji { font-size: 18px; }
.pp-ladder-name  { color: #111827; font-size: 13px; font-weight: 600; }
.pp-ladder-pts   { font-size: 11px; color: #6b7280; font-family: monospace; }
@media (max-width: 700px) { .pp-ladder-grid { grid-template-columns: 1fr; } }

/* ─── Badge bonus chip (on existing badge grid) ─── */
.pp-badge-bonus {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px; font-weight: 600;
  background: var(--pp-tint);
  color: var(--pp-color);
  border: 1px solid var(--pp-color);
  margin-top: 4px;
}

/* ─── Earn toasts (fixed, bottom-right) ─── */
/* Toasts intentionally use solid colour so they pop against any background. */
#pp-toast-container {
  position: fixed; bottom: 20px; right: 20px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 9999; pointer-events: none;
}
.pp-toast {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 999px;
  font-size: 13px; font-weight: 600; color: #ffffff;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.18);
  animation: pp-toast-in 0.25s ease-out, pp-toast-out 0.25s ease-in 2.25s forwards;
  pointer-events: auto;
}
.pp-toast.pp-toast-normal    { background: linear-gradient(135deg, #10b981, #06b6d4); }
.pp-toast.pp-toast-big       { background: linear-gradient(135deg, #a78bfa, #ec4899); }
.pp-toast.pp-toast-throttled { background: #6b7280; color: #ffffff; }
.pp-toast.pp-toast-throttled .pp-toast-pts { color: #fde68a; }
@keyframes pp-toast-in  { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes pp-toast-out { to { transform: translateX(40px); opacity: 0; } }

/* ─── Rank-up modal ─── */
#pp-rankup-overlay {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: none; align-items: center; justify-content: center;
  z-index: 10000;
}
#pp-rankup-overlay.visible { display: flex; }
.pp-rankup-modal {
  padding: 32px; border-radius: 16px;
  text-align: center; max-width: 380px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.25);
  position: relative;
}
.pp-rankup-label  { font-size: 11px; letter-spacing: 2px; color: var(--pp-color); font-weight: 700; }
.pp-rankup-emoji  { font-size: 56px; margin: 16px 0 4px; }
.pp-rankup-title  { font-size: 18px; font-weight: 600; color: #4b5563; }
.pp-rankup-rank   { font-size: 32px; font-weight: 800; color: #111827; margin-top: 4px; }
.pp-rankup-meta   { font-size: 12px; color: #6b7280; margin-top: 12px; }
.pp-rankup-bonus  {
  display: inline-block; margin-top: 14px;
  padding: 6px 14px;
  background: var(--pp-tint);
  border: 1px solid var(--pp-color);
  border-radius: 999px;
  font-size: 13px; color: var(--pp-color); font-weight: 600;
}
.pp-rankup-cta    {
  display: block; width: 100%; margin-top: 20px;
  padding: 12px;
  background: #9333ea;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  text-align: center; text-decoration: none;
  font-weight: 600; cursor: pointer;
}
.pp-rankup-cta:hover { background: #7c3aed; }

/* ─── Backfill banner ─── */
.pp-backfill-banner {
  display: flex; gap: 12px; align-items: center;
  padding: 12px 16px;
  background: #f5f3ff;
  border: 1px solid #c4b5fd;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 13px; color: #4b5563;
}
.pp-backfill-banner strong { color: #111827; }
.pp-backfill-banner-text { flex: 1; }
.pp-backfill-banner-dismiss {
  padding: 6px 14px;
  background: #ffffff;
  border: 1px solid #c4b5fd;
  color: #7c3aed; border-radius: 6px;
  cursor: pointer; font-size: 12px;
  font-weight: 600;
}
.pp-backfill-banner-dismiss:hover { background: #f5f3ff; }

/* ─── History page filter chips ─── */
.pp-history-filter {
  padding: 6px 12px;
  background: #ffffff;
  border-radius: 999px;
  color: #4b5563;
  font-size: 12px;
  text-decoration: none;
  border: 1px solid #e5e7eb;
}
.pp-history-filter:hover { border-color: #c4b5fd; color: #7c3aed; }
.pp-history-filter.active {
  background: #9333ea;
  color: #ffffff;
  border-color: #9333ea;
  font-weight: 600;
}
.pp-history-row {
  display: grid; grid-template-columns: 30px 60px 1fr auto;
  gap: 12px; padding: 10px 14px;
  border-bottom: 1px solid #f3f4f6;
  color: #111827;
}
.pp-history-icon { font-size: 18px; }
.pp-history-points { font-weight: 700; color: #059669; }
.pp-history-date { font-size: 11px; color: #9ca3af; }
.pp-history-empty { padding: 32px; text-align: center; color: #6b7280; }
.pp-history-pagination { font-size: 12px; color: #6b7280; }
.pp-history-pagination a { color: #9333ea; text-decoration: none; }
.pp-history-pagination a:hover { text-decoration: underline; }

/* ─── Settings section ─── */
.pp-settings-section h3 { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.pp-settings-section .hint { font-size: 12px; color: #6b7280; margin-bottom: 12px; }
.pp-toggle-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; cursor: pointer; }
.pp-toggle-row input[type="checkbox"] { accent-color: #9333ea; width: 16px; height: 16px; }
