/* Rico aos Poucos — Card "Pódium da Comunidade — Top 10"
 *
 * Bloco full-width entre o grid de ferramentas e o de Reels na home.
 * Inspirado nos mega-cards (fundo escuro, glow temático, gradiente sutil).
 *
 * IMPORTANTE: este card vive dentro de uma <section>. O css/style.css aplica
 * padding 60px em <section> por padrão (memória do projeto). Neutralizamos
 * com :where(.podium-card) e usamos padding próprio.
 */

/* Wrapper "linha" da home — coluna única, full-width */
.home-content-grid--podium {
  margin-top: 20px;
  display: block;
}

/* Reset agressivo do padding global de <section> nesse card */
section.podium-card,
.podium-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 24px;
  border-radius: 18px;
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(214, 164, 45, 0.18) 0%, rgba(214, 164, 45, 0) 55%),
    radial-gradient(80% 60% at 0% 100%, rgba(63, 42, 12, 0.45) 0%, rgba(63, 42, 12, 0) 60%),
    linear-gradient(150deg, #1a1f2e 0%, #0d1117 70%);
  border: 1px solid rgba(214, 164, 45, 0.28);
  overflow: hidden;
  color: var(--text-primary, #f0f6fc);
  box-shadow: 0 10px 28px -16px rgba(0, 0, 0, 0.55);
}

/* Textura sutil */
.podium-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='40' height='40'><path d='M0 39L40 39M39 0L39 40' stroke='rgba(214,164,45,0.06)' stroke-width='1'/></svg>");
  pointer-events: none;
  opacity: 0.55;
}

/* Header */
.podium-header {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.podium-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.68rem;
  font-weight: 800;
  color: #f7c948;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.podium-eyebrow svg {
  width: 14px;
  height: 14px;
  display: inline-block;
  vertical-align: middle;
}

.podium-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: #f0f6fc;
}

.podium-sub {
  font-size: 0.92rem;
  color: var(--text-secondary, #8b949e);
  line-height: 1.5;
  margin: 0;
  max-width: 70ch;
}

/* Lista */
.podium-list {
  position: relative;
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

@media (min-width: 768px) {
  /* Em desktop, 2 colunas: ouro/prata/bronze à esquerda em destaque, 4-10 à direita.
     Simplificação: 2 colunas iguais. */
  .podium-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
}

/* Item da lista */
.podium-item {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(13, 17, 23, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  min-width: 0;
}

.podium-item:hover {
  transform: translateY(-1px);
  background: rgba(22, 30, 45, 0.7);
  border-color: rgba(214, 164, 45, 0.25);
}

/* Top 3 — destaques */
.podium-item--1 {
  background: linear-gradient(150deg, rgba(214, 164, 45, 0.18) 0%, rgba(13, 17, 23, 0.55) 70%);
  border-color: rgba(214, 164, 45, 0.55);
  box-shadow: inset 0 0 0 1px rgba(214, 164, 45, 0.15);
}

.podium-item--2 {
  background: linear-gradient(150deg, rgba(192, 192, 192, 0.12) 0%, rgba(13, 17, 23, 0.55) 70%);
  border-color: rgba(192, 192, 192, 0.4);
}

.podium-item--3 {
  background: linear-gradient(150deg, rgba(176, 105, 53, 0.14) 0%, rgba(13, 17, 23, 0.55) 70%);
  border-color: rgba(176, 105, 53, 0.45);
}

/* Rank chip */
.podium-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 32px;
  padding: 0 8px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 800;
  color: #c9d1d9;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.podium-item--1 .podium-rank {
  color: #1a1306;
  background: linear-gradient(135deg, #f7d465 0%, #d6a42d 100%);
  border-color: rgba(247, 212, 101, 0.6);
  box-shadow: 0 4px 12px -4px rgba(214, 164, 45, 0.55);
}

.podium-item--2 .podium-rank {
  color: #1a1a1a;
  background: linear-gradient(135deg, #e8e8e8 0%, #b3b3b3 100%);
  border-color: rgba(220, 220, 220, 0.55);
}

.podium-item--3 .podium-rank {
  color: #fff;
  background: linear-gradient(135deg, #cf8147 0%, #8a4d24 100%);
  border-color: rgba(207, 129, 71, 0.55);
}

/* Avatar */
.podium-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  background: #21262d;
  border: 2px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.podium-item--1 .podium-avatar { border-color: rgba(247, 212, 101, 0.7); }
.podium-item--2 .podium-avatar { border-color: rgba(220, 220, 220, 0.6); }
.podium-item--3 .podium-avatar { border-color: rgba(207, 129, 71, 0.65); }

/* Avatar placeholder (sem foto) */
.podium-avatar--placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.95rem;
  color: #1a1a1a;
  background: linear-gradient(135deg, #6b7280 0%, #374151 100%);
  text-transform: uppercase;
  line-height: 1;
}

/* Info */
.podium-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.podium-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: #f0f6fc;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  line-height: 1.2;
}

.podium-name:hover {
  color: #f7c948;
  text-decoration: underline;
}

.podium-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  font-size: 0.72rem;
  color: var(--text-muted, #8b949e);
  line-height: 1.3;
}

.podium-stats > span {
  white-space: nowrap;
}

.podium-stats strong {
  color: #f0f6fc;
  font-weight: 700;
}

/* Estados */
.podium-loading,
.podium-empty,
.podium-error {
  grid-column: 1 / -1;
  text-align: center;
  padding: 24px 12px;
  font-size: 0.9rem;
  color: var(--text-muted, #8b949e);
  font-style: italic;
}

/* CTA row — dois botões lado a lado */
.podium-cta-row {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.podium-cta {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  color: #f7c948;
  text-decoration: none;
  padding: 9px 14px;
  border-radius: 10px;
  border: 1px solid rgba(247, 201, 72, 0.35);
  background: rgba(247, 201, 72, 0.05);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.podium-cta svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.podium-cta:hover {
  background: rgba(247, 201, 72, 0.12);
  border-color: rgba(247, 201, 72, 0.6);
}

.podium-cta:focus-visible {
  outline: 2px solid #f7c948;
  outline-offset: 2px;
}

.podium-cta--secondary {
  color: #c9d1d9;
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
}

.podium-cta--secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.22);
  color: #f0f6fc;
}

/* ============================================================
   Modal "Como funciona a reputação" — lazy, anexado em <body>
   ============================================================ */
.podium-modal-backdrop[hidden] { display: none !important; }

.podium-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(8, 11, 18, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: podiumModalFadeIn 0.18s ease-out;
}

body.podium-modal-open {
  overflow: hidden;
}

@keyframes podiumModalFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes podiumModalSlideUp {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.podium-modal {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(214, 164, 45, 0.18) 0%, rgba(214, 164, 45, 0) 55%),
    linear-gradient(160deg, #1a1f2e 0%, #0d1117 75%);
  border: 1px solid rgba(214, 164, 45, 0.32);
  border-radius: 18px;
  box-shadow: 0 25px 60px -20px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.02);
  color: #f0f6fc;
  overflow: hidden;
  animation: podiumModalSlideUp 0.22s ease-out;
}

.podium-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  color: #c9d1d9;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
  z-index: 2;
}

.podium-modal-close svg { width: 18px; height: 18px; }

.podium-modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.18);
  color: #f0f6fc;
}

.podium-modal-close:focus-visible {
  outline: 2px solid #f7c948;
  outline-offset: 2px;
}

.podium-modal-header {
  padding: 22px 24px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  position: relative;
}

.podium-modal-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  color: #f7c948;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(247, 201, 72, 0.1);
  border: 1px solid rgba(247, 201, 72, 0.28);
  margin-bottom: 10px;
}

.podium-modal-title {
  margin: 0 0 6px;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #f0f6fc;
  line-height: 1.2;
  padding-right: 40px;
}

.podium-modal-sub {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text-secondary, #8b949e);
  line-height: 1.5;
}

.podium-modal-body {
  padding: 18px 24px;
  overflow-y: auto;
  flex: 1 1 auto;
  -webkit-overflow-scrolling: touch;
}

.podium-modal-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.podium-modal-list li {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(13, 17, 23, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  align-items: start;
}

.podium-modal-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(247, 201, 72, 0.08);
  border: 1px solid rgba(247, 201, 72, 0.18);
  font-size: 1.1rem;
  line-height: 1;
}

.podium-modal-list li > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.podium-modal-list strong {
  font-size: 0.95rem;
  font-weight: 700;
  color: #f0f6fc;
  line-height: 1.25;
}

.podium-modal-list span {
  font-size: 0.84rem;
  color: var(--text-secondary, #8b949e);
  line-height: 1.5;
}

.podium-modal-footer {
  padding: 14px 24px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-wrap: wrap-reverse;
  gap: 10px;
  justify-content: flex-end;
}

.podium-modal-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 10px 16px;
  border-radius: 10px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.podium-modal-btn svg { width: 16px; height: 16px; flex-shrink: 0; }

.podium-modal-btn--primary {
  color: #1a1306;
  background: linear-gradient(135deg, #f7d465 0%, #d6a42d 100%);
  border-color: rgba(247, 212, 101, 0.6);
  box-shadow: 0 6px 16px -6px rgba(214, 164, 45, 0.6);
}

.podium-modal-btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px -6px rgba(214, 164, 45, 0.7);
}

.podium-modal-btn--ghost {
  color: #c9d1d9;
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
}

.podium-modal-btn--ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
  color: #f0f6fc;
}

.podium-modal-btn:focus-visible {
  outline: 2px solid #f7c948;
  outline-offset: 2px;
}

@media (max-width: 480px) {
  .podium-modal { max-height: calc(100vh - 24px); border-radius: 16px; }
  .podium-modal-header { padding: 18px 18px 12px; }
  .podium-modal-title { font-size: 1.18rem; padding-right: 36px; }
  .podium-modal-sub { font-size: 0.85rem; }
  .podium-modal-body { padding: 14px 18px; }
  .podium-modal-footer { padding: 12px 18px 16px; }
  .podium-modal-btn { width: 100%; justify-content: center; }
  .podium-modal-list li { padding: 10px 12px; grid-template-columns: 32px 1fr; gap: 10px; }
  .podium-modal-icon { width: 32px; height: 32px; font-size: 1rem; }
  .podium-modal-list strong { font-size: 0.9rem; }
  .podium-modal-list span { font-size: 0.8rem; }
  .podium-cta-row { gap: 8px; }
  .podium-cta { font-size: 0.82rem; padding: 9px 12px; }
}

/* Mobile tweaks */
@media (max-width: 480px) {
  section.podium-card,
  .podium-card {
    padding: 18px;
    gap: 14px;
  }

  .podium-title {
    font-size: 1.25rem;
  }

  .podium-sub {
    font-size: 0.85rem;
  }

  .podium-item {
    padding: 10px 12px;
    gap: 10px;
  }

  .podium-avatar {
    width: 38px;
    height: 38px;
  }

  .podium-rank {
    min-width: 32px;
    height: 28px;
    font-size: 0.8rem;
  }

  .podium-stats {
    font-size: 0.68rem;
    gap: 2px 8px;
  }
}
