/* Home — mobile-first. Base = celular; md (768px) em diante vira tabela. */
.home-body { min-height: 100vh; }

.home-top { padding-top: 20px; padding-bottom: 6px; }
.brand {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  border-radius: 10px;
  background: var(--green);
  color: #0f1419;
  font-size: 16px;
}
.brand-tag { color: var(--muted); margin: 10px 0 0; font-size: 14px; }

.home-main { padding-top: 12px; padding-bottom: 48px; }
.home-head h1 { font-size: 22px; margin: 10px 0 4px; font-weight: 600; }
.home-head p { font-size: 14px; }

/* ---- Barra de filtros (grid do Bootstrap no HTML) ---- */
.filters { margin-top: 12px; margin-bottom: 14px; }
.filter-search { position: relative; }
.filter-search .search-ico {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  opacity: .6;
  pointer-events: none;
}
.filter-search .form-control { padding-left: 34px; }

.result-bar { margin-bottom: 10px; }
.result-count {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .5px;
  font-weight: 600;
  color: var(--muted);
  font-family: var(--mono);
}

/* ---- Lista de lições ----
   Celular: cada <tr> vira um card (título em cima, tags e ações embaixo). */
.table-wrap {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.lessons-table { width: 100%; font-size: 14px; }
.lessons-table,
.lessons-table tbody,
.lessons-table tr,
.lessons-table td { display: block; }

/* Cabeçalho escondido visualmente no celular (continua acessível a leitores de tela) */
.lessons-table thead {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.lessons-table tbody tr {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 14px;
  border-bottom: 1px solid var(--border);
  transition: background .15s;
}
.lessons-table tbody tr:last-child { border-bottom: none; }
.lessons-table tbody tr:hover { background: var(--card2); }
.lessons-table tbody td { padding: 0; }

.lessons-table .col-title { flex: 1 1 100%; min-width: 0; }
.lessons-table .col-actions { margin-left: auto; }

.cell-title { font-weight: 600; color: var(--text); }
.cell-preview {
  font-size: 13px;
  color: var(--muted);
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tag-topic, .tag-level, .tag-accent {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 999px;
}
.tag-topic { background: rgba(155,89,182,.15); color: var(--purple); }
.tag-level { background: var(--good-bg); color: var(--green); }
.tag-accent { background: var(--card2); color: var(--muted); font-family: var(--mono); }

.badge-audio {
  display: inline-block;
  font-size: 11px;
  color: var(--blue);
  background: rgba(52,152,219,.15);
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: 4px;
}

.col-count .num { font-family: var(--mono); font-weight: 600; font-size: 13px; color: var(--muted); }
.col-count .num::after { content: " frases"; font-family: var(--sans); font-weight: 400; }

.row-actions { display: inline-flex; gap: 8px; justify-content: flex-end; }
.lc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  text-decoration: none;
  border-radius: 8px;
  padding: 7px 11px;
  font-size: 16px;
  line-height: 1;
  border: 1px solid transparent;
  transition: background .2s, transform .1s;
}
.lc-btn:active { transform: scale(.95); }
.lc-btn.lc-btn-shadow { background: var(--green); color: #0f1419; }
.lc-btn.lc-btn-shadow:hover { background: #27ae60; }
.lc-btn.listen { background: rgba(52,152,219,.15); color: var(--blue); border-color: rgba(52,152,219,.3); }
.lc-btn.listen:hover { background: rgba(52,152,219,.25); }

.lessons-table .row-empty td { flex: 1 1 100%; text-align: center; padding: 28px 0; }

/* ---- Paginação ---- */
.pager-bar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}
.page-size {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}
.page-size .form-select { width: auto; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pager .btn { flex: 1 1 0; }
.page-info {
  font-size: 13px;
  color: var(--muted);
  font-family: var(--mono);
  text-align: center;
  white-space: nowrap;
}

/* ==========================================================================
   Breakpoints (mobile-first)
   ========================================================================== */
@media (min-width: 576px) {
  .pager-bar { flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: wrap; }
  .pager .btn { flex: 0 0 auto; }
  .page-info { min-width: 120px; }
}

/* Tablet/desktop: volta a ser tabela */
@media (min-width: 768px) {
  .home-top { padding-top: 28px; }
  .brand { font-size: 20px; }
  .brand-tag { font-size: 15px; }
  .home-main { padding-top: 20px; padding-bottom: 60px; }
  .home-head h1 { font-size: 26px; }

  .lessons-table { display: table; border-collapse: collapse; }
  .lessons-table thead {
    display: table-header-group;
    position: static;
    width: auto; height: auto;
    overflow: visible;
    clip: auto;
  }
  .lessons-table tbody { display: table-row-group; }
  .lessons-table tr,
  .lessons-table tbody tr { display: table-row; padding: 0; border-bottom: none; }
  .lessons-table th,
  .lessons-table td { display: table-cell; }

  .lessons-table thead th {
    text-align: left;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .5px;
    font-weight: 600;
    color: var(--muted);
    padding: 12px 14px;
    background: var(--card2);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
  }
  .lessons-table tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
  }
  .lessons-table tbody tr:last-child td { border-bottom: none; }

  .lessons-table .col-actions { margin-left: 0; }
  .col-count, .col-actions { text-align: right; white-space: nowrap; }
  .col-level, .col-accent { white-space: nowrap; }
  .col-count .num { font-size: 15px; color: var(--text); }
  .col-count .num::after { content: none; }
  .cell-preview { max-width: 420px; }
  .lessons-table .row-empty td { padding: 40px 14px; }

  .lc-btn { min-width: 38px; min-height: 36px; font-size: 15px; }

  /* Sotaque só aparece a partir de lg, como antes */
  .lessons-table .col-accent { display: none; }
}

@media (min-width: 992px) {
  .lessons-table .col-accent { display: table-cell; }
}
