/* SEÇÃO PROJETOS: cards, grid, modal de projetos */

#projetos {
  width: 100%;
}

.projeto-card-atras {
  top: -1.8rem;
  box-shadow: 0 4px 24px rgba(0,0,0,0.2);
  background: #2c2c2c;
  border-radius: 22px;
  padding: 1rem 1rem;
  margin: 0 auto;
  max-width: 1180px;
  width: 100%;
  margin-inline: auto;
  position: relative;
}

.projeto-card {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  justify-content: flex-start;
  align-items: flex-start;
  box-shadow: 0 4px 24px rgba(0,0,0,0.2);
  background: #1f1f1f;
  border-radius: 22px;
  padding: 1.3rem 1.3rem;
  max-width: 1140px;
  width: 100%;
  min-height: 0;
  margin: 0 auto;
}

@media (max-width: 1100px) {
  .projeto-card {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 800px) {
  .projeto-card {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 500px) {
  .projeto-card {
    grid-template-columns: 1fr;
  }
}

.projeto-store-powerbi,
.projeto-sistema-biblioteca,
.projeto-detect-fraud,
.projeto-cafe-borcelles,
.projeto-apicorreios,
.projeto-sistema-shopee-telegram-bot,
.projeto-linktree,
.projeto-costureira {
  width: 100%;
  height: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #232323;
  border-radius: 18px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.18);
  padding: 6px;
  overflow: hidden;
  position: relative;
  aspect-ratio: 16 / 10;
  content-visibility: auto;
  contain-intrinsic-size: 280px 175px;
}

.linha-projeto-store-powerbi,
.linha-projeto-sistema-biblioteca,
.linha-projeto-detect-fraud,
.linha-projeto-cafe-borcelles,
.linha-projeto-apicorreios,
.linha-projeto-sistema-shopee-telegram-bot,
.linha-projeto-linktree,
.linha-projeto-costureira {
  position: relative;
  width: 85%;
  height: 2.5px;
  background: linear-gradient(90deg, #4f2cc9, #a259ff);
  border-radius: 2px;
  top: 4.5px;
}

.titulo-projeto-store-powerbi,
.titulo-projeto-sistema-biblioteca,
.titulo-projeto-detect-fraud,
.titulo-projeto-cafe-borcelles,
.titulo-projeto-apicorreios,
.titulo-projeto-sistema-shopee-telegram-bot,
.titulo-projeto-linktree,
.titulo-projeto-costureira {
  font-family: Georgia, 'Times New Roman', Times, serif;
  color: #fff;
  font-size: 1.15rem;
  font-weight: bold;
  text-align: center;
  margin: 0;
  height: 22px;
  position: relative;
  top: 2.5px;
}

.img-projeto-blur,
.img-projeto-focada {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transition: opacity 0.9s;
  object-fit: cover;
}

.img-projeto-focada {
  opacity: 0;
}

.projeto-store-powerbi:hover .img-projeto-focada,
.projeto-sistema-biblioteca:hover .img-projeto-focada,
.projeto-detect-fraud:hover .img-projeto-focada,
.projeto-cafe-borcelles:hover .img-projeto-focada,
.projeto-apicorreios:hover .img-projeto-focada,
.projeto-sistema-shopee-telegram-bot:hover .img-projeto-focada,
.projeto-linktree:hover .img-projeto-focada,
.projeto-costureira:hover .img-projeto-focada {
  opacity: 1;
}

.projeto-store-powerbi:hover .img-projeto-blur,
.projeto-sistema-biblioteca:hover .img-projeto-blur,
.projeto-detect-fraud:hover .img-projeto-blur,
.projeto-cafe-borcelles:hover .img-projeto-blur,
.projeto-apicorreios:hover .img-projeto-blur,
.projeto-sistema-shopee-telegram-bot:hover .img-projeto-blur,
.projeto-linktree:hover .img-projeto-blur,
.projeto-costureira:hover .img-projeto-blur {
  opacity: 0;
}

.link-projeto .projeto-store-powerbi:hover,
.link-projeto .projeto-sistema-biblioteca:hover,
.link-projeto .projeto-detect-fraud:hover,
.link-projeto .projeto-cafe-borcelles:hover,
.link-projeto .projeto-apicorreios:hover,
.link-projeto .projeto-sistema-shopee-telegram-bot:hover,
.link-projeto .projeto-linktree:hover,
.link-projeto .projeto-costureira:hover {
  box-shadow: 0 0 6px 6px #463870, 8px 32px 0 rgba(80,0,160,0.18);
  transform: scale(1.015);
  border: 0.5px solid #231c38;
  transition: box-shadow 0.9s, transform 0.9s, border 0.9s;
  cursor: pointer;
  z-index: 2;
}

.link-projeto {
  text-decoration: none;
  color: inherit;
}

/* ============================================================
   MODAL DE PROJETO (SEGUNDA TELA) — RESPONSIVO E REFINADO
   ============================================================ */

.segundatela-projetos {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  box-sizing: border-box;
  overflow-y: auto;
}

.segundatela-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
}

.segundatela-conteudo {
  position: relative;
  background: #1e1e1e;
  color: #fff;
  border-radius: 1.4rem;
  padding: 2rem 2rem 1.8rem;
  z-index: 2;
  width: 100%;
  max-width: 820px;
  box-shadow:
    0 8px 40px rgba(80, 0, 160, 0.18),
    0 2px 0 rgba(162, 89, 255, 0.12) inset;
  border: 1px solid rgba(162, 89, 255, 0.12);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1.2rem;
  box-sizing: border-box;
  margin: auto;
  /* Limita a altura ao viewport e rola internamente se precisar */
  max-height: min(92vh, 860px);
  min-height: min(82vh, 760px);
  overflow: hidden;
}

/* Botão fechar */
.segundatela-fechar {
  position: absolute;
  top: 1rem;
  right: 1.2rem;
  font-size: 1.3rem;
  color: #aaa;
  cursor: pointer;
  z-index: 3;
  transition: color 0.2s, transform 0.2s;
  line-height: 1;
  background: rgba(255,255,255,0.05);
  border-radius: 50%;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.segundatela-fechar:hover {
  color: #a78bfa;
  transform: rotate(90deg);
  background: rgba(167, 139, 250, 0.12);
}

/* Barra lateral de tags/badges */
.segundatela-barralateral {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 0.4rem;
}

/* Carrossel / imagem do projeto */
.segundatela-carrossel {
  width: 100%;
  display: flex;
  justify-content: center;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  min-height: clamp(180px, 30vh, 300px);
  max-height: clamp(220px, 35vh, 340px);
}

.segundatela-carrossel.is-image {
  min-height: clamp(180px, 30vh, 300px);
  max-height: clamp(220px, 35vh, 340px);
}

.segundatela-carrossel.is-video {
  min-height: clamp(200px, 32vh, 320px);
  max-height: clamp(240px, 38vh, 360px);
}

.segundatela-carrossel-img {
  width: 100%;
  max-width: 100%;
  height: clamp(180px, 35vh, 340px);
  object-fit: cover;
  border-radius: 6px;
  box-shadow: 0 2px 16px rgba(80, 0, 160, 0.14);
  display: block;
}

#modal-img {
  object-fit: cover;
}

#modal-video {
  object-fit: contain;
  background: #0d0d0d;
}

.segundatela-carrossel.is-video #modal-video {
  height: clamp(200px, 38vh, 360px);
}

.segundatela-carrossel.is-image #modal-img {
  height: clamp(180px, 35vh, 340px);
}

/* Linha de infos: data + linguagens + links */
.segundatela-infos-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem 2rem;
}

.segundatela-infodata,
.segundatela-linguagens {
  font-size: 1rem;
  color: #a78bfa;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.segundatela-links {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  justify-content: center;
}

.segundatela-links a {
  color: #fff;
  background: #4a0e83;
  padding: 0.38rem 1.1rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 10px rgba(74, 14, 131, 0.3);
}

.segundatela-links a:hover {
  background: #a78bfa;
  color: #1a1a2e;
  box-shadow: 0 4px 16px rgba(167, 139, 250, 0.35);
}

/* Divisor sutil */
.segundatela-divisor {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(162, 89, 255, 0.3), transparent);
  border: none;
  flex-shrink: 0;
}

/* Bloco de descrição — título centralizado + caixa com scroll */
.segundatela-descricao-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  min-height: 0; /* permite que o flex encolha */
  flex: 1 1 auto;
}

.segundatela-descricao-titulo {
  font-family: Georgia, 'Times New Roman', Times, serif;
  font-size: 1.15rem;
  font-weight: bold;
  color: #fff;
  text-align: center;
  margin: 0;
  flex-shrink: 0;
}

.segundatela-descricao-caixa {
  background: #161616;
  border: 1px solid rgba(162, 89, 255, 0.15);
  border-radius: 10px;
  padding: 1rem 1.1rem;
  min-height: clamp(230px, 34vh, 360px);
  height: 100%;
  max-height: none;
  overflow-y: auto;
  line-height: 1.7;
  font-size: 0.95rem;
  color: #ccc;
  box-sizing: border-box;

  /* Scrollbar personalizada (Webkit) */
  scrollbar-width: thin;
  scrollbar-color: #4f2cc9 #1e1e1e;
}

.segundatela-descricao-caixa::-webkit-scrollbar {
  width: 6px;
}

.segundatela-descricao-caixa::-webkit-scrollbar-track {
  background: #1e1e1e;
  border-radius: 4px;
}

.segundatela-descricao-caixa::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #4f2cc9, #a259ff);
  border-radius: 4px;
}

.segundatela-descricao-caixa::-webkit-scrollbar-thumb:hover {
  background: #a78bfa;
}

/* ============================================================
   RESPONSIVO — MOBILE
   ============================================================ */

@media (max-width: 600px) {
  .segundatela-projetos {
    padding: 0.5rem;
    align-items: flex-start;
  }

  .segundatela-conteudo {
    padding: 1.4rem 1.1rem 1.4rem;
    border-radius: 1rem;
    max-height: calc(100vh - 1rem);
    min-height: calc(100vh - 1rem);
    gap: 1rem;
  }

  .segundatela-carrossel {
    min-height: 170px;
    max-height: 220px;
  }

  .segundatela-carrossel.is-video {
    min-height: 180px;
    max-height: 230px;
  }

  .segundatela-carrossel-img {
    height: 220px;
  }

  .segundatela-infos-row {
    flex-direction: column;
    gap: 0.6rem;
  }

  .segundatela-infodata,
  .segundatela-linguagens {
    font-size: 0.88rem;
    text-align: center;
  }

  .segundatela-descricao-titulo {
    font-size: 1rem;
  }

  .segundatela-descricao-caixa {
    font-size: 0.88rem;
    min-height: 260px;
    max-height: none;
  }

  .segundatela-links a {
    padding: 0.35rem 0.85rem;
    font-size: 0.85rem;
  }
}

@media (max-width: 400px) {
  .segundatela-conteudo { 
    padding: 1.2rem 0.85rem;
    border-radius: 0.85rem;
  }

  .segundatela-carrossel {
    min-height: 150px;
    max-height: 180px;
  }

  .segundatela-carrossel.is-video {
    min-height: 160px;
    max-height: 200px;
  }

  .segundatela-carrossel-img {
    height: 180px;
  }

  .segundatela-descricao-caixa {
    min-height: 250px;
    max-height: none;
  }
}