/* ===== SEARCH HEADER ===== */
.search-header {
  text-align: center;
  margin-bottom: 32px;
}

.search-title {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.search-subtitle {
  color: var(--text-muted);
  margin-top: 4px;
}

/* ===== SEARCH BAR ===== */
.search-bar-section {
  text-align: center;
  margin-bottom: 24px;
}

.filter-heading {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.filter-subheading {
  color: var(--text-muted);
  margin-bottom: 16px;
}

.search-input-wrapper {
  position: relative;
  max-width: 500px;
  margin: 0 auto;
}

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

.search-input {
  width: 100%;
  padding: 12px 16px 12px 42px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  background: var(--bg-card);
  color: var(--text);
  transition: var(--transition);
}

.search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

/* ===== AUTOCOMPLETE ===== */
.autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  max-height: 240px;
  overflow-y: auto;
  z-index: 50;
  padding: 8px;
}

.autocomplete-label {
  font-size: 0.75rem;
  color: var(--text-light);
  padding: 4px 8px;
  margin-bottom: 4px;
}

.autocomplete-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 0.85rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
  text-align: left;
}

.autocomplete-item:hover {
  background: var(--bg-muted);
}

.autocomplete-item svg {
  color: var(--text-light);
  flex-shrink: 0;
}

/* ===== FILTER RESULTS GRID ===== */
.filter-results-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}

/* ===== FILTERS PANEL ===== */
.filters-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

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

.filters-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.1rem;
  color: var(--primary);
}

/* Active filters bar */
.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.active-filters-label {
  font-size: 0.75rem;
  color: var(--text-light);
  width: 100%;
  margin-bottom: 4px;
}

/* ===== TAG CATEGORIES ===== */
.tag-category {
  margin-bottom: 20px;
}

.tag-category-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 10px;
  display: block;
}

/* Category colors */
.tag-category-title.cat-age { color: var(--blue); }
.tag-category-title.cat-material { color: #D946EF; }
.tag-category-title.cat-theme { color: var(--orange); }
.tag-category-title.cat-sport-marca { color: #8B5CF6; }
.tag-category-title.cat-sport-precisao { color: var(--blue); }
.tag-category-title.cat-sport-rede { color: #D946EF; }
.tag-category-title.cat-sport-invasao { color: var(--orange); }
.tag-category-title.cat-sport-tecnico { color: #8B5CF6; }
.tag-category-title.cat-sport-campo { color: var(--primary-light); }
.tag-category-title.cat-sport-combate { color: var(--orange); }

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* ===== TAGS / BADGES ===== */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
  background: var(--bg-card);
  color: var(--text);
  user-select: none;
}

.tag:hover {
  border-color: var(--primary);
  background: rgba(124, 58, 237, 0.05);
  transform: scale(1.03);
}

.tag.selected {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.3);
}

.tag.selected:hover {
  background: var(--primary-dark);
}

/* Active filter tag (with X) */
.active-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: var(--primary);
  color: white;
  border-radius: 20px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: var(--transition);
}

.active-tag:hover {
  background: var(--primary-dark);
}

.active-tag .tag-x {
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  opacity: 0.8;
}

/* Game count */
.game-count {
  font-size: 0.75rem;
  color: var(--text-light);
  margin-left: 4px;
}

/* ===== FILTER TIP ===== */
.filter-tip {
  margin-top: 24px;
  padding: 12px;
  background: var(--bg-muted);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  text-align: center;
}

.filter-tip p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ===== RESULTS PANEL ===== */
.results-panel {
  background: rgba(124, 58, 237, 0.03);
  border: 2px dashed rgba(124, 58, 237, 0.25);
  border-radius: var(--radius);
  padding: 24px;
  min-height: 300px;
}

.results-empty,
.results-none {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}

.results-empty svg,
.results-none svg {
  margin: 0 auto 16px;
  color: var(--text-light);
}

.results-empty h3,
.results-none h3 {
  font-size: 1rem;
  margin-bottom: 8px;
}

.results-empty p,
.results-none p {
  font-size: 0.85rem;
  color: var(--text-light);
}

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

.results-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  color: var(--primary);
}

.results-active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-bottom: 16px;
}

.results-filter-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.results-filter-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.results-filter-badge button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  color: var(--text-light);
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  transition: color 0.15s;
}

.results-filter-badge button:hover {
  color: #EF4444;
}

/* ===== GAME CARDS ===== */
.results-items {
  max-height: 70vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.game-card {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  transition: var(--transition);
}

.game-card:hover {
  background: var(--bg-muted);
}

.game-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.game-card-name {
  font-size: 1rem;
  font-weight: 600;
  flex: 1;
}

.game-card-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.75rem;
  color: var(--text);
  text-decoration: none;
  transition: var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
}

.game-card-link:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* Game card actions (buttons row) */
.game-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Toggle button */
.game-card-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.75rem;
  color: var(--text);
  background: transparent;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.game-card-toggle:hover {
  background: rgba(124, 58, 237, 0.1);
  border-color: var(--primary);
  color: var(--primary);
}

.game-card-toggle.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.game-card-toggle.active .toggle-plus {
  display: none;
}

/* Description area */
.game-card-desc {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  animation: descSlideDown 0.3s ease;
}

.game-card-desc.hidden {
  display: none;
}

@keyframes descSlideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.game-card-desc-content {
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text-muted);
}

.game-card-desc-content .desc-game-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}

.game-card-desc-content .desc-section-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--primary-light, #a78bfa);
  margin-top: 14px;
  margin-bottom: 6px;
  padding-bottom: 3px;
  border-bottom: 1px solid rgba(124, 58, 237, 0.15);
}

.game-card-desc-content .desc-obj-lead {
  color: var(--text);
  font-weight: 600;
}

.game-card-desc-content .desc-bncc-year {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  margin-top: 12px;
  margin-bottom: 4px;
  padding: 3px 10px;
  background: rgba(124, 58, 237, 0.1);
  border-radius: 4px;
  display: inline-block;
}

.game-card-desc-content .desc-bncc-code {
  font-weight: 700;
  color: var(--primary-light, #a78bfa);
}

.game-card-desc-content p {
  margin-bottom: 6px;
}

.game-card-desc-content p:last-child {
  margin-bottom: 0;
}

/* Download buttons bar */
.desc-download-bar {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
}

.desc-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--primary);
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary);
  background: transparent;
  cursor: pointer;
  transition: var(--transition);
}

.desc-download-btn:hover {
  background: var(--primary);
  color: white;
}

.desc-download-btn:active {
  transform: scale(0.97);
}

.game-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.game-tag {
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid var(--border);
  background: var(--bg-muted);
  color: var(--text-muted);
}

.game-tag:hover {
  opacity: 0.8;
}

.game-tag.highlight {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  font-weight: 600;
}

/* ===== ADD TO PLANOS BUTTON ===== */
.desc-add-plano-btn {
  border-color: #10b981 !important;
  color: #10b981 !important;
}

.desc-add-plano-btn:hover {
  background: #10b981 !important;
  color: white !important;
}

/* ===== TURMA PICKER MODAL ===== */
.turma-picker-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}

.turma-picker-overlay.hidden {
  display: none;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.turma-picker-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 90%;
  max-width: 480px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  animation: slideUp 0.25s ease;
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.turma-picker-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
}

.turma-picker-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 4px;
  color: var(--text);
}

.turma-picker-game {
  font-size: 0.85rem;
  color: var(--primary);
  font-weight: 600;
  margin: 0;
}

.turma-picker-body {
  padding: 16px 24px;
  overflow-y: auto;
  flex: 1;
}

.turma-picker-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0 0 12px;
}

.turma-picker-escola {
  margin-bottom: 16px;
}

.turma-picker-escola-name {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(124, 58, 237, 0.15);
}

.turma-picker-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: var(--transition);
}

.turma-picker-item:hover {
  background: rgba(124, 58, 237, 0.05);
  border-color: var(--primary);
}

.turma-picker-item:has(input:checked) {
  background: rgba(124, 58, 237, 0.1);
  border-color: var(--primary);
}

.turma-picker-cb {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}

.turma-picker-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.turma-picker-info strong {
  font-size: 0.88rem;
  color: var(--text);
}

.turma-picker-info small {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.turma-picker-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
}

.turma-picker-cancel {
  padding: 8px 20px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
}

.turma-picker-cancel:hover {
  background: var(--bg-muted);
}

.turma-picker-confirm {
  padding: 8px 24px;
  border: none;
  border-radius: 6px;
  background: var(--primary);
  color: white;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.turma-picker-confirm:hover:not(:disabled) {
  background: var(--primary-dark, #6d28d9);
}

.turma-picker-confirm:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .filter-results-grid {
    grid-template-columns: 1fr;
  }

  .search-title {
    font-size: 1.2rem;
  }

  .tag {
    font-size: 0.78rem;
    padding: 5px 10px;
  }

  .game-card-header {
    flex-direction: column;
    gap: 8px;
  }

  .game-card-actions {
    align-self: flex-start;
    flex-wrap: wrap;
  }

  .game-card-link {
    align-self: flex-start;
  }

  .results-items {
    max-height: 60vh;
  }
}

/* ===== FAVORITES: Heart Button ===== */
.fav-heart {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--text-muted);
  transition: color .2s, transform .2s;
  display: flex;
  align-items: center;
}
.fav-heart:hover {
  color: #ef4444;
  transform: scale(1.15);
}
.fav-heart.active {
  color: #ef4444;
}
.fav-heart.active svg {
  fill: #ef4444;
}

/* ===== RATINGS: Star Rating ===== */
.game-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.star-rating {
  display: flex;
  gap: 2px;
}
.star {
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--border);
  transition: color .15s, transform .15s;
  user-select: none;
}
.star:hover {
  transform: scale(1.2);
}
.star.active {
  color: #f59e0b;
}
/* ===== TOP 5 SECTION ===== */
.top5-entry {
  margin-bottom: 16px;
}
.top5-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  margin-bottom: 4px;
  background: rgba(245, 158, 11, .1);
  border-radius: 8px 8px 0 0;
  border: 1px solid rgba(245, 158, 11, .2);
  border-bottom: none;
}
.top5-rank {
  font-size: 1.2rem;
  font-weight: 800;
  color: #f59e0b;
}
.top5-stars {
  display: flex;
  gap: 1px;
}
.top5-stars .star {
  cursor: default;
  font-size: .9rem;
  color: #f59e0b;
}
.top5-avg {
  font-weight: 600;
  color: var(--text-muted);
  font-size: .8rem;
}
.top5-entry .game-card {
  border-radius: 0 0 12px 12px;
  margin-bottom: 0;
}

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text);
}

/* ===== NOVIDADES ===== */
.novidade-entry {
  margin-bottom: 16px;
}
.novidade-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  margin-bottom: 4px;
  background: rgba(16, 185, 129, .1);
  border-radius: 12px 12px 0 0;
  border: 1px solid rgba(16, 185, 129, .2);
  border-bottom: none;
}
.novidade-tempo {
  font-size: 0.8rem;
  font-weight: 600;
  color: #10b981;
}
.novidade-entry .game-card {
  border-radius: 0 0 12px 12px;
  margin-bottom: 0;
}

/* Badge no menu lateral */
.nav-badge-new {
  background: #10b981;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  margin-left: auto;
  line-height: 1.4;
}
