/* css/report.css — Estilos da página de Relatório de Desempenho */
/* Reutiliza as variáveis CSS do style.css (:root) */

/* ========== CONTAINER PRINCIPAL ========== */
.container-report {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 20px 60px;
}

/* ========== CABEÇALHO ========== */
.report-header {
  text-align: center;
  margin-bottom: 36px;
  padding-top: 16px;
}

.report-header h1 {
  font-size: 30px;
  font-weight: 700;
  background: var(--gradient-hybrid);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  width: auto;
  margin: 0 0 8px;
}

.report-subtitle {
  color: var(--text-secondary);
  font-size: 15px;
}

/* ========== LOADING / ERRO ========== */
.report-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 80px 0;
  color: var(--text-secondary);
}

.loading-spinner {
  width: 44px;
  height: 44px;
  border: 4px solid var(--border-light);
  border-top-color: var(--primary-blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.report-error {
  text-align: center;
  padding: 60px 0;
  color: #e74c3c;
}

.btn-reload {
  margin-top: 16px;
  padding: 10px 24px;
  background: var(--gradient-primary);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s;
}

.btn-reload:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(26, 111, 168, 0.3);
}

/* ========== SUMMARY CARDS ========== */
.summary-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.summary-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 2px 8px var(--shadow-light);
  transition: transform 0.2s, box-shadow 0.2s;
}

.summary-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px var(--shadow-medium);
}

.summary-icon {
  font-size: 28px;
  line-height: 1;
}

.summary-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.summary-valor {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary-blue);
  line-height: 1;
}

.summary-label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ========== TABS ========== */
.report-tabs {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 4px;
  margin-bottom: 0;
  border-bottom: 2px solid var(--border-light);
}

.tabs-grupo-esq,
.tabs-grupo-dir {
  display: flex;
  align-items: flex-end;
  gap: 4px;
}

/* Abas do grupo direito: visual mais discreto */
.tab-btn-alt {
  font-size: 13px;
  padding: 10px 16px;
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
  border-bottom-color: transparent;
  border-radius: 8px 8px 0 0;
}

.tab-btn {
  padding: 12px 20px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
  border-radius: 8px 8px 0 0;
}

.tab-btn:not(.active) {
  border-color: var(--border-light);
  border-bottom-color: transparent;
  background: var(--bg-light);
}

.tab-btn:hover {
  background: #e8edf3;
  color: var(--primary-blue);
  border-color: #b0b8c6;
  border-bottom-color: transparent;
}

.tab-btn.active {
  color: var(--primary-blue);
  border-color: var(--border-light);
  border-bottom: 3px solid var(--primary-blue);
  background: white;
}

/* Abas do grupo direito: com contorno */
.tab-btn-alt:hover {
  color: var(--text-primary);
  background: var(--bg-light);
  border-color: #b0b8c6;
  border-bottom-color: transparent;
}

.tab-btn-alt.active {
  color: var(--text-primary);
  border-color: var(--border-light);
  border-bottom-color: white;
  background: white;
}

/* ========== TAB PANELS ========== */
.tab-panel {
  display: none;
  background: white;
  border-radius: 0 0 12px 12px;
  padding: 24px;
  box-shadow: 0 2px 8px var(--shadow-light);
}

.tab-panel.active {
  display: block;
}

.panel-section-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border-light);
}

/* ========== ACCORDION ========== */
.accordion-item {
  border: 1px solid var(--border-light);
  border-radius: 8px;
  margin-bottom: 10px;
  overflow: clip; /* clip visual sem bloquear scroll de filhos */
}

.accordion-header {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-light);
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background 0.2s;
  font-size: 14px;
}

.accordion-header:hover {
  background: var(--primary-blue-light);
}

.accordion-header.open {
  background: var(--primary-blue-light);
  border-bottom: 1px solid var(--border-light);
}

.accordion-arrow {
  color: var(--primary-blue);
  font-size: 12px;
  flex-shrink: 0;
  transition: transform 0.2s;
}

.accordion-nome {
  flex: 1;
  font-weight: 600;
  color: var(--text-primary);
}

.accordion-meta {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.accordion-body {
  padding: 0;
  overflow-x: auto;
}

/* ========== TABELA DE LIÇÕES ========== */
.licoes-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.licoes-table th {
  padding: 10px 12px;
  background: #f8f9fa;
  color: var(--text-secondary);
  font-weight: 600;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.licoes-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #f2f2f2;
  vertical-align: middle;
}

.licoes-table tr:last-child td {
  border-bottom: none;
}

.licoes-table .row-feita td {
  background: #fafffe;
}

.licoes-table .row-todo td {
  color: var(--text-muted);
}

.licoes-table tr:hover td {
  background: var(--primary-blue-light);
}

/* Colunas */
.col-status { width: 32px; text-align: center; }
.col-titulo  { min-width: 160px; }
.col-progresso { width: 120px; }
.col-acertos { width: 68px; text-align: center; }
.col-1a      { width: 68px; text-align: center; }
.col-best    { width: 68px; text-align: center; }
.col-media   { width: 90px; text-align: center; }
.col-tempo   { width: 68px; text-align: center; }
.col-data    { width: 84px; text-align: center; }

/* ========== PROGRESS BAR ========== */
.progress-bar-wrap {
  height: 7px;
  background: var(--border-light);
  border-radius: 6px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.6s ease;
}

/* ========== BADGES ========== */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
}

.badge-green  { background: #e8f8f0; color: #1e8449; }
.badge-yellow { background: #fef9e7; color: #b7770d; }
.badge-red    { background: #fdf0ef; color: #c0392b; }
.badge-none   { background: #f2f2f2; color: #999; }

.badge-global-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.badge-users {
  font-size: 10px;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* ========== STATUS ICONS ========== */
.status-icon { font-size: 14px; }
.status-done { }
.status-todo { color: var(--border-light); font-size: 16px; }
.status-locked { font-size: 13px; opacity: 0.7; }

/* ========== LINHAS BLOQUEADAS (tabela) ========== */
.licoes-table .row-locked td {
  opacity: 0.45;
  font-style: italic;
  pointer-events: none;
}

.accordion-locked-count {
  font-size: 11px;
  font-weight: 500;
  color: #999;
  margin-left: 4px;
}
  font-size: 12px;
  color: var(--text-muted);
  padding-left: 8px !important;
}

/* ========== CARDS BLOQUEADOS (V4 / PBQ) ========== */
.card-flat-locked {
  opacity: 0.45;
  pointer-events: none;
  filter: grayscale(0.25);
}

.card-flat-locked .card-flat-header {
  background: var(--border-light);
}

.locked-msg {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
  padding: 4px 0;
}

/* ========== BANNER CTA PREMIUM ========== */
.premium-cta-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(135deg, #6b3d9b 0%, #1a3a6a 100%);
  border-radius: 12px;
  padding: 18px 24px;
  margin-bottom: 28px;
  color: white;
  box-shadow: 0 4px 16px rgba(26, 111, 168, 0.3);
}

.cta-icon {
  font-size: 28px;
  flex-shrink: 0;
}

.cta-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cta-text strong {
  font-size: 15px;
  font-weight: 700;
}

.cta-text span {
  font-size: 13px;
  opacity: 0.85;
}

.cta-btn {
  flex-shrink: 0;
  padding: 10px 20px;
  background: #f5a623;
  color: #1a1a1a;
  border-radius: 8px;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  transition: background 0.2s, transform 0.2s;
  white-space: nowrap;
}

.cta-btn:hover {
  background: #e6940f;
  transform: translateY(-1px);
}

@media (max-width: 600px) {
  .premium-cta-banner {
    flex-direction: column;
    text-align: center;
  }
  .cta-btn {
    width: 100%;
    text-align: center;
  }
}

/* ========== CARDS FLAT (V4 / PBQ) ========== */
.cards-flat {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.card-flat {
  border: 1px solid var(--border-light);
  border-radius: 10px;
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
}

.card-flat:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(26, 111, 168, 0.12);
}

.card-flat-done {
  border-color: #95c952;
}

.card-flat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: var(--bg-light);
  font-size: 14px;
  font-weight: 600;
}

.card-flat-body {
  padding: 12px 16px;
  background: white;
}

.card-flat-meta {
  display: flex;
  gap: 12px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-secondary);
  flex-wrap: wrap;
  align-items: center;
}

.meta-tempo, .meta-data {
  white-space: nowrap;
}

.empty-msg {
  padding: 24px;
  color: var(--text-muted);
  text-align: center;
  font-size: 14px;
}

/* ========== GRÁFICO DE EVOLUÇÃO (V4 SIMULADOS) ========== */
#v4-content .cards-flat {
  grid-template-columns: 1fr;
  max-width: 680px;
}

.chart-historico {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
}

.chart-historico-titulo {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 2px;
}

/* ========== PROGRESSO GERAL ========== */
.progresso-geral-section {
  background: white;
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 24px;
  box-shadow: 0 2px 8px var(--shadow-light);
}

.pg-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.pg-titulo {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.pg-counter {
  font-size: 13px;
  color: var(--text-secondary);
}

.pg-counter strong {
  color: var(--primary-blue);
}

.pg-bar-segmentada {
  display: flex;
  height: 14px;
  border-radius: 8px;
  overflow: hidden;
  background: #dde1e7;
  margin-bottom: 12px;
}

.pg-seg {
  height: 100%;
  transition: width 0.5s ease;
}

.pg-seg-green  { background: #27ae60; }
.pg-seg-yellow { background: #f39c12; }
.pg-seg-red    { background: #e74c3c; }
.pg-seg-gray   { background: #dde1e7; }

.pg-legenda {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.pg-leg-item {
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.pg-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.pg-dot-green  { background: #27ae60; }
.pg-dot-yellow { background: #f39c12; }
.pg-dot-red    { background: #e74c3c; }
.pg-dot-gray   { background: #dde1e7; border: 1px solid #bbb; }

/* ========== BADGE NO BOTÃO DE ABA ========== */
.tab-badge {
  display: inline-block;
  background: #e74c3c;
  color: white;
  font-size: 10px;
  font-weight: 700;
  border-radius: 10px;
  padding: 1px 6px;
  margin-left: 4px;
  vertical-align: middle;
  line-height: 14px;
}

/* ========== PONTOS FRACOS ========== */
.pf-intro {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.pf-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 0;
}

.pf-header-ok .pf-titulo { color: #27ae60; }
.pf-titulo { font-size: 15px; font-weight: 700; }
.pf-subtitulo { font-size: 13px; color: var(--text-secondary); }

.pf-cols-header {
  display: grid;
  grid-template-columns: 50px 1fr 70px 100px 80px;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pf-row {
  display: grid;
  grid-template-columns: 50px 1fr 70px 100px 80px;
  gap: 8px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
}

.pf-row:last-of-type { border-bottom: none; }

.pf-versao {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  background: var(--bg-light);
  border-radius: 4px;
  padding: 2px 6px;
  text-align: center;
}

.pf-nome {
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pf-score, .pf-media { text-align: center; }

.pf-link {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary-blue);
  text-decoration: none;
  white-space: nowrap;
}

.pf-link:hover { text-decoration: underline; }

/* ========== VOCÊ VS. TURMA ========== */
.vt-subtitle {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 8px 0 12px;
}

.vt-grupos { display: flex; flex-direction: column; gap: 12px; }

.vt-grupo { display: flex; flex-direction: column; gap: 4px; }

.vt-grupo-nome {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.vt-feitas {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-secondary);
}

.vt-bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}

.vt-bar-label {
  width: 55px;
  flex-shrink: 0;
  color: var(--text-secondary);
  font-size: 11px;
}

.vt-bar-bg {
  flex: 1;
  height: 10px;
  background: var(--bg-light);
  border-radius: 6px;
  overflow: hidden;
}

.vt-bar-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.5s ease;
}

.vt-bar-user  { background: var(--primary-blue); }
.vt-bar-class { background: #95a5a6; }

.vt-bar-val {
  width: 36px;
  text-align: right;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  flex-shrink: 0;
}

.vt-nota {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 16px;
  font-style: italic;
}

/* ========== RESPONSIVO ========== */
@media (max-width: 900px) {
  .summary-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .container-report {
    padding: 16px 12px 40px;
  }

  .summary-cards {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .summary-card {
    padding: 14px;
    gap: 12px;
  }

  .summary-valor {
    font-size: 18px;
  }

  .tab-btn {
    padding: 10px 12px;
    font-size: 12px;
  }

  .report-tabs {
    flex-wrap: wrap;
    gap: 2px;
  }

  .tabs-grupo-dir {
    border-top: 1px solid var(--border-light);
    padding-top: 4px;
    width: 100%;
  }

  .tab-panel {
    padding: 12px 8px;
  }

  .accordion-body {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Tabela: min-width força overflow → scroll horizontal aparece */
  .licoes-table {
    width: auto;
    min-width: 460px;
  }

  .col-best, .col-media, .col-tempo, .col-data, .col-progresso {
    display: table-cell;
  }

  .col-titulo {
    min-width: 160px;
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .cards-flat {
    grid-template-columns: 1fr;
  }
}
