/* ============================================================
   ROOT — Cores, Radius, Shadows
============================================================ */
:root {
  --bg: #050509;
  --bg-alt: #0b0b12;
  --surface: #151524;
  --surface-soft: #1c1c2b;

  --primary: #4f46e5;
  --primary-soft: #6366f1;
  --accent: #22d3ee;

  --text: #f9fafb;
  --muted: #9ca3af;

  --radius-lg: 18px;
  --radius-md: 12px;

  --shadow-soft: 0 18px 45px rgba(0, 0, 0, 0.6);
}

/* ============================================================
   GLOBAL
============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: system-ui, -apple-system, "Inter", sans-serif;
  background: radial-gradient(circle at top, #111827 0, #020617 40%, #020617);
  color: var(--text);
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ============================================================
   HEADER
============================================================ */
.header {
  border-bottom: 1px solid rgba(148, 163, 184, 0.3);
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), #020617);
  backdrop-filter: blur(18px);
}

.header-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 18px 16px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-logo {
  height: 82px;
  width: auto;
  border-radius: 8px;
  object-fit: contain;
}

.header-titles h1 {
  font-size: clamp(1.4rem, 2.4vw, 2rem);
  margin: 0;
}

.subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.btn-site {
  margin-top: 10px;
  padding: 8px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary), var(--primary-soft));
  color: white;
  text-decoration: none;
  font-size: 0.85rem;
  box-shadow: 0 12px 30px rgba(79, 70, 229, 0.45);
  transition: transform 0.15s ease, filter 0.15s ease;
}

.btn-site:hover {
  transform: translateY(-1px);
  filter: brightness(1.07);
}

/* ============================================================
   MAIN
============================================================ */
.main {
  flex: 1;
  max-width: 1120px;
  margin: 0 auto;
  padding: 18px 16px 32px;
}

/* ============================================================
   FILTROS
============================================================ */
.filters {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.filters-left {
  display: flex;
  gap: 10px;
  flex: 1;
}

.filters input,
.filters select {
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: rgba(15, 23, 42, 0.9);
  color: var(--text);
  padding: 8px 12px;
  font-size: 0.9rem;
  outline: none;
  min-width: 0;
}

.filters input {
  flex: 1.4;
}

.filters select {
  flex: 0.8;
}

.filters input::placeholder {
  color: rgba(148, 163, 184, 0.9);
}

.count {
  font-size: 0.8rem;
  color: var(--muted);
}

/* ============================================================
   GRID
============================================================ */
.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.card {
  background: radial-gradient(circle at top left, #111827, #020617);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(148, 163, 184, 0.4);
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease,
    border-color 0.15s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 55px rgba(15, 23, 42, 0.9);
  border-color: rgba(129, 140, 248, 0.9);
}

.thumb-wrapper {
  position: relative;
  padding-top: 60%;
  overflow: hidden;
}

.thumb-wrapper img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s ease, filter 0.25s ease;
}

.card:hover .thumb-wrapper img {
  transform: scale(1.04);
  filter: brightness(1.06);
}

.thumb-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top, #1f2937, #020617);
  color: var(--muted);
  font-size: 0.8rem;
}

/* ============================================================
   CARD BODY
============================================================ */
.card-body {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card-body h3 {
  font-size: 0.95rem;
  margin: 0;
}

.card-description {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.tag {
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(129, 140, 248, 0.7);
  color: #e5e7eb;
}

.tag.secondary {
  border-color: rgba(56, 189, 248, 0.7);
}

.tag.outline {
  background: transparent;
  border-style: dashed;
}

.btn-download {
  margin-top: 6px;
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 0.85rem;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, var(--primary), var(--primary-soft));
  color: white;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
  box-shadow: 0 12px 30px rgba(79, 70, 229, 0.45);
}

.btn-download:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

/* ============================================================
   EMPTY STATE
============================================================ */
.empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 36px 16px;
  border-radius: var(--radius-lg);
  background: rgba(15, 23, 42, 0.95);
  border: 1px dashed rgba(148, 163, 184, 0.7);
  color: var(--muted);
}

/* ============================================================
   MODAL
============================================================ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(10px);
}

.modal-content {
  position: relative;
  z-index: 1;
  max-width: 960px;
  width: 100%;
}

.modal-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.4fr);
  gap: 18px;
  background: radial-gradient(circle at top left, #111827, #020617);
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.9);
  padding: 16px;
}

.modal-preview {
  border-radius: 14px;
  overflow: hidden;
  background: #020617;
}

.modal-preview {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-preview img {
  width: 100%;
  height: auto;
  max-height: 420px;
  object-fit: contain;
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-body h2 {
  margin: 0;
  font-size: 1.2rem;
}

.modal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.modal-info dt {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 6px;
}

.modal-close {
  position: absolute;
  top: 8px;
  right: 12px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  background: rgba(15, 23, 42, 0.9);
  color: white;
  border-radius: 999px;
  width: 28px;
  height: 28px;
  cursor: pointer;
}

/* ============================================================
   RESPONSIVIDADE
============================================================ */

/* Tablet */
@media (max-width: 1024px) {
  .grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Mobile */
@media (max-width: 768px) {
  .header-inner {
    flex-direction: column;
    text-align: center;
  }

  .header-left {
    flex-direction: column;
  }

  .filters {
    flex-direction: column;
    align-items: stretch;
  }

  .filters-left {
    flex-direction: column;
  }

  .grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .modal-inner {
    grid-template-columns: 1fr;
  }

  .modal-preview img {
    max-height: 260px;
  }
  @media (min-width: 768px) {
    .modal-preview img {
      max-height: 80vh;
    }
  }
}

@media (max-width: 520px) {
  .grid {
    grid-template-columns: 1fr;
  }
}

/* Fade suave ao atualizar grid */
.grid.fade-out {
  opacity: 0;
  transition: opacity 0.15s ease;
}

.grid.fade-in {
  opacity: 1;
  transition: opacity 0.15s ease;
}

.card-actions {
  display: flex;
  gap: 6px;
  margin-top: 6px; /* mantém o espaçamento do topo */
}

/* todos os botões dentro do card com mesmo tamanho */
.card-actions .btn-download {
  flex: 1;
  justify-content: center;
}

/* quando tiver só 1 botão (logos / banners), ele ocupa tudo bonitinho */
.card-actions .btn-download:only-child {
  flex: 1;
}

/* mantém o estilo do botão secundário (background) */
.btn-download.secondary {
  background: rgba(129, 140, 248, 0.5);
  border: 1px solid rgba(129, 140, 248, 0.5);
}


.modal-description {
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--muted);
  margin: 6px 0 8px;
  max-width: 90%;
}

.modal-description {
  max-height: 140px;
  overflow-y: auto;
  padding-right: 6px;
}

.modal-date {
  font-size: 0.85rem;
  color: var(--muted);
  margin: -4px 0 12px;
}

