/**
 * ============================================================================
 * TELEFONE HOME - Estilos para Simulação de Celular e Loading RCS
 * ============================================================================
 * 
 * Este arquivo contém os estilos para:
 * - Simulação visual de um smartphone (moldura, tela, botões laterais)
 * - Animações de orbit rings (anéis orbitais)
 * - Tela de loading RCS com animações
 * - Ícones flutuantes no fundo do loading
 * 
 * Estrutura:
 * 1. Moldura do celular
 * 2. Botões laterais
 * 3. Notch Android
 * 4. Tela (tema claro)
 * 5. Status bar
 * 6. Orbit rings e animações
 * 7. Loading RCS
 * 8. Animações do loading
 * 9. Fundo com ícones flutuantes
 * 10. Responsividade (media queries)
 * 
 * ============================================================================
 */

/* ============================================================================
 * 1. MOLDURA DO CELULAR
 * ============================================================================ */

.telefone-sim {
  width: min(100%, 360px);
  /* fallback; no HERO usamos clamp() */
  aspect-ratio: 360 / 740;
  margin-inline: auto;
  perspective: 1200px;
  position: relative;
  display: grid;
  place-items: center;
}

.telefone-sim .moldura {
  position: relative;
  z-index: 1;
  width: 78%;
  height: 70%;
  min-height: 470px;
  border-radius: 11px;
  overflow: hidden;
  background: #0a0f15;
  border: 1px solid rgba(255, 255, 255, 0.16);
  transform-origin: center;
  transition: transform 0.45s cubic-bezier(0.2, 0.9, 0.2, 1), opacity 0.35s;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.692);
}

.telefone-sim .moldura::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 6px;
  pointer-events: none;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.22),
    rgba(0, 0, 0, 0.5)
  );
}

.telefone-sim .moldura::after {
  content: "";
  position: absolute;
  inset: 1px 1px auto 1px;
  height: 10px;
  border-radius: 26px 26px 0 0;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.35),
    rgba(255, 255, 255, 0)
  );
  mix-blend-mode: screen;
  pointer-events: none;
}

/* ============================================================================
 * 2. BOTÕES LATERAIS
 * ============================================================================ */

.side-button {
  position: absolute;
  width: 4px;
  border-radius: 3px;
  background: linear-gradient(90deg, #0a0d12, #2b3440 50%, #0a0d12);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.side-vol1 {
  left: -3px;
  top: 170px;
  height: 44px;
}

.side-vol2 {
  left: -3px;
  top: 220px;
  height: 30px;
}

.side-power {
  right: -4px;
  top: 190px;
  height: 56px;
}

/* ============================================================================
 * 3. NOTCH ANDROID
 * ============================================================================ */

.telefone-sim[data-os="android"] .notch-android {
  position: absolute;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  width: 55px;
  height: 5px;
  border-radius: 999px;
  z-index: 1;
  background: linear-gradient(180deg, rgb(0 0 0 / 98%), rgba(7, 10, 14, 0.6));
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
}

.telefone-sim[data-os="android"] .notch-android .cam {
  margin-top: 26px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-left: auto;
  margin-right: 22px;
  background: radial-gradient(
      circle at 35% 35%,
      #5cc7ff 0 25%,
      transparent 26 100%
    ),
    radial-gradient(circle at 50% 50%, #0a0f14 0 55%, #05080c 56 100%);
  box-shadow: 0 0 0 1px rgb(255 255 255 / 54%), inset 0 0 6px rgba(0, 0, 0, 0.6);
}

/* ============================================================================
 * 4. TELA (TEMA CLARO)
 * ============================================================================ */

.tela {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 12px;
  bottom: 12px;
  border-radius: 7px;
  color: #0f172a;
  background: #f8fbff;
  border: 1px solid rgba(15, 23, 42, 0.1);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.02),
    inset 0 10px 30px rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  padding: 8px 0;
  overflow: hidden;
}

/* ============================================================================
 * 5. STATUS BAR
 * ============================================================================ */

.status-bar .lado-esq,
.status-bar .lado-dir {
  display: flex;
  gap: 10px;
  align-items: center;
}

.status-bar .lado-centro {
  display: none;
}

.status-bar .ico {
  width: 22px;
  height: 22px;
  color: currentColor;
}

.status-bar .bateria {
  width: 30px;
}

.status-bar .nivel {
  opacity: 0.9;
}

/* ============================================================================
 * 6. ORBIT RINGS E ANIMAÇÕES
 * ============================================================================ */

.orbit-rings {
  position: absolute;
  width: min(95vw, 105%);
  height: auto;
  top: 80%;
  left: 50%;
  transform: translate(-50%, -50%) perspective(1000px) rotateX(70deg);
  transform-origin: center;
  animation: orbitSpin 75s linear infinite;
  max-width: 860px;
  z-index: 0;
  pointer-events: none;
  filter: drop-shadow(0 0 25px rgb(113, 137, 233));
  opacity: 1;
}

/* Animação de rotação dos orbit rings */
@keyframes orbitSpin {
  from {
    transform: translate(-50%, -50%) perspective(1000px) rotateX(75deg)
      rotate(0deg);
  }
  to {
    transform: translate(-50%, -50%) perspective(1000px) rotateX(75deg)
      rotate(360deg);
  }
}

.orbit-rings circle {
  stroke-dasharray: 8 12;
  animation: dashFlow 3s linear infinite;
}

/* Animação do fluxo das linhas tracejadas */
@keyframes dashFlow {
  to {
    stroke-dashoffset: -40;
  }
}

/* ============================================================================
 * 7. LOADING RCS
 * ============================================================================ */

.loading-rcs {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: linear-gradient(199deg, #7b2fff 0%, #3ac6ff 120%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-family: "Inter", sans-serif;
  pointer-events: auto; /* bloqueia cliques enquanto o loader está visível */
}

.loading-rcs-container {
  position: relative;
  width: 100%;
  max-width: 1300px;
  min-height: 100vh; /* garante referência de 50% para o SVG centralizar na tela */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  isolation: isolate; /* mantém o SVG (z-index baixo) atrás sem “vazar” */
}

/* Logo */
.loading-rcs-logo {
  width: 240px;
  position: relative;
  z-index: 2; /* acima do SVG de fundo */
  opacity: 0;
  transform: translateY(-200px);
  filter: drop-shadow(0 0 22px rgba(255, 255, 255, 0.377));
  animation: logoEnter 1.3s cubic-bezier(0.77, 0, 0.175, 1) forwards 0s;
}

/* Sinal de + */
.loading-rcs-plus {
  font-size: 50px;
  font-weight: 300;
  color: #ffffff;
  margin: 0px 0;
  position: relative;
  z-index: 2; /* acima do SVG de fundo */
  opacity: 0;
  transform: scale(0.8);
  animation: plusAppear 1s ease forwards 0s;
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.192);
}

/* Imagem RCS */
.loading-rcs-image {
  width: 230px;
  position: relative;
  z-index: 2; /* acima do SVG de fundo */
  opacity: 0;
  transform: translateY(200px);
  filter: drop-shadow(0 0 14px rgba(10, 10, 10, 0.281));
  animation: imageEnter 1.3s cubic-bezier(0.77, 0, 0.175, 1) forwards 0s;
}

/* ============================================================================
 * 8. ANIMAÇÕES DO LOADING
 * ============================================================================ */

/* Logo desce */
@keyframes logoEnter {
  0% {
    opacity: 0;
    transform: translateY(-200px);
  }
  60% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Imagem sobe */
@keyframes imageEnter {
  0% {
    opacity: 0;
    transform: translateY(200px);
  }
  60% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Sinal de + aparece */
@keyframes plusAppear {
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Movimento de abertura */
.loading-rcs.open .loading-rcs-logo {
  animation: logoExit 1.5s cubic-bezier(0.77, 0, 0.175, 1) forwards;
}

.loading-rcs.open .loading-rcs-image {
  animation: imageExit 1.5s cubic-bezier(0.77, 0, 0.175, 1) forwards;
}

.loading-rcs.open .loading-rcs-plus {
  animation: plusExit 0.8s ease forwards;
}

/* Logo sobe para o topo esquerdo */
@keyframes logoExit {
  0% {
    transform: translateY(0);
    opacity: 1;
  }
  100% {
    transform: translate(-510px, -260px);
    opacity: 0;
  }
}

/* Imagem desce e desaparece */
@keyframes imageExit {
  0% {
    transform: translateY(0);
    opacity: 1;
  }
  100% {
    transform: translateY(250px);
    opacity: 0;
  }
}

/* Sinal de + desaparece */
@keyframes plusExit {
  to {
    opacity: 0;
    transform: scale(0.7);
  }
}

.loading-rcs.hide {
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

/* ============================================================================
 * 9. FUNDO COM ÍCONES FLUTUANTES
 * ============================================================================ */

.loading-rcs-bg {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
  transition: opacity 0.8s ease;
}

.loading-rcs.hide .loading-rcs-bg {
  opacity: 0;
  transition: opacity 0.4s ease;
}

/* Estilo base dos ícones */
.loading-rcs-bg .bg-icon {
  position: absolute;
  opacity: 0.28;
  transform: translateY(0) scale(1);
  animation: floatY 8s ease-in-out infinite alternate,
    driftX 12s ease-in-out infinite alternate, slowSpin 20s linear infinite;
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.1));
  transition: opacity 0.8s ease;
}

/* Ícones também desaparecem com o fundo */
.loading-rcs.hide .bg-icon {
  opacity: 0;
}

/* Tamanhos variados dos ícones */
.loading-rcs-bg .shield-check {
  width: 70px;
  height: 70px;
}

.loading-rcs-bg .google {
  width: 80px;
  height: 80px;
}

.loading-rcs-bg .google1 {
  width: 80px;
  height: 80px;
}

.loading-rcs-bg .message {
  width: 68px;
  height: 68px;
}

.loading-rcs-bg .shield-lock {
  width: 64px;
  height: 64px;
}

.loading-rcs-bg .shield-lock1 {
  width: 64px;
  height: 64px;
}

.loading-rcs-bg .whatsapp {
  width: 75px;
  height: 75px;
}

.loading-rcs-bg .icon-rcs-loading {
  width: 75px;
  height: 75px;
  left: 35%;
  top: 30%;
  animation-delay: 0.4s, 0.9s;
}

/* Posições espalhadas pelo fundo */
.loading-rcs-bg .google {
  left: 10%;
  top: 20%;
  animation-delay: 0s, 0s;
}

.loading-rcs-bg .shield-check {
  left: 70%;
  top: 25%;
  animation-delay: 0.8s, 1s;
}

.loading-rcs-bg .message {
  left: 25%;
  top: 70%;
  animation-delay: 1.2s, 0.6s;
}

.loading-rcs-bg .shield-lock {
  left: 55%;
  top: 75%;
  animation-delay: 0.4s, 0.9s;
}

.loading-rcs-bg .whatsapp {
  left: 85%;
  top: 55%;
  animation-delay: 1.5s, 0.3s;
}

.loading-rcs-bg .google1 {
  left: 79%;
  top: 13%;
  animation-delay: 0s, 0s;
}

.loading-rcs-bg .shield-lock1 {
  left: 30%;
  top: 5%;
  animation-delay: 0.4s, 0.9s;
}

/* Animações dos ícones flutuantes */
@keyframes floatY {
  0% {
    transform: translateY(0) scale(1);
  }
  100% {
    transform: translateY(-150px) scale(1.05);
  }
}

@keyframes driftX {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(50px);
  }
}

@keyframes slowSpin {
  0% {
    rotate: 0deg;
  }
  100% {
    rotate: 120deg;
  }
}

/* ============================================================================
 * 10. RESPONSIVIDADE
 * ============================================================================ */

/* Telas grandes (desktop) */
@media (min-width: 1400px) {
  .orbit-rings {
    max-width: 1200px;
    top: 82%;
    filter: drop-shadow(0 0 35px rgba(113, 137, 233, 0.7));
  }
}

/* Tablets e telas médias */
@media (max-width: 992px) {
  .orbit-rings {
    width: 111%;
    top: 82%;
    transform: translate(-50%, -50%) perspective(900px) rotateX(68deg);
    filter: drop-shadow(0 0 18px rgba(113, 137, 233, 0.6));
  }
}

/* Tablets pequenos */
@media (max-width: 768px) {
  .orbit-rings {
    width: 144%;
    top: 84%;
    transform: translate(-50%, -50%) perspective(800px) rotateX(65deg);
  }
}

/* Smartphones grandes */
@media (max-width: 480px) {
  .orbit-rings {
    width: 98%;
    top: 86%;
    transform: translate(-50%, -50%) perspective(700px) rotateX(60deg);
    filter: drop-shadow(0 0 15px rgba(113, 137, 233, 0.4));
  }
}
@media (max-width: 430px) {
  .orbit-rings {
    width: 106%;
    top: 86%;
    transform: translate(-50%, -50%) perspective(700px) rotateX(60deg);
    filter: drop-shadow(0 0 15px rgba(113, 137, 233, 0.4));
  }
}
@media (max-width: 414px) {
  .orbit-rings {
    width: 107%;
    top: 84%;
  }
  .telefone-sim .moldura {
    width: 76%;
    height: 65%;
  }
}

/* Smartphones pequenos */
@media (max-width: 375px) {
  .telefone-sim .moldura {
    width: 70%;
    height: 60%;
  }

  .orbit-rings {
    width: 107%;
    top: 81%;
    transform: translate(-50%, -50%) perspective(600px) rotateX(58deg);
  }
  .rcs-section1 .status-bar .ico.sinal,
  .rcs-section1 .status-bar .ico.wifi {
    opacity: 0;
  }
}
