/* ==========================================================================
   DESIGN SYSTEM & GLOBAL STYLES (CASAL BUSCAPÉ BRAND STYLE)
   ========================================================================== */

:root {
  /* Cores Principais */
  --primary: #BAFF39;          /* Verde Neon do site oficial */
  --primary-glow: rgba(186, 255, 57, 0.4);
  --secondary: #0a0a0a;
  
  /* Fundos */
  --bg-dark: #0a0a0a;          /* Off-black para profundidade visual */
  --bg-card: #111111;          /* Cinza ultra escuro para cartões */
  --bg-card-hover: #181818;
  
  /* Textos */
  --text-main: #ffffff;
  --text-muted: #8e8e8e;
  --text-link: #BAFF39;
  
  /* Bordas */
  --border-color: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(186, 255, 57, 0.4);

  /* Fontes */
  --font-heading: 'Oswald', sans-serif;
  --font-body: 'Roboto', sans-serif;
  --font-accent: 'Outfit', sans-serif;

  /* Efeitos */
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-glow: 0 8px 24px rgba(186, 255, 57, 0.12);
}

/* ==========================================================================
   RESET & CONFIGURAÇÕES GERAIS
   ========================================================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font-body);
  color: var(--text-main);
  background: #0a0a0a;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   FUNDO DINÂMICO COM VÍDEO OFICIAL DE PORTUGAL (NO CABEÇALHO DO TELEMÓVEL)
   ========================================================================== */

.portugal-bg-container {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 310px; /* Delimitado exatamente para o topo do celular */
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.portugal-bg-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  filter: brightness(0.72) contrast(1.05); /* Brilho reduzido levemente para destacar a foto do Casal e textos */
  opacity: 0.7; /* Opacidade levemente reduzida conforme solicitado */
}

/* Retícula de micro-pontinhos pretos densos e sutis sobre o vídeo (Dot Grid Mesh Overlay) */
.portugal-bg-dots {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background-image: radial-gradient(rgba(0, 0, 0, 0.75) 0.8px, transparent 0.8px);
  background-size: 3px 3px; /* Pontinhos mais próximos e mais densos */
  opacity: 0.42; /* Suave, discreto e refinado */
}

/* Gradiente que começa suave no topo e transiciona para PRETO ABSOLUTO antes do 1º botão */
.portugal-bg-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(
    180deg,
    rgba(10, 10, 10, 0.25) 0%,
    rgba(10, 10, 10, 0.5) 40%,
    rgba(10, 10, 10, 0.85) 75%,
    rgba(10, 10, 10, 0.98) 95%,
    #0a0a0a 100%
  );
}

/* ==========================================================================
   BASE ABSOLUTA DA PÁGINA
   ========================================================================== */

.scroll-content {
  position: relative;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  width: 100%;
  z-index: 2;
}

/* ==========================================================================
   FUNDO DECORATIVO DE PORTUGAL EM PRETO E BRANCO (BASE ABSOLUTA DA PÁGINA)
   ========================================================================== */

.footer-bg-container {
  position: absolute;
  bottom: 0; /* Ancorado perfeitamente na borda inferior física do rodapé */
  left: -24px;
  right: -24px;
  height: 560px; /* Cobre da base absoluta subindo até a altura do 4º/5º botão */
  z-index: -2; /* Fica no fundo absoluto, ATRÁS de todos os botões e textos */
  overflow: hidden;
  pointer-events: none;
}

.footer-bg-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center bottom; /* Ancorado perfeitamente na base inferior da foto */
  filter: grayscale(100%) contrast(1.2) brightness(0.85);
  opacity: 0.42; /* Foto de Portugal bem aparente e nítida no pé da página! */
  display: block;
}

/* Retícula de micro-pontinhos pretos densos sobre a foto no fundo inferior */
.footer-bg-dots {
  position: absolute;
  inset: 0;
  z-index: 3; /* Renderiza sobre o gradiente para os pontinhos ficarem visíveis */
  pointer-events: none;
  background-image: radial-gradient(rgba(0, 0, 0, 0.75) 0.8px, transparent 0.8px);
  background-size: 3px 3px;
  opacity: 0.42;
}

/* Gradiente que vem de PRETO SÓLIDO no topo até FICAR TRANSPARENTE no pé da página */
.footer-bg-overlay {
  position: absolute;
  inset: 0;
  z-index: 2; /* Fica sob a retícula de pontinhos */
  pointer-events: none;
  background: linear-gradient(
    180deg,
    #0a0a0a 0%,
    rgba(10, 10, 10, 0.82) 30%,
    rgba(10, 10, 10, 0.35) 65%,
    rgba(10, 10, 10, 0.02) 100%
  );
}

/* Camada de Textura de Ruído (Noise Overlay) */
.noise-overlay {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 50;
  pointer-events: none;
  opacity: 0.02;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
}

/* ==========================================================================
   SIMULADOR DE CELULAR (DESKTOP ONLY)
   ========================================================================== */

.phone-container {
  width: 425px;
  height: 890px;
  background: rgba(10, 10, 10, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 12px solid #222222;
  border-radius: 52px;
  box-shadow: 
    0 25px 50px -12px rgba(0, 0, 0, 0.6),
    0 0 60px rgba(186, 255, 57, 0.06);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  z-index: 2;
  transition: border-color 0.3s ease;
}

.phone-notch {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 160px;
  height: 28px;
  background: #222222;
  border-bottom-left-radius: 18px;
  border-bottom-right-radius: 18px;
  z-index: 10;
}

.phone-screen {
  flex: 1;
  overflow-y: auto;
  padding: 55px 24px 0;
  display: flex;
  flex-direction: column;
  position: relative;
  scrollbar-width: none; /* Firefox */
}

.phone-screen::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

/* ==========================================================================
   CABEÇALHO DE PERFIL
   ========================================================================== */

.profile-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 28px;
  position: relative;
  z-index: 2;
}

.profile-photo-wrapper {
  width: 108px;
  height: 108px;
  margin-bottom: 18px;
  position: relative;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285aeb 90%);
  padding: 5px; /* Borda gradiente estilo Instagram mais grossa e aparente */
  display: flex;
  align-items: center;
  justify-content: center;
  isolation: isolate;
  
  /* Animação de entrada (Zoom Pop-In) */
  opacity: 0;
  transform: scale(0.7);
  animation: popIn 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.15s forwards;
}

/* Aura verde neon suave e discreta em volta da foto */
.profile-photo-wrapper::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: var(--primary);
  border-radius: 50%;
  z-index: -1;
  filter: blur(6px);
  pointer-events: none;
  opacity: 0.25; /* Glow sutil e elegante */
}

.profile-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: none; /* Remove a borda preta divisória */
  position: relative;
  z-index: 2;
}

/* Selo de Verificado Oficial do Instagram (canto superior direito da foto) */
.profile-verified-badge {
  position: absolute;
  top: 0px;
  right: 0px;
  width: 26px;
  height: 26px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.7));
  
  /* Animação de entrada Pop-In com efeito mola (Spring Bounce) */
  opacity: 0;
  transform: scale(0.2) rotate(-20deg);
  animation: badgePopIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.55s forwards;
}

.verified-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.profile-name {
  font-family: var(--font-heading);
  font-size: 26px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-main);
  margin-bottom: 2px;
  text-align: center;
  
  /* Animação de entrada (Slide Down Fade) */
  opacity: 0;
  transform: translateY(-16px);
  animation: slideDownFade 0.65s cubic-bezier(0.16, 1, 0.3, 1) 0.28s forwards;
}

.profile-social-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 14px;
  margin-top: 4px;
  
  /* Animação de entrada (Fade In) */
  opacity: 0;
  animation: fadeIn 0.6s ease-out 0.4s forwards;
}

.profile-social-links {
  display: flex;
  align-items: center;
  gap: 10px;
}

.social-icon-link {
  color: #ffffff;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  opacity: 0.9;
  transition: all 0.25s ease;
}

.social-icon-link:hover {
  color: var(--primary);
  opacity: 1;
  transform: translateY(-2px);
  filter: drop-shadow(0 0 6px var(--primary-glow));
}

.profile-username {
  font-family: var(--font-accent);
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: lowercase;
}

.profile-bio {
  font-size: 14px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.5;
  max-width: 320px;
  
  /* Animação de entrada (Slide Up Fade) */
  opacity: 0;
  transform: translateY(16px);
  animation: slideUpFade 0.65s cubic-bezier(0.16, 1, 0.3, 1) 0.5s forwards;
}

/* ==========================================================================
   LINKS (CARTÕES DOS BOTÕES)
   ========================================================================== */

.links-area {
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  z-index: 2;
}

.link-card {
  display: flex;
  align-items: center;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  text-decoration: none;
  color: var(--text-main);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  
  /* Entrada animada em cascata botão por botão (Fade-in + Slide-up) */
  opacity: 0;
  transform: translateY(22px);
  animation: slideUpCard 0.65s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: calc(0.55s + (var(--i, 1) * 0.08s));
}

.link-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(186, 255, 57, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 18px;
  margin-right: 14px;
  flex-shrink: 0;
  transition: var(--transition);
}

.link-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0; /* Impede estouro do container */
}

.link-title {
  font-family: var(--font-heading);
  font-size: 13.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.link-desc {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: var(--transition);
}

.link-arrow {
  color: var(--text-muted);
  font-size: 12px;
  margin-left: 10px;
  transition: var(--transition);
}

/* Hover e Foco nos Links */
.link-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.link-card:hover .link-icon {
  background: var(--primary);
  color: #000000;
  box-shadow: 0 0 12px var(--primary-glow);
}

.link-card:hover .link-desc {
  color: rgba(255, 255, 255, 0.85);
}

.link-card:hover .link-arrow {
  color: var(--primary);
  transform: translateX(3px);
}

/* Feedback tátil de pressão (crucial para mobile) */
.link-card:active {
  transform: scale(0.97);
  transition-duration: 0.1s;
}

.link-card:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ==========================================================================
   RODAPÉ / BRANDING
   ========================================================================== */

.footer-area {
  margin-top: auto;
  padding-top: 36px;
  padding-bottom: 30px; /* Garante cobertura completa até a base física da tela */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  position: relative;
}

.footer-logo {
  height: 30px;
  width: auto;
  opacity: 0;
  animation: fadeInLogo 0.8s ease-out 1.4s forwards;
  transition: var(--transition);
}

.footer-logo:hover {
  opacity: 0.9 !important;
  filter: drop-shadow(0 0 6px var(--primary-glow));
}

.footer-copyright {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.3px;
  opacity: 0;
  animation: fadeInCopyright 0.8s ease-out 1.4s forwards;
}

@keyframes fadeInLogo {
  to {
    opacity: 0.5;
  }
}

@keyframes fadeInCopyright {
  to {
    opacity: 1;
  }
}

/* ==========================================================================
   ANIMAÇÕES DE ENTRADA (CASCATA HARMONIOSA E SINCRONIZADA)
   ========================================================================== */

@keyframes badgePopIn {
  to {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: scale(0.7);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slideDownFade {
  from {
    opacity: 0;
    transform: translateY(-16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideUpFade {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideUpCard {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ==========================================================================
   MEDIA QUERIES (ADAPTAÇÃO E RESPONSIVIDADE MOBILE REAL)
   ========================================================================== */

@media (max-width: 480px) {
  html, body {
    overflow: auto;
    height: auto;
    min-height: 100dvh;
  }
  
  body {
    background: var(--bg-dark); /* Fundo sólido para performance mobile */
  }
  
  .phone-container {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 0;
    box-shadow: none;
  }
  
  .phone-notch {
    display: none;
  }
  
  .phone-screen {
    padding: 40px 20px 24px;
  }
}

/* Ajuste para telas muito curtas */
@media (max-height: 700px) and (min-width: 481px) {
  .phone-container {
    height: 95dvh;
  }
}

/* ==========================================================================
   ESTADOS DE CLIQUE INTERATIVO & LOADER LIVRE (3.0s COM AVIÃO E GLOBO)
   ========================================================================== */

/* Botões não selecionados saem de cena em animação suave */
.link-card.is-hidden-out {
  opacity: 0 !important;
  transform: translateY(18px) scale(0.96) !important;
  max-height: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  margin-top: -14px !important;
  border-color: transparent !important;
  pointer-events: none !important;
  transition: all 0.45s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Botão selecionado mantido no topo com borda iluminada */
.link-card.is-selected {
  border-color: var(--primary) !important;
  box-shadow: 0 0 20px rgba(186, 255, 57, 0.25) !important;
  background: var(--bg-card-hover) !important;
  transform: scale(1.02) !important;
  z-index: 5 !important;
  transition: all 0.4s ease !important;
}

/* Animação suave de saída do botão selecionado e do loader ao concluir os 5s */
.link-card.is-selected.is-leaving,
.redirect-free-space.is-leaving {
  opacity: 0 !important;
  transform: translateY(-16px) scale(0.96) !important;
  transition: all 0.45s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Contêiner Livre de Carregamento (Sem Box / Sem Moldura, ocupa o espaço vertical livre) */
.redirect-free-space {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px 16px 16px;
  gap: 16px;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  z-index: 5;
}

.redirect-free-space.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Ícone Dinâmico Animado (Ícone Específico do Próprio Botão Clicado) */
.dynamic-icon-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

.icon-pulse-glow {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  background: rgba(186, 255, 57, 0.1);
  border: 1px solid rgba(186, 255, 57, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 28px;
  box-shadow: 0 0 24px rgba(186, 255, 57, 0.25);
  animation: iconPulseBounce 1.8s ease-in-out infinite alternate;
}

@keyframes iconPulseBounce {
  0% {
    transform: scale(0.92);
    box-shadow: 0 0 12px rgba(186, 255, 57, 0.2);
  }
  50% {
    transform: scale(1.08);
    box-shadow: 0 0 28px rgba(186, 255, 57, 0.45);
  }
  100% {
    transform: scale(1.0);
    box-shadow: 0 0 20px rgba(186, 255, 57, 0.3);
  }
}

/* Texto Completo Explicativo */
.redirect-full-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  max-width: 340px;
}

.redirect-headline {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--primary);
  margin: 0;
}

.redirect-detail {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

.redirect-detail span {
  color: #ffffff;
  font-weight: 600;
}

/* Barra de Progresso de 5.0 Segundos */
.redirect-progress-bar {
  width: 180px;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 8px;
}

.redirect-progress-fill {
  width: 0%;
  height: 100%;
  background: var(--primary);
  box-shadow: 0 0 8px var(--primary);
  animation: fillProgressBar 5s linear forwards;
}

@keyframes fillProgressBar {
  to {
    width: 100%;
  }
}

/* ==========================================================================
   ACESSIBILIDADE — REDUCED MOTION (WCAG)
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  .portugal-bg-container,
  .profile-photo-wrapper,
  .profile-name,
  .profile-username,
  .profile-bio,
  .link-card,
  .footer-area {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .link-card:hover,
  .link-card:active {
    transform: none !important;
  }
}
