/* ==============================================
   SEÇÃO ESTATÍSTICAS - Design Premium e Profissional
   Cards de estatísticas com visual impactante
============================================== */

.stats {
  padding: 5rem 0;
  background: 
    linear-gradient(135deg, #FEFCF7 0%, #F5F0E8  50%, #F0E6D2 100%);
  position: relative;
  margin-top: -100px;
  z-index: 10;
  border-radius: 30px 30px 0 0;
  box-shadow: 
    0 -10px 40px rgba(0, 0, 0, 0.1),
    0 20px 60px rgba(0, 0, 0, 0.05);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  overflow: hidden;
}

/* Efeito de fundo animado */
.stats::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 15% 15%, rgba(139, 90, 60, 0.03) 0%, transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(93, 78, 55, 0.03) 0%, transparent 40%),
    radial-gradient(circle at 50% 50%, rgba(184, 134, 11, 0.02) 0%, transparent 60%);
  animation: statsFloat 15s ease-in-out infinite;
  pointer-events: none;
}

.stats .container {
  position: relative;
  z-index: 2;
  max-width: 1200px;
}

/* Grid responsivo das estatísticas */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* Desktop: 4 colunas iguais */
  gap: 2.5rem;
  align-items: stretch;
  margin-bottom: 3rem;
  max-width: 1200px; /* Limitar largura máxima */
  margin-left: auto;
  margin-right: auto;
}

/* Card individual de estatística */
.stat-item {
  text-align: center;
  padding: 3rem 2rem;
  position: relative;
  border-radius: 25px;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  background: 
    linear-gradient(145deg, 
      rgba(255, 255, 255, 0.9) 0%, 
      rgba(248, 250, 252, 0.8) 100%);
  border: 1px solid rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(30px);
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  overflow: hidden;
  cursor: pointer;
  display: flex; /* Flexbox para melhor alinhamento */
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 200px; /* Altura mínima para consistência */
}

/* Efeito de hover premium */
.stat-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    linear-gradient(145deg, 
      rgba(139, 90, 60, 0.05) 0%, 
      rgba(93, 78, 55, 0.03) 50%,
      rgba(184, 134, 11, 0.05) 100%);
  opacity: 0;
  transition: all 0.5s ease;
  border-radius: 25px;
}

.stat-item:hover::before {
  opacity: 1;
}

.stat-item:hover {
  transform: translateY(-15px) scale(1.03);
  box-shadow: 
    0 20px 60px rgba(0, 0, 0, 0.15),
    0 8px 25px rgba(139, 90, 60, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

/* Ícone decorativo no topo do card */
.stat-item::after {
  content: '';
  position: absolute;
  top: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 4px;
  background: var(--gradient-primary);
  border-radius: 0 0 20px 20px;
  transition: all 0.5s ease;
}

.stat-item:hover::after {
  width: 80px;
  height: 6px;
}

/* Número da estatística */
.stat-number {
  font-size: clamp(3rem, 5vw, 4rem); /* Tamanho mais controlado */
  font-weight: 900;
  color: var(--primary-color);
  margin-bottom: 1.2rem; /* Espaçamento aumentado */
  background: linear-gradient(135deg, #8B5A3C 0%, #A67C5A 50%, #B8860B 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
  display: block;
  position: relative;
  text-shadow: 0 4px 20px rgba(230, 57, 70, 0.2);
  animation: countUp 2s ease-out 0.5s both;
  text-align: center; /* Garantir centralização */
}

/* Efeito de brilho no número */
.stat-number::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.4),
    transparent
  );
  animation: numberShine 3s ease-in-out 2s infinite;
}

/* Label da estatística */
.stat-label {
  font-size: 1.1rem; /* Tamanho reduzido para melhor fit */
  color: var(--dark-text);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px; /* Espaçamento reduzido */
  line-height: 1.3; /* Line height ajustado */
  position: relative;
  z-index: 2;
  text-align: center; /* Garantir centralização */
  max-width: 100%; /* Evitar overflow */
  word-break: break-word; /* Quebrar palavras se necessário */
}

/* Descrição adicional */
.stats-description {
  text-align: center;
  margin-top: 3rem;
  padding: 2rem;
  background: 
    linear-gradient(135deg, 
      rgba(255, 255, 255, 0.6) 0%, 
      rgba(248, 250, 252, 0.4) 100%);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(20px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.05);
}

.stats-description p {
  font-size: 1.2rem;
  color: var(--light-text);
  font-style: italic;
  margin: 0;
  line-height: 1.6;
  font-weight: 500;
}

/* ==============================================
   ANIMAÇÕES PREMIUM DAS ESTATÍSTICAS
============================================== */

@keyframes statsFloat {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  33% {
    transform: translateY(-5px) rotate(0.5deg);
  }
  66% {
    transform: translateY(5px) rotate(-0.5deg);
  }
}

@keyframes countUp {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.5);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes numberShine {
  0% {
    left: -100%;
  }
  50% {
    left: 100%;
  }
  100% {
    left: 100%;
  }
}

/* Animação de entrada escalonada */
.stat-item:nth-child(1) {
  animation: slideInUp 0.8s ease-out 0.2s both;
}

.stat-item:nth-child(2) {
  animation: slideInUp 0.8s ease-out 0.4s both;
}

.stat-item:nth-child(3) {
  animation: slideInUp 0.8s ease-out 0.6s both;
}

.stat-item:nth-child(4) {
  animation: slideInUp 0.8s ease-out 0.8s both;
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(60px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ==============================================
   RESPONSIVIDADE PREMIUM
============================================== */

/* Desktop grande - manter 4 colunas com espaçamento otimizado */
@media (min-width: 1201px) {
  .stats-grid {
    max-width: 1400px;
    gap: 3rem;
  }
  
  .stat-item {
    padding: 3.5rem 2.5rem;
    min-height: 220px;
  }
  
  .stat-number {
    font-size: 4.2rem;
    margin-bottom: 1.5rem;
  }
  
  .stat-label {
    font-size: 1.2rem;
    letter-spacing: 1px;
  }
}

@media (max-width: 1200px) and (min-width: 993px) {
  .stats-grid {
    grid-template-columns: repeat(4, 1fr); /* Manter 4 colunas em desktop médio */
    gap: 2rem;
    max-width: 1000px;
  }
  
  .stat-item {
    padding: 2.8rem 1.8rem;
    min-height: 180px;
  }
  
  .stat-number {
    font-size: 3.5rem;
  }
  
  .stat-label {
    font-size: 1rem;
    letter-spacing: 0.5px;
  }
}

@media (max-width: 992px) {
  .stats {
    padding: 4rem 0;
    margin-top: -80px;
    border-radius: 25px 25px 0 0;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr); /* 2 colunas em tablet */
    gap: 2rem;
    max-width: 600px;
  }
  
  .stat-item {
    padding: 2.5rem 1.5rem;
    min-height: 160px;
  }
  
  .stat-number {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    margin-bottom: 0.8rem;
  }
  
  .stat-label {
    font-size: 1.1rem;
  }
}

@media (max-width: 768px) {
  .stats {
    padding: 3rem 0;
    margin-top: -60px;
    border-radius: 20px 20px 0 0;
  }
  
  .stats-grid {
    grid-template-columns: 1fr; /* 1 coluna no mobile */
    gap: 1.5rem;
    max-width: 400px;
    margin: 0 auto 2rem;
  }
  
  .stat-item {
    padding: 2rem 1.5rem;
    border-radius: 20px;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  
  .stat-item:hover {
    transform: translateY(-8px) scale(1.02);
  }
  
  .stat-number {
    font-size: clamp(2.2rem, 7vw, 3rem);
    margin-bottom: 0.8rem;
  }
  
  .stat-label {
    font-size: 1rem;
    letter-spacing: 0.5px;
    line-height: 1.2;
  }
  
  .stats-description {
    margin-top: 2rem;
    padding: 1.5rem;
  }
  
  .stats-description p {
    font-size: 1.1rem;
  }
}
  
  .stat-item {
    padding: 2rem 1.5rem;
    border-radius: 20px;
  }
  
  .stat-item:hover {
    transform: translateY(-8px) scale(1.02);
  }
  
  .stats-description {
    margin-top: 2rem;
    padding: 1.5rem;
  }
  
  .stats-description p {
    font-size: 1.1rem;
  }

@media (max-width: 480px) {
  .stats {
    padding: 2.5rem 0;
    margin-top: -40px;
  }
  
  .stat-item {
    padding: 1.8rem 1.2rem;
    border-radius: 15px;
    min-height: 120px;
  }
  
  .stat-number {
    font-size: clamp(2rem, 8vw, 2.8rem);
    margin-bottom: 0.6rem;
  }
  
  .stat-label {
    font-size: 0.9rem;
    letter-spacing: 0.3px;
    line-height: 1.1;
  }
  
  .stats-description {
    padding: 1.2rem;
    border-radius: 15px;
  }
  
  .stats-description p {
    font-size: 1rem;
  }
}

/* ==============================================
   EFEITOS ESPECIAIS INTERATIVOS
============================================== */

/* Efeito de pulse no hover */
.stat-item:hover .stat-number {
  animation: pulse 1.5s ease-in-out infinite;
}

/* Efeito de shake sutil */
.stat-item:active {
  animation: shake 0.5s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateY(-15px) scale(1.03) rotate(0deg); }
  25% { transform: translateY(-15px) scale(1.03) rotate(0.5deg); }
  75% { transform: translateY(-15px) scale(1.03) rotate(-0.5deg); }
}

/* Loader para números */
.stat-number.loading {
  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

@keyframes loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
