/* ===== RESET & BASE ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg-primary: #f5f5f5;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #fafafa;
  --bg-filter: rgba(245, 245, 245, 0.92);
  --bg-dark: #0a0a0a;
  --gold: #D4A017;
  --gold-dark: #B8860B;
  --gold-glow: rgba(212, 160, 23, 0.12);
  --text-primary: #1a1a1a;
  --text-secondary: #555555;
  --text-muted: #888888;
  --border: #e0e0e0;
  --border-light: #d0d0d0;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.1);
  --transition: 0.25s ease;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  color: inherit;
}

a {
  color: var(--gold-dark);
  text-decoration: none;
}

.gold {
  color: #FFD700;
}

/* ===== TOP NAVIGATION BAR ===== */
.top-nav {
  background: var(--bg-dark);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: sticky;
  top: 0;
  z-index: 200;
  border-bottom: 3px solid #FFD700;
}

.top-nav-inner {
  max-width: 1200px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.top-nav-logo img {
  height: 40px;
  max-height: 40px;
  width: auto;
  object-fit: contain;
}

.top-nav-btns {
  display: flex;
  gap: 10px;
  align-items: center;
}

.nav-btn {
  font-size: 0.82rem;
  font-weight: 700;
  padding: 10px 20px;
  border-radius: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  transition: all var(--transition);
}

.nav-btn-outline,
.nav-btn-solid {
  background: linear-gradient(135deg, #FFD700, #FFA500);
  color: #000;
  border: none;
}

.nav-btn-outline:hover,
.nav-btn-solid:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(255, 215, 0, 0.4);
  color: #000;
}

/* ===== GOLD ACCENT LINE ===== */
.gold-line {
  height: 3px;
  background: linear-gradient(90deg, transparent, #FFD700, #FFA500, transparent);
}

/* ===== HERO HEADER ===== */
.site-header {
  background: linear-gradient(135deg, #1a1a1a, #0d0d0d);
  border-bottom: 3px solid #FFD700;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 24px 40px;
  text-align: center;
}

.header-title {
  font-size: clamp(1.8rem, 5vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
  color: #ffffff;
}

.header-subtitle {
  font-size: clamp(0.95rem, 2vw, 1.15rem);
  color: #cccccc;
  max-width: 600px;
  margin: 0 auto;
}

/* ===== FILTER BAR ===== */
.filter-bar {
  position: sticky;
  top: 65px;
  z-index: 100;
  background: var(--bg-filter);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
}

.filter-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.search-wrap {
  position: relative;
  margin-bottom: 12px;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
}

#searchInput {
  width: 100%;
  padding: 12px 40px 12px 42px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition);
}

#searchInput:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-glow);
}

#searchInput::placeholder {
  color: var(--text-muted);
}

.search-clear {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.3rem;
  color: var(--text-muted);
  padding: 4px 8px;
  border-radius: 4px;
}

.search-clear:hover {
  color: var(--text-primary);
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.filter-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1;
}

.chip {
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 500;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  transition: all var(--transition);
  white-space: nowrap;
}

.chip:hover {
  border-color: var(--gold);
  color: var(--gold-dark);
}

.chip.active {
  background: linear-gradient(135deg, #FFD700, #FFA500);
  color: #000;
  border-color: #FFD700;
  font-weight: 600;
}

.concurso-wrap {
  flex-shrink: 0;
}

#concursoSelect {
  padding: 8px 32px 8px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-family: inherit;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

#concursoSelect:focus {
  border-color: var(--gold);
}

/* ===== RESULTS BAR ===== */
.results-bar {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 24px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ===== SECTIONS ===== */
.section {
  padding: 48px 0;
}

.section-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.section-title {
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.section-title .gold {
  color: var(--gold-dark);
}

/* ===== DESTAQUES GRID ===== */
.destaques-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

/* ===== CARD GRID ===== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

/* ===== CARD ===== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  animation: fadeInUp 0.4s ease both;
  box-shadow: var(--shadow-card);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: var(--border-light);
}

.card.destaque {
  border-left: 3px solid var(--gold);
}

.card-img-wrap {
  position: relative;
  overflow: hidden;
  background: #eee;
}

.card-img-wrap img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.3s ease;
}

.card:hover .card-img-wrap img {
  transform: scale(1.02);
}

.card-body {
  padding: 14px 16px;
}

.card-name {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.card-concurso {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gold-dark);
  background: var(--gold-glow);
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 6px;
}

.card-texto {
  font-size: 0.82rem;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.5;
}

.card-nota {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gold-dark);
  margin-top: 8px;
}

.card-nota::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--gold);
  border-radius: 50%;
}

.card-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-aprovado {
  background: rgba(34, 197, 94, 0.15);
  color: #16a34a;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.badge-resultado {
  background: rgba(59, 130, 246, 0.12);
  color: #2563eb;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-evolucao {
  background: rgba(168, 85, 247, 0.12);
  color: #7c3aed;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.badge-elogio {
  background: rgba(212, 160, 23, 0.12);
  color: var(--gold-dark);
  border: 1px solid rgba(212, 160, 23, 0.25);
}

/* ===== PLAY OVERLAY (video cards in grid) ===== */
.play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.3);
  transition: background var(--transition);
}

.card:hover .play-overlay {
  background: rgba(0, 0, 0, 0.15);
}

.play-btn {
  width: 52px;
  height: 52px;
  background: rgba(255, 215, 0, 0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition);
}

.card:hover .play-btn {
  transform: scale(1.1);
}

.play-btn::after {
  content: "";
  display: block;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 9px 0 9px 16px;
  border-color: transparent transparent transparent #000;
  margin-left: 3px;
}

/* ===== LOAD MORE ===== */
.load-more-wrap {
  text-align: center;
  margin-top: 32px;
}

.btn-load-more {
  padding: 12px 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.btn-load-more:hover {
  border-color: var(--gold);
  color: var(--gold-dark);
}

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 64px 24px;
  color: var(--text-muted);
}

.empty-state svg {
  margin-bottom: 16px;
  color: var(--text-muted);
}

.empty-state p {
  font-size: 1rem;
  margin-bottom: 16px;
}

.btn-clear-filters {
  padding: 8px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--gold-dark);
  transition: all var(--transition);
}

.btn-clear-filters:hover {
  background: var(--gold-glow);
}

/* ===== LIGHTBOX ===== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox[hidden] {
  display: none;
}

.lightbox-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
}

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-close {
  position: fixed;
  top: 16px;
  right: 20px;
  font-size: 2.2rem;
  color: #ccc;
  z-index: 10;
  padding: 4px 12px;
  transition: color var(--transition);
}

.lightbox-close:hover {
  color: #fff;
}

.lightbox-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  font-size: 3rem;
  color: #ccc;
  padding: 16px;
  z-index: 10;
  transition: color var(--transition);
}

.lightbox-nav:hover {
  color: #FFD700;
}

.lightbox-prev {
  left: 8px;
}

.lightbox-next {
  right: 8px;
}

.lightbox-body {
  display: flex;
  align-items: center;
  justify-content: center;
  max-height: 80vh;
}

.lightbox-body img {
  max-width: 90vw;
  max-height: 80vh;
  border-radius: var(--radius-md);
  object-fit: contain;
}

.lightbox-body video {
  max-width: 90vw;
  max-height: 80vh;
  border-radius: var(--radius-md);
}

.lightbox-body img[hidden],
.lightbox-body video[hidden] {
  display: none;
}

.lightbox-info {
  margin-top: 12px;
  text-align: center;
  font-size: 0.85rem;
  color: #ccc;
}

/* ===== CTA FOOTER ===== */
.site-footer {
  background: linear-gradient(135deg, #1a1a1a, #0d0d0d);
  border-top: 3px solid #FFD700;
  padding: 64px 24px;
  text-align: center;
}

.footer-inner {
  max-width: 600px;
  margin: 0 auto;
}

.footer-title {
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  font-weight: 800;
  margin-bottom: 12px;
  color: #ffffff;
}

.footer-title .gold {
  color: #FFD700;
}

.footer-text {
  color: #cccccc;
  margin-bottom: 28px;
  font-size: 1rem;
}

.btn-cta {
  display: inline-block;
  padding: 16px 40px;
  background: linear-gradient(135deg, #FFD700, #FFA500);
  color: #000;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  border-radius: var(--radius-md);
  transition: transform var(--transition), box-shadow var(--transition);
}

.btn-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(255, 215, 0, 0.3);
  color: #000;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .top-nav {
    padding: 10px 16px;
  }

  .top-nav-logo img {
    height: 32px;
  }

  .nav-btn {
    font-size: 0.7rem;
    padding: 8px 12px;
  }

  .header-inner {
    padding: 32px 16px 28px;
  }

  .filter-bar {
    top: 57px;
  }

  .filter-inner {
    padding: 0 16px;
  }

  .filter-row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .filter-chips {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }

  .filter-chips::-webkit-scrollbar {
    display: none;
  }

  .concurso-wrap {
    width: 100%;
  }

  #concursoSelect {
    width: 100%;
  }

  .section {
    padding: 32px 0;
  }

  .section-inner {
    padding: 0 16px;
  }

  .destaques-grid,
  .card-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .lightbox-nav {
    font-size: 2rem;
    padding: 8px;
  }

  .lightbox-prev {
    left: 4px;
  }

  .lightbox-next {
    right: 4px;
  }

  .site-footer {
    padding: 40px 16px;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .destaques-grid,
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1025px) {
  .destaques-grid {
    grid-template-columns: repeat(3, 1fr);
  }

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

/* ===== HIDDEN UTILITY ===== */
[hidden] {
  display: none !important;
}
