/* =========================
   MIND RUSH - LAYOUT E ESTRUTURAS
   Containers, grids, seções e layouts
========================= */

/* =========================
   CONTAINERS E ESTRUTURAS BASE
========================= */
.container {
  max-width: min(100% - 2rem, var(--desktop));
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

.section {
  position: relative;
  overflow: hidden;
  padding: var(--section-padding);
}

/* =========================
   MAIN CONTENT
========================= */
main#main-content {
  padding-top: var(--header-height);
  min-height: calc(100vh - var(--header-height));
}

main#inicio {
  padding-top: 0;
}

/* =========================
   SISTEMA DE GRID
========================= */
.grid {
  display: grid;
  gap: clamp(1rem, 4vw, 2rem);
}

.grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid-solutions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(1rem, 3vw, 1.5rem);
  max-width: var(--desktop);
  margin: 0 auto;
  justify-items: center;
}

.grid-solutions > * {
  width: 100%;
  max-width: 300px;
}

.grid-projects-blog {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(1rem, 3vw, 1.5rem);
  max-width: var(--desktop);
  margin: 0 auto;
  justify-items: center;
}

.grid-projects-blog > * {
  width: 100%;
  max-width: 300px;
}

/* =========================
   SECTION HEADERS
========================= */
.section-header {
  text-align: center;
  margin-bottom: 4rem;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.section-header h2 {
  margin-bottom: 1rem;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
}

.section-header p {
  color: var(--text-muted);
  font-size: clamp(1rem, 3vw, 1.125rem);
  line-height: 1.6;
}

/* =========================
   BACKGROUNDS DAS SEÇÕES
========================= */
#missao {
  background: var(--bg-darker);
}

#tecnologias,
#blog {
  background: linear-gradient(135deg, rgba(216, 50, 143, 0.1), rgba(41, 216, 228, 0.1));
}

.animated-gradient-bg {
  background: linear-gradient(135deg, rgba(216, 50, 143, 0.1), rgba(41, 216, 228, 0.1));
}

#solucoes,
#clientes,
#contato {
  background: var(--bg-darker);
}

#projetos {
  background: var(--bg-dark);
}

/* =========================
   HERO E BACKGROUNDS PRINCIPAIS
========================= */
.hero-bg {
  position: relative;
  background: var(--bg-dark);
  overflow: hidden;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 6rem 0 4rem;
}

main#inicio.hero-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--hero-gradient);
  animation: heroGlow 8s ease-in-out infinite alternate;
  z-index: 0;
}

@keyframes heroGlow {
  0% {
    background: radial-gradient(ellipse 70% 80% at 20% 50%, hsla(300, 75%, 45%, 0.4) 0px, transparent 100%),
                radial-gradient(ellipse 50% 80% at 80% 50%, hsla(185, 85%, 50%, 0.5) 0px, transparent 100%);
  }
  50% {
    background: radial-gradient(ellipse 50% 60% at 80% 30%, hsla(300, 75%, 45%, 0.6) 0px, transparent 100%),
                radial-gradient(ellipse 70% 90% at 20% 70%, hsla(185, 85%, 50%, 0.3) 0px, transparent 100%);
  }
  100% {
    background: radial-gradient(ellipse 80% 70% at 30% 60%, hsla(300, 75%, 45%, 0.3) 0px, transparent 100%),
                radial-gradient(ellipse 40% 70% at 70% 40%, hsla(185, 85%, 50%, 0.6) 0px, transparent 100%);
  }
}

.main-hero {
  text-align: center;
}

.main-hero .container {
  position: relative;
  z-index: 1;
}

.main-hero h1 {
  font-weight: 800;
  color: white;
  line-height: 1.1;
  margin-bottom: 1rem;
  font-size: clamp(2.5rem, 8vw, 4.5rem);
}

.hero-description {
  font-size: clamp(1rem, 3vw, 1.125rem);
  color: #e5e7eb;
  max-width: 48rem;
  margin: 0 auto 2.5rem;
  line-height: 1.7;
}

.hero-buttons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.hero-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 2rem;
  opacity: 1;
  transition: var(--transition);
}

.hero-logo img {
  height: clamp(150px, 12vw, 200px);
  width: auto;
  filter: drop-shadow(0 4px 20px rgba(0, 0, 0, 0.3));
}

/* =========================
   PAGE HEADERS
========================= */
.page-header {
  background: var(--bg-dark) !important;
  padding: clamp(2rem, 5vw, 3rem) 0 clamp(1.5rem, 4vw, 2rem) !important; /* Reduzir padding padrão */
  text-align: center !important;
  position: relative !important;
  border-bottom: 1px solid var(--border-glass) !important;
  overflow: hidden !important;
  min-height: clamp(180px, 25vh, 220px) !important; /* Reduzir altura mínima */
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.page-header::before {
  content: '' !important;
  position: absolute !important;
  inset: 0 !important;
  background: var(--hero-gradient) !important;
  animation: heroGlow 8s ease-in-out infinite alternate !important;
  z-index: 0 !important;
  opacity: 0.7 !important;
}

.page-header::after {
  content: '' !important;
  position: absolute !important;
  bottom: -1px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  width: 100px !important;
  height: 3px !important;
  background: linear-gradient(90deg, var(--primary), var(--secondary)) !important;
  z-index: 2 !important;
}

.page-header .container {
  max-width: 900px !important;
  position: relative !important;
  z-index: 1 !important;
}

.page-header h1 {
  font-size: clamp(1.75rem, 6vw, 3rem) !important;
  margin-bottom: 1rem !important;
  color: #ffffff !important;
  font-weight: 800 !important;
  line-height: 1.1 !important;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5) !important;
}

.page-header p {
  color: rgba(255, 255, 255, 0.9) !important;
  font-size: clamp(1rem, 3vw, 1.125rem) !important;
  max-width: 700px !important;
  margin: 0 auto !important;
  line-height: 1.6 !important;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3) !important;
}

/* =========================
   MISSION SECTION LAYOUT
========================= */
.mission-wrapper {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  align-items: center;
}

.mission-text .section-header {
  text-align: left;
}

.mission-image img {
  border-radius: 1rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* =========================
   VIEW ALL CONTAINERS
========================= */
.view-all-container {
  text-align: center;
  margin-top: 3rem;
  margin-bottom: 2rem;
}

/* =========================
   RESPONSIVE LAYOUT
========================= */

/* =========================
   BLOG CARDS - DESIGN GLOBAL (TODAS AS TELAS)
========================= */

/* Blog cards com wrapper e botão externo */
#blog .blog-card-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

#blog .blog-card {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 1rem;
  overflow: hidden;
  background: var(--bg-card);
  border: none;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  transition: var(--transition);
}

#blog .blog-card a {
  display: block;
  width: 100%;
  height: 100%;
  position: relative;
  text-decoration: none;
}

#blog .blog-card .blog-image {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  position: absolute !important;
  top: 0;
  left: 0;
  z-index: 1;
}

#blog .blog-card .card-content {
  position: absolute !important;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2;
  padding: 1rem !important;
  background: linear-gradient(180deg, transparent 0%, rgba(216, 50, 143, 0.95) 60%, rgba(41, 216, 228, 0.98) 100%) !important;
  backdrop-filter: blur(12px);
  height: 40% !important;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

#blog .blog-card .card-content h3 {
  color: white !important;
  font-size: 1rem !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
  margin: 0 !important;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
  display: block !important;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

/* Botão leia mais externo */
#blog .read-more-external {
  color: rgba(216, 50, 143, 0.7) !important; /* Cor mais transparente por padrão */
  font-size: 0.9rem !important;
  font-weight: 600 !important;
  text-decoration: none !important;
  text-align: center;
  padding: 0.75rem;
  border-radius: 0.5rem;
  background: rgba(216, 50, 143, 0.05) !important; /* Background bem transparente */
  border: 1px solid rgba(216, 50, 143, 0.2);
  transition: var(--transition);
}

#blog .read-more-external:hover {
  background: rgba(216, 50, 143, 0.1) !important;
  color: var(--primary) !important; /* Cor forte no hover */
  transform: translateY(-1px);
  border-color: rgba(216, 50, 143, 0.4);
}

#blog .blog-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

#blog .blog-card:hover .card-content {
  background: linear-gradient(180deg, transparent 0%, rgba(216, 50, 143, 1) 60%, rgba(41, 216, 228, 1) 100%) !important;
}

/* Desktop */
@media (min-width: 769px) {
  .mission-wrapper {
    grid-template-columns: 1fr 1fr;
  }

  /* Ajustes específicos do blog para desktop */
  #blog .blog-card .card-content h3 {
    font-size: 1.1rem !important;
  }

  #blog .read-more-external {
    font-size: 1rem !important;
    padding: 0.75rem 1.5rem;
  }
}

/* Tablet */
@media (max-width: 768px) {
  .grid-solutions {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .grid-projects-blog {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .hero-logo {
    margin-bottom: 1.5rem;
  }
  
  .hero-logo img {
    height: clamp(120px, 20vw, 150px);
  }
}

/* Mobile */
@media (max-width: 480px) {
  .grid-solutions,
  .grid-projects-blog {
    grid-template-columns: repeat(2, 1fr); /* Sempre 2 itens por linha */
    gap: clamp(0.75rem, 2vw, 1rem); /* Gap menor no mobile */
  }

  .grid-4 {
    grid-template-columns: repeat(2, 1fr); /* Todas as grids com 2 colunas */
    gap: clamp(0.75rem, 2vw, 1rem);
  }

  /* Hero mobile: remover logo e ajustar botões */
  .hero-logo {
    display: none !important;
  }

  .hero-buttons {
    flex-direction: row !important; /* Forçar horizontal */
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem !important; /* Menos espaço após botões */
    flex-wrap: nowrap; /* Não quebrar linha */
  }

  .hero-buttons .btn {
    padding: 0.75rem 1.25rem; /* Botões menores */
    font-size: 0.9rem;
    flex: 0 1 auto; /* Não expandir */
    white-space: nowrap;
  }

  /* Hero: centralização 100% no meio mobile */
  .hero-bg {
    min-height: 100vh !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
  }

  .main-hero {
    text-align: center !important;
    width: 100%;
    height: 100%;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .main-hero .container {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    text-align: center !important;
    height: 100%;
    width: 100%;
    margin: 0 auto;
    padding: 1rem !important;
  }

  .hero-content {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    width: 100%;
  }

  /* Missão mobile: ocultar foto, apenas texto */
  .mission-wrapper {
    gap: 1rem; /* Gap menor */
    grid-template-columns: 1fr; /* Uma coluna */
  }

  .mission-text {
    order: 1; /* Texto primeiro */
    text-align: center; /* Centralizar texto */
  }

  .mission-image {
    display: none !important; /* Ocultar completamente no mobile */
  }

  /* Padronização de fontes mobile - simplificar leitura */
  .section-header h2,
  .main-hero h1,
  .page-header h1 {
    font-size: clamp(1.75rem, 6vw, 2.25rem) !important;
    line-height: 1.2 !important;
    font-weight: 700 !important;
  }

  .section-header p,
  .hero-description,
  .page-header p {
    font-size: clamp(1rem, 3vw, 1.125rem) !important;
    line-height: 1.5 !important;
  }

  .card h3 {
    font-size: clamp(1rem, 3vw, 1.125rem) !important;
    line-height: 1.3 !important;
    font-weight: 600 !important;
  }

  .card p {
    font-size: clamp(0.9rem, 2.5vw, 1rem) !important;
    line-height: 1.4 !important;
  }

  /* Ocultar descrições das seções - apenas título + grid */
  #solucoes .section-header p,
  #projetos .section-header p,
  #clientes .section-header p,
  #blog .section-header p,
  #tecnologias .section-header p {
    display: none !important;
  }

  /* Reduzir margin-bottom do section-header sem descrição */
  .section-header {
    margin-bottom: 2rem !important; /* Menor que 4rem */
  }

  .section-header h2 {
    margin-bottom: 0 !important; /* Remove margin do título */
  }

  /* Soluções mobile: apenas SVG + título, cards 1:1 */
  #solucoes .solution-card {
    aspect-ratio: 1 / 1; /* Cards quadrados */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 1.5rem !important;
  }

  #solucoes .solution-card p {
    display: none !important; /* Ocultar descrição */
  }

  #solucoes .solution-icon {
    margin-bottom: 1rem !important;
  }

  #solucoes .solution-icon .icon {
    width: 40px !important; /* SVG maior */
    height: 40px !important;
  }

  #solucoes .solution-card h3 {
    margin: 0 !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
  }

  /* Projetos mobile: ícones SVG ao invés de imagens */
  #projetos .project-image-container {
    position: relative;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(216, 50, 143, 0.1), rgba(41, 216, 228, 0.1));
    border-radius: 1rem;
  }

  #projetos .project-image-container img {
    display: none; /* Ocultar imagem real */
  }

  /* Ícones SVG para projetos (diferentes para cada um) */
  #projetos .project-image-container::before {
    content: '';
    width: 50px;
    height: 50px;
    background: var(--primary);
    -webkit-mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
  }

  /* Ícones diferentes para cada projeto */
  #projetos .card:nth-child(1) .project-image-container::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M9.75 17L9 20l-1 1h8l-1-1-.75-3M3 13h18M5 17h14a2 2 0 002-2V5a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M9.75 17L9 20l-1 1h8l-1-1-.75-3M3 13h18M5 17h14a2 2 0 002-2V5a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z'/%3E%3C/svg%3E");
  }

  #projetos .card:nth-child(2) .project-image-container::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M12 18h.01M8 21h8a2 2 0 002-2V5a2 2 0 00-2-2H8a2 2 0 00-2 2v14a2 2 0 002 2z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M12 18h.01M8 21h8a2 2 0 002-2V5a2 2 0 00-2-2H8a2 2 0 00-2 2v14a2 2 0 002 2z'/%3E%3C/svg%3E");
  }

  #projetos .card:nth-child(3) .project-image-container::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9'/%3E%3C/svg%3E");
  }

  #projetos .card:nth-child(4) .project-image-container::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10'/%3E%3C/svg%3E");
  }

  /* Botões "Ver todos" menores no mobile */
  .btn-view-all,
  .view-all-container .btn {
    padding: 0.75rem 1.5rem !important; /* Menor que 1rem 2rem */
    font-size: 0.9rem !important; /* Fonte menor */
  }

  .view-all-container {
    margin-top: 2rem !important; /* Menos espaço acima */
    margin-bottom: 1.5rem !important; /* Menos espaço abaixo */
  }

  /* Ajustes específicos mobile para blog */
  #blog .blog-card-wrapper {
    gap: 0.75rem;
  }

  #blog .blog-card .card-content {
    padding: 0.75rem !important;
    height: 35% !important; /* Menor altura no mobile */
  }

  #blog .blog-card .card-content h3 {
    font-size: 0.8rem !important; /* Fonte menor no mobile */
  }

  #blog .read-more-external {
    font-size: 0.8rem !important;
    padding: 0.5rem;
    /* Herda transparência do estilo global */
  }
}

/* Tablet horizontal */
@media (min-width: 769px) and (max-width: 1024px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* =========================
   SECTION ESPECÍFICAS APÓS HERO
========================= */
.section-after-hero {
  /* Classe auxiliar para seções que vêm logo após o hero */
  margin-top: 0;
}

/* =========================
   CONTAINER ESPECIAIS
========================= */
.form-container {
  max-width: var(--desktop);
  margin: 0 auto;
  width: 100%;
}

/* =========================
   LAYOUT RESPONSIVO AVANÇADO
========================= */

/* Ajustes para telas muito pequenas */
@media (max-width: 320px) {
  .container {
    padding: 0 1rem;
  }
  
  .section {
    padding: 2rem 0;
  }
}

/* Ajustes para telas grandes */
@media (min-width: 1400px) {
  .container {
    max-width: 1200px;
  }
}

/* =========================
   LAYOUT PARA IMPRESSÃO
========================= */
@media print {
  .section {
    padding: 1rem 0;
    page-break-inside: avoid;
  }
  
  .page-header {
    min-height: 120px !important; /* Altura mínima ainda menor no mobile */
    padding: 1rem 0 !important; /* Padding bem reduzido no mobile */
  }

  .hero-bg {
    min-height: auto !important;
    padding: 2rem 0 !important;
  }
  
  .grid-solutions,
  .grid-projects-blog {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1rem !important;
  }
}

/* =========================
   FALLBACKS PARA BROWSERS ANTIGOS
========================= */
@supports not (backdrop-filter: blur(20px)) {
  .card,
  .contact-form,
  .dropdown-menu {
    background: rgba(35, 35, 79, 0.95) !important;
  }
}

@supports not (grid-template-columns: subgrid) {
  /* Fallbacks para browsers sem suporte a subgrid */
  .grid {
    display: flex;
    flex-wrap: wrap;
  }
}


/* Headers das páginas com z-index menor que menu */
.page-header,
.blog-header,
.project-header {
    z-index: 100;
}