/* Reset completo e estilos globais */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 15px;
}

body {
  background-color: #f3f4f6;
  color: #1f2937;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
}

/* Header */
header {
  background-color: #2563eb;
  color: white;
  padding: 1.5rem 1rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.header-container {
  max-width: 56rem;
  margin-left: auto;
  margin-right: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
}

@media (min-width: 640px) {
  .header-container {
    flex-direction: row;
    align-items: center;
  }
}

.header-title {
  text-align: center;
  margin-bottom: 1rem;
}

@media (min-width: 640px) {
  .header-title {
    text-align: left;
    margin-bottom: 0;
  }
}

.header-title h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0 0 0.25rem 0;
}

.header-title p {
  font-size: 1rem;
  opacity: 0.9;
  margin: 0;
}

.search-container {
  display: flex;
  gap: 0.75rem;
  width: 100%;
}

@media (min-width: 640px) {
  .search-container {
    width: auto;
  }
}

#busca {
  padding: 0.75rem;
  border-radius: 0.375rem;
  color: #000;
  width: 100%;
  border: none;
  outline: none;
  font-size: 1rem;
}

@media (min-width: 640px) {
  #busca {
    width: 16rem;
  }
}

#busca:focus {
  box-shadow: 0 0 0 3px #60a5fa;
}

/* Navigation - Espaçamento reduzido aqui */
nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem; /* Reduzido de 0.75rem */
  background-color: white;
  padding: 1rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  position: sticky;
  top: 0;
  z-index: 10;
}

@media (min-width: 640px) {
  nav {
    gap: 0.75rem; /* Reduzido de 1.25rem */
  }
}

.categoria {
  padding: 0.2rem 1rem;
  border-radius: 0.375rem;
  color: #2563eb;
  font-weight: 600;
  font-size: 1rem;
  background: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.categoria:hover {
  background-color: #eff6ff;
  transform: translateY(-1px);
}

/* Main content */
main {
  padding: 2rem 1.5rem;
  max-width: 56rem;
  margin-left: auto;
  margin-right: auto;
  display: grid;
  gap: 2rem;
}

@media (min-width: 640px) {
  main {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

@media (min-width: 768px) {
  main {
    padding-left: 2.5rem;
    padding-right: 2.5rem;
  }
}

/* Category Badges - Espaçamento reduzido aqui */
.category-badge {
  display: inline-block;
  padding: 0.2rem 0.45rem;
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 9999px;
  margin-right: 0.2rem; /* Reduzido de 0.5rem */
  margin-bottom: 0.2rem; /* Reduzido de 0.5rem */
}

.category-business {
  background-color: #dbeafe;
  color: #1e40af;
}

.category-marketing {
  background-color: #e9d5ff;
  color: #6b21a8;
}

.category-writing {
  background-color: #e1ffe1;
  color: #10aeb9;
}

.category-scripts {
  background-color: #fee2e2;
  color: #991b1b;
}

.category-design {
  background-color: #fef3c7;
  color: #92400e;
}

.category-programming {
  background-color: #e0e7ff;
  color: #4338ca;
}

.category-education {
  background-color: #ccfbf1;
  color: #125853;
}

.category-health {
  background-color: #fce7f3;
  color: #9d174d;
}

.category-technology {
  background-color: #f3f4f6;
  color: #7d828a;
}

.category-default {
  background-color: #f3f4f6;
  color: #4b5563;
}

/* Loading */
#loading {
  text-align: center;
  padding: 3rem 0;
}

#loading i {
  font-size: 2.5rem;
  color: #3b82f6;
  margin-bottom: 1rem;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

#loading p {
  font-size: 1.25rem;
  color: #4b5563;
}

/* Footer */
footer {
  background-color: #1f2937;
  color: white;
  padding: 2rem 0;
  margin-top: 3rem;
}

.footer-container {
  max-width: 56rem;
  margin-left: auto;
  margin-right: auto;
  padding: 0 1.5rem;
  text-align: center;
}

.footer-container p {
  font-size: 1rem;
  margin-bottom: 1rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  margin-top: 1rem;
}

.footer-links a {
  color: white;
  text-decoration: none;
  font-size: 1.25rem;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: #93c5fd;
  transform: scale(1.1);
}

.footer-links .underline {
  text-decoration: underline;
  margin-left: 0.75rem;
  font-size: 1rem;
}

/* Utilitários */
.no-results {
  text-align: center;
  padding: 3rem 0;
  grid-column: 1 / -1;
}

.no-results i {
  font-size: 2.5rem;
  color: #9ca3af;
  margin-bottom: 1rem;
}

.no-results p {
  color: #6b7280;
  font-size: 1.25rem;
}

.copy-success {
  background-color: #dcfce7 !important;
  color: #166534 !important;
  transform: scale(1.02);
}

.active-category {
  background-color: #2563eb !important;
  color: white !important;
  font-weight: 700 !important;
}

.active-category:hover {
  background-color: #2563eb !important;
}