/* =============================================================
   Página Materiais de Palestras e Cursos — CRC-ES
   ============================================================= */

/* ── Barra de busca ──────────────────────────────────────────── */

.crc-mat-search-wrapper {
  position: relative;
  max-width: 560px;
}

.crc-mat-search-wrapper .bi-search {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #7a8fa8;
  font-size: 1rem;
  pointer-events: none;
}

.crc-mat-search-input {
  width: 100%;
  padding: 0.7rem 1rem 0.7rem 2.75rem;
  border: 1.5px solid #d0dae6;
  border-radius: 8px;
  font-size: 0.92rem;
  color: #2d3d50;
  background-color: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  outline: none;
}

.crc-mat-search-input:focus {
  border-color: var(--crc-primary-navy, #003366);
  box-shadow: 0 0 0 3px rgba(0, 51, 102, 0.12);
}

.crc-mat-search-btn {
  padding: 0.7rem 1.4rem;
  background-color: var(--crc-primary-navy, #003366);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease;
  white-space: nowrap;
}

.crc-mat-search-btn:hover {
  background-color: #004080;
}

.crc-mat-clear-btn {
  font-size: 0.82rem;
  color: #7a8fa8;
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
  transition: color 0.15s;
}

.crc-mat-clear-btn:hover {
  color: #c0392b;
}

/* ── Contador de resultados ──────────────────────────────────── */

.crc-mat-count {
  font-size: 0.83rem;
  color: #7a8fa8;
  font-style: italic;
}

/* ── Tabela de materiais ─────────────────────────────────────── */

.crc-mat-table-wrapper {
  background: #fff;
  border: 1px solid #dce6f0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 51, 102, 0.07);
}

.crc-mat-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  color: #2d3d50;
}

.crc-mat-table thead th {
  background-color: var(--crc-primary-navy, #003366);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.85rem 1rem;
  border: none;
  white-space: nowrap;
}

.crc-mat-table tbody tr {
  border-bottom: 1px solid #edf2f7;
  transition: background-color 0.15s ease;
}

.crc-mat-table tbody tr:last-child {
  border-bottom: none;
}

.crc-mat-table tbody tr:hover {
  background-color: #f5f8fc;
}

.crc-mat-table td {
  padding: 0.85rem 1rem;
  vertical-align: middle;
}

/* Coluna de data */
.crc-mat-data {
  white-space: nowrap;
  min-width: 100px;
  font-weight: 600;
  color: var(--crc-primary-navy-strong, #002244);
}

/* Coluna de título */
.crc-mat-titulo {
  font-size: 0.9rem;
  color: #2d3d50;
  line-height: 1.5;
}

/* ── Botões de ação da tabela ─────────────────────────────────── */

.crc-mat-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.8rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.crc-mat-btn--anexos {
  background-color: #fff3cd;
  color: #856404;
  border: 1px solid #ffc107;
}

.crc-mat-btn--anexos:hover {
  background-color: #ffc107;
  color: #212529;
}

.crc-mat-btn--sem-anexo {
  color: #c0ccdb;
  font-size: 0.75rem;
  background: none;
  border: none;
  cursor: default;
  padding: 0;
}

/* ── Paginação ───────────────────────────────────────────────── */

.crc-mat-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  padding-top: 1.5rem;
}

.crc-mat-pagination .page-link {
  border-radius: 6px !important;
  font-size: 0.85rem;
  color: var(--crc-primary-navy, #003366);
  border: 1px solid #d0dae6;
  padding: 0.4rem 0.75rem;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.crc-mat-pagination .page-link:hover {
  background-color: var(--crc-primary-navy, #003366);
  color: #fff;
  border-color: var(--crc-primary-navy, #003366);
}

.crc-mat-pagination .page-item.active .page-link {
  background-color: var(--crc-primary-navy, #003366);
  border-color: var(--crc-primary-navy, #003366);
  color: #fff;
  font-weight: 700;
}

.crc-mat-pagination .page-item.disabled .page-link {
  color: #b0bec5;
  pointer-events: none;
}

/* ── Modal de arquivos ───────────────────────────────────────── */

.crc-mat-modal .modal-header {
  background-color: var(--crc-primary-navy, #003366);
  color: #fff;
  border-radius: 12px 12px 0 0;
  padding: 1.1rem 1.5rem;
}

.crc-mat-modal .modal-header .btn-close {
  filter: brightness(0) invert(1);
}

.crc-mat-modal .modal-title {
  font-size: 0.97rem;
  font-weight: 700;
  line-height: 1.4;
}

.crc-mat-modal .modal-content {
  border-radius: 12px;
  border: none;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
}

.crc-mat-modal .modal-body {
  padding: 1.5rem;
}

/* ── Lista de arquivos no modal ──────────────────────────────── */

.crc-mat-anexos-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.crc-mat-anexos-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  background-color: #f5f8fc;
  transition: background-color 0.15s ease;
}

.crc-mat-anexos-item:hover {
  background-color: #e8f0fb;
}

/* Cabeçalho de categoria dentro do modal */
.crc-mat-anexos-categoria {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #7a8fa8;
  padding: 0.5rem 0 0.25rem;
  border-top: 1px solid #e6ecf3;
  margin-top: 0.5rem;
}

.crc-mat-anexos-categoria:first-child {
  border-top: none;
  margin-top: 0;
  padding-top: 0;
}

/* Badge de extensão do arquivo */
.crc-mat-ext-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.6rem;
  font-size: 0.64rem;
  font-weight: 800;
  padding: 0.18rem 0.35rem;
  border-radius: 4px;
  background-color: var(--crc-primary-navy, #003366);
  color: #fff;
  flex-shrink: 0;
  text-transform: uppercase;
}

.crc-mat-ext-badge--pdf  { background-color: #c0392b; }
.crc-mat-ext-badge--doc,
.crc-mat-ext-badge--docx { background-color: #2980b9; }
.crc-mat-ext-badge--xls,
.crc-mat-ext-badge--xlsx { background-color: #27ae60; }
.crc-mat-ext-badge--ppt,
.crc-mat-ext-badge--pptx { background-color: #e67e22; }
.crc-mat-ext-badge--zip,
.crc-mat-ext-badge--rar,
.crc-mat-ext-badge--7z   { background-color: #8e44ad; }
.crc-mat-ext-badge--mp4,
.crc-mat-ext-badge--avi,
.crc-mat-ext-badge--mov  { background-color: #16a085; }
.crc-mat-ext-badge--mp3  { background-color: #d35400; }

/* Ícone de arquivo dentro do item */
.crc-mat-file-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
  color: var(--crc-primary-navy, #003366);
  opacity: 0.75;
}

.crc-mat-anexos-link {
  font-size: 0.875rem;
  color: #2d3d50;
  text-decoration: none;
  flex: 1;
  min-width: 0;
  word-break: break-word;
  transition: color 0.15s;
}

.crc-mat-anexos-link:hover {
  color: var(--crc-primary-navy, #003366);
  text-decoration: underline;
}

/* ── Estado vazio ────────────────────────────────────────────── */

.crc-mat-empty {
  text-align: center;
  padding: 3.5rem 1rem;
  color: #7a8fa8;
}

.crc-mat-empty i {
  font-size: 2.5rem;
  opacity: 0.4;
  display: block;
  margin-bottom: 0.75rem;
}

.crc-mat-empty p {
  font-size: 0.95rem;
  margin: 0;
}

/* ── Responsivo ──────────────────────────────────────────────── */

@media (max-width: 767px) {
  .crc-mat-table td,
  .crc-mat-table th {
    padding: 0.65rem 0.65rem;
  }

  .crc-mat-data {
    min-width: 80px;
  }
}

@media (max-width: 575px) {
  .crc-mat-search-wrapper {
    max-width: 100%;
  }
}
