.projects {
  background-position: center;
  background-color: var(--bg-color);
  background-size: cover;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
}

.main-text h2 {
  margin-bottom: 3rem;
  font-weight: 400;
  font-size: 5rem;
  line-height: 6.6rem;
  color: var(--main-text-color);
}

@media (max-width: 1180px) {
  .main-text h2 {
    font-size: 4rem;
    line-height: 5rem;
  }
}

@media (max-width: 768px) {
  .main-text h2 {
    font-size: 3rem;
    line-height: 4rem;
  }
}

.portfolio-content {
  display: grid;
  align-items: center;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2.5rem;
  width: 90%;
  max-width: 1200px;
  margin-top: 2rem;
}

@media (max-width: 1100px) {
  .portfolio-content {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .portfolio-content {
    grid-template-columns: repeat(1, 1fr);
  }
}

.row {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  cursor: pointer;
  margin: 0;
  height: 250px;
}

@media (max-width: 768px) {
  .row {
    height: 300px;
  }
}

.row img {
  width: 100%;
  height: 100%;
  border-radius: 8px;
  display: block;
  transition: transform 0.5s;
  object-fit: cover;
}

.layer {
  width: 100%;
  height: 0;
  background: linear-gradient(rgba(0, 0, 0, 0.1), var(--main-color));
  position: absolute;
  border-radius: 8px;
  left: 0;
  bottom: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 40px;
  transition: height 0.5s;
}

.layer h5 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 15px;
  color: white;
}

.layer p {
  color: white;
  font-size: 1.2rem;
  line-height: 1.5;
}

.layer .site-github {
  display: flex;
  gap: 10px;
  margin-top: 1rem;
}

.layer .site-github i {
  color: var(--second-text-color);
  background: white;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 1.5rem;
  transition: all 0.4s ease;
}

.layer .site-github i:hover {
  color: white;
  background: #800080;
}

.row:hover img {
  transform: scale(1.1);
  filter: brightness(20%);
  transition: all 0.45s ease;
}

.row:hover .layer {
  height: 100%;
}

/* Seção e botões */
#projects-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

#buttons-container {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

#toggle-button,
#reset-button,
#show-all-button {
  padding: 0.7rem 1.3rem;
  cursor: pointer;
  border-radius: 6px;
  color: white;
  border: none;
  font-weight: 600;
  transition: background-color 0.3s;
  margin-top: 0;
  background-color: var(--second-bg-color);
}

#toggle-button:hover,
#reset-button:hover,
#show-all-button:hover {
  background-color: var(--second-text-color);
}

/* Botões de categoria */
#category-container {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.category-btn {
  padding: 0.7rem 1.3rem;
  cursor: pointer;
  border-radius: 6px;
  color: white;
  border: none;
  font-weight: 600;
  transition: background-color 0.3s;
  background-color: var(--second-bg-color);
}

.category-btn:hover {
  background-color: var(--second-text-color);
}

.category-btn.active {
  background-color: #800080;
  color: white;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  transform: translateY(-2px);
}
