/* ===== SEÇÃO DE PROJETOS ===== */
.projects {
  padding: 8rem 0;
  position: relative;
  overflow: hidden;
}

.section-subtitle {
  text-align: center;
  font-size: 1.8rem;
  color: #666;
  margin-top: 1rem;
  font-style: italic;
}

/* Grid de Projetos */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 3rem;
  margin-top: 4rem;
  padding: 0 2rem;
}

/* Card do Projeto */
.project-card {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  background: #fff;
  height: 450px;
}

.project-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 50px rgba(204, 95, 49, 0.3);
}

/* Imagem do Projeto */
.project-image {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
  transition: transform 0.4s ease;
}

.project-card:hover .project-image {
  transform: scale(1.05);
}

/* Overlay com informações */
.project-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.2) 0%,
    rgba(0, 0, 0, 0.6) 50%,
    rgba(204, 95, 49, 0.98) 100%
  );
  display: flex;
  align-items: flex-end;
  padding: 2.5rem;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.project-card:hover .project-overlay {
  opacity: 1;
}

/* Título sempre visível */
.project-card::after {
  content: attr(data-title);
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
  color: white;
  padding: 2rem;
  font-size: 2rem;
  font-weight: 700;
  z-index: 1;
  transition: opacity 0.4s ease;
}

.project-card:hover::after {
  opacity: 0;
}

/* Informações do Projeto */
.project-info {
  color: white;
  width: 100%;
  transform: translateY(20px);
  transition: transform 0.4s ease;
}

.project-card:hover .project-info {
  transform: translateY(0);
}

.project-info h3 {
  font-size: 2.4rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: white;
}

.project-info p {
  font-size: 1.5rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  color: rgba(255, 255, 255, 0.95);
}

/* Tech Stack Badges */
.project-tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-bottom: 1.5rem;
}

.tech-badge {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  padding: 0.5rem 1.2rem;
  border-radius: 20px;
  font-size: 1.2rem;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.3);
  transition: all 0.3s ease;
}

.tech-badge:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

/* Links dos Projetos */
.project-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn-project {
  flex: 1;
  min-width: 120px;
  padding: 1.2rem 2rem;
  border: none;
  border-radius: 10px;
  font-size: 1.4rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--fonte-primaria);
}

.btn-view {
  background: white;
  color: var(--cor-primaria);
  border: 2px solid white;
}

.btn-view:hover {
  background: transparent;
  color: white;
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(255, 255, 255, 0.3);
}

.btn-code {
  background: transparent;
  color: white;
  border: 2px solid white;
}

.btn-code:hover {
  background: white;
  color: var(--cor-primaria);
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(255, 255, 255, 0.3);
}

/* Badge de destaque no card (opcional) */
.project-badge {
  position: absolute;
  top: 20px;
  right: 20px;
  background: var(--cor-secundaria);
  color: white;
  padding: 0.8rem 1.5rem;
  border-radius: 20px;
  font-size: 1.2rem;
  font-weight: 600;
  z-index: 2;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* ===== RESPONSIVIDADE ===== */

/* Tablets grandes e desktops pequenos */
@media (max-width: 1200px) {
  .projects-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2.5rem;
  }
  
  .project-card {
    height: 420px;
  }
}

/* Tablets */
@media (max-width: 900px) {
  .projects {
    padding: 6rem 0;
  }
  
  .projects-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    padding: 0 1.5rem;
  }
  
  .project-card {
    height: 400px;
  }
  
  .project-info h3 {
    font-size: 2rem;
  }
  
  .project-info p {
    font-size: 1.4rem;
  }
}

/* Mobile */
@media (max-width: 768px) {
  .section-subtitle {
    font-size: 1.6rem;
    padding: 0 2rem;
  }
  
  .projects-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
    padding: 0 2rem;
  }
  
  .project-card {
    height: 380px;
  }
  
  /* No mobile, esconder o título do ::after e mostrar overlay */
  .project-card::after {
    display: none;
  }
  
  /* No mobile, mostrar sempre o overlay com opacidade reduzida */
  .project-overlay {
    opacity: 1;
    background: linear-gradient(
      to bottom,
      rgba(0, 0, 0, 0.3) 0%,
      rgba(0, 0, 0, 0.6) 40%,
      rgba(204, 95, 49, 0.95) 100%
    );
  }
  
  .project-info {
    transform: translateY(0);
  }
  
  .project-overlay {
    padding: 2rem;
  }
  
  .project-info h3 {
    font-size: 1.8rem;
  }
  
  .project-info p {
    font-size: 1.3rem;
    margin-bottom: 1rem;
  }
  
  .tech-badge {
    font-size: 1.1rem;
    padding: 0.4rem 1rem;
  }
  
  .btn-project {
    padding: 1rem 1.5rem;
    font-size: 1.3rem;
  }
}

/* Mobile pequeno */
@media (max-width: 480px) {
  .projects {
    padding: 5rem 0;
  }
  
  .projects-grid {
    gap: 2rem;
    padding: 0 1.5rem;
  }
  
  .project-card {
    height: 420px;
  }
  
  .project-info h3 {
    font-size: 1.6rem;
    margin-bottom: 0.8rem;
  }
  
  .project-info p {
    font-size: 1.2rem;
    line-height: 1.5;
  }
  
  .project-tech-stack {
    gap: 0.6rem;
    margin-bottom: 1.2rem;
  }
  
  .tech-badge {
    font-size: 1rem;
    padding: 0.4rem 0.8rem;
  }
  
  .project-links {
    flex-direction: column;
  }
  
  .btn-project {
    width: 100%;
    min-width: unset;
  }
}

/* Animação de entrada suave */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.project-card {
  animation: fadeInUp 0.6s ease-out;
}

/* ===== CÓDIGO ANTIGO MANTIDO PARA COMPATIBILIDADE ===== */
:root {
  --color: #3c3163;
  --transition-time: 0.5s;
}

.cards-wrapper {
  display: none; /* Esconder estrutura antiga */
}

.card-grid-space {
  display: none; /* Esconder estrutura antiga */
}

.card h1 {
  margin: 0;
  font-size: 1.5em;
  line-height: 1.2em;
  text-shadow: 1px 1px 1px var(--cor-fundo-cinza-claro);
}

.card p {
  font-size: 0.75em;
  font-family: var(--fonte-secundaria);
  margin-top: 0.5em;
  line-height: 2em;
  text-shadow: 3px 1px 25px var(--cor-fundo-cinza-claro);
  filter: brightness(1.10);
}

.card .tags {
  display: flex;
}

.card .tags .tag {
  font-size: 0.75em;
  border-radius: 0.3rem;
  padding: 0 0.5em;
  margin-right: 0.5em;
  line-height: 1.5em;
  transition: all, var(--transition-time);
}

.card:hover .tags .tag {
  color: white;
}

.card .tags .tag button {
  color: white;
  background-color: var(--cor-secundaria);
  padding: 8px 15px;
  border-radius: 6px;
  cursor: pointer;
  border: 2px solid transparent;
  font-weight: 600;
  transition: all 0.3s ease;
}

.card .tags .tag button:hover{
  transform: scale(1.1);
  border-color: white;
  background-color: var(--cor-primaria);
  box-shadow: 0 5px 15px rgba(255, 255, 255, 0.3);
}

.btn-github {
  background-color: #1a1f27 !important;
}

.btn-github:hover {
  background-color: #000000 !important;
}

.card .date {
  position: absolute;
  top: 0;
  right: 0;
  font-size: 0.75em;
  padding: 1em;
  line-height: 1em;
  opacity: .8;
}

.card:before,
.card:after {
  content: '';
  transform: scale(0);
  transform-origin: top left;
  border-radius: 50%;
  position: absolute;
  left: -50%;
  top: -50%;
  z-index: -5;
  transition: all, var(--transition-time);
  transition-timing-function: ease-in-out;
}

.card:before {
  background: #ddd;
  width: 250%;
  height: 250%;
}

.card:after {
  background: white;
  width: 200%;
  height: 200%;
}

.card:hover {
  color: var(--cor-secundaria);
}

.card:hover:before,
.card:hover:after {
  transform: scale(1);
}

.card-grid-space .num {
  font-size: 3em;
  margin-bottom: 1.2rem;
}

.info {
  font-size: 1.2em;
  display: flex;
  padding: 1em 3em;
  height: 3em;
}

.info img {
  height: 3rem;
  margin-right: 0.5em;
}

.info h1 {
  font-size: 1em;
  font-weight: normal;
}

/* MEDIA QUERIES */
@media screen and (max-width: 1458px) {
  .projetos .container-projetos {
    padding: 0 var(--mobile-padding);
  }

  .cards-wrapper {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media screen and (max-width: 900px) {
  .cards-wrapper {
    grid-template-columns: 1fr;
  }

  .info {
    justify-content: center;
  }

  .card-grid-space .num {
    margin-left: 0;
    text-align: center;
  }
}

@media screen and (max-width: 500px) {
  .cards-wrapper {
    padding: 4rem 2rem;
  }

  .card {
    max-width: calc(100vw - 4rem);
  }
}

@media screen and (max-width: 450px) {
  .info {
    display: block;
    text-align: center;
  }

  .info h1 {
    margin: 0;
  }
}