/* =========================================================
   builder.mobile.css
   MOBILE OVERRIDES (aplica só no mobile)
   Use com:
   <link rel="stylesheet" href="/css/mobile/builder.mobile.css" media="(max-width: 900px)">
========================================================= */

@media (max-width: 900px) {

  /* -----------------------------------------
     1) Corrige bugs clássicos de 100vh no mobile
     (barra do navegador muda a altura)
  ----------------------------------------- */
  body {
    height: auto;
    /* antes: 100vh (desktop) */
    min-height: 100vh;
    /* mantém tela cheia */
    overflow-x: hidden;
  }

  /* Evita scroll bar aparecendo em layouts internos */
  html {
    overflow-x: hidden;
  }

  /* Evita zoom automático no iOS */
  input,
  select,
  textarea,
  button {
    font-size: 16px;
  }

  /* -----------------------------------------
     2) Container: de lado a lado -> coluna
  ----------------------------------------- */
  .container {
    flex-direction: column;
    height: auto;
    /* antes calc(100vh - 70px) */
    max-width: 100%;
    padding: 0 16px;
    /* antes 40px */
    gap: 16px;
  }

  /* -----------------------------------------
     3) Editor: 50% -> 100%, padding menor
     Mantém scroll no editor (sua decisão está ótima)
  ----------------------------------------- */
  .editor {
    width: 100%;
    padding: 22px 0;
    /* antes 80px */
    overflow-y: visible;
    /* no mobile, melhor deixar o body rolar */
  }

  /* Se você quiser manter o scroll dentro do editor no mobile também,
     troque overflow-y: visible por overflow-y: auto e ajuste max-height.
     Mas eu recomendo deixar o body rolar no mobile. */

  /* -----------------------------------------
     4) Header mais compacto
  ----------------------------------------- */
  .header {
    padding: 0 16px;
  }

  .header-text {
    display: none;
    /* opcional: limpa ruído no mobile */
  }






  /* ---------------- MENU MOBILE ---------------- */
  .dynamic-header .menu-toggle {
    display: none;
  }

  .dynamic-header .hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
    z-index: 1101;
    /* sem absolute fixo (fica consistente com shrink) */
  }

  .dynamic-header .hamburger span {
    height: 3px;
    width: 25px;
    background: #fff;
    border-radius: 2px;
    transition: 0.3s ease;
    transform-origin: center;
  }

  /* X no hambúrguer */
  .dynamic-header .menu-toggle:checked+.hamburger span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .dynamic-header .menu-toggle:checked+.hamburger span:nth-child(2) {
    opacity: 0;
  }

  .dynamic-header .menu-toggle:checked+.hamburger span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
  }

  /* ---------------- RESPONSIVO ---------------- */
  @media (max-width: 768px) {
    .dynamic-header {
      width: min(95%, 1200px);
      padding: 15px 25px;
    }

    .dynamic-header .logo {
      font-size: 18px;
    }

    .dynamic-header .hamburger {
      display: flex;
    }

    /* transforma o menu em dropdown */
    .dynamic-header .nav-menu {
      position: absolute;
      top: calc(100% + 10px);
      right: 18px;
    }

    .dynamic-header .nav-menu ul {
      flex-direction: column;
      align-items: center;

      width: 190px;
      padding: 16px 14px;
      gap: 18px;

      background-color: rgba(10, 15, 30, 0.95);
      border-radius: 15px;
      box-shadow: 0 0 15px rgba(0, 212, 255, 0.2);

      opacity: 0;
      transform: translateY(-6px);
      pointer-events: none;
      transition: opacity 0.25s ease, transform 0.25s ease;
    }

    .dynamic-header .menu-toggle:checked~.nav-menu ul {
      opacity: 1;
      transform: translateY(0);
      pointer-events: auto;
    }
  }

  /* -----------------------------------------
     5) Stepper: vertical -> horizontal compacto
  ----------------------------------------- */
  /* ============================
     STEPPER MOBILE com LINHA (sem depender de .step-line no HTML)
  ============================ */
  .stepper-vertical {
    position: relative;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 12px 0;
  }

  /* Linha horizontal (sempre aparece) */
  .stepper-vertical::before {
    content: "";
    position: absolute;
    left: 8%;
    right: 8%;
    top: 50%;
    transform: translateY(-50%);
    height: 2px;

    background: linear-gradient(90deg,
        var(--neon),
        rgba(0, 217, 255, 0.15));

    z-index: 1;
  }

  .stepper-vertical .step {
    min-width: 34px;
    height: 34px;
    font-size: 13px;
    padding: 0 10px;

    position: relative;
    z-index: 2;
    /* fica acima da linha */
  }

  .stepper-vertical .step.active {
    height: 34px;
    padding: 0 12px;
    box-shadow:
      0 0 10px rgba(0, 217, 255, 0.55),
      0 0 24px rgba(0, 217, 255, 0.28);
  }

  /* Se existir .step-line no HTML, garantimos que não atrapalha */
  .stepper-vertical .step-line {
    display: none !important;
  }


  /* -----------------------------------------
     6) Actions: botões para toque (100% largura)
  ----------------------------------------- */
  .actions {
    max-width: 100%;
    margin-top: 22px;
    gap: 12px;

    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
  }

  .actions .btn {
    width: 100%;
    justify-content: center;
    min-height: 48px;
  }

  .actions .helper-text {
    text-align: center;
  }

  /* -----------------------------------------
     7) Remove barra de scroll visível (se aparecer)
  ----------------------------------------- */
  ::-webkit-scrollbar {
    width: 0px;
    height: 0px;
  }

  * {
    scrollbar-width: none;
  }
}



/* =====================================
   MOBILE: botão "Ver preview" (abaixo do Continuar)
   - não aparece no desktop
===================================== */

/* MOBILE: botão de preview aparece */
.btn-preview {
  display: inline-flex !important;
  /* ou flex */
  align-items: center;
  justify-content: center;
}

@media (max-width: 900px) {

  /* vira um "chip/atalho" (não parece CTA principal) */
  .btn-preview {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    width: auto;
    /* não ocupa a largura toda */
    max-width: none;
    margin: 12px auto 0;
    /* centralizado abaixo dos botões */
    padding: 7px 12px;
    /* menor */

    border-radius: 999px;
    border: 1px solid rgba(147, 197, 253, 0.16);
    background: rgba(2, 6, 23, 0.10);
    /* bem sutil */
    backdrop-filter: blur(8px);

    color: rgba(203, 213, 245, 0.78);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.10em;
    text-transform: uppercase;

    box-shadow: none;
    cursor: pointer;
    user-select: none;

    opacity: 0.95;
    transition: opacity 0.2s ease, transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  }

  .btn-preview:hover {
    opacity: 1;
    border-color: rgba(147, 197, 253, 0.30);
    background: rgba(2, 6, 23, 0.16);
    transform: translateY(-1px);
  }

  .btn-preview:active {
    transform: translateY(0);
    opacity: 1;
  }

  /* seta pequena, com “bop” pra baixo */
  .btn-preview-arrow {
    width: 8px;
    height: 8px;
    border-right: 2px solid rgba(147, 197, 253, 0.85);
    border-bottom: 2px solid rgba(147, 197, 253, 0.85);
    transform: rotate(45deg);
    opacity: 0.9;
    animation: previewArrowBop 1.1s ease-in-out infinite;
  }

  @keyframes previewArrowBop {

    0%,
    100% {
      transform: rotate(45deg) translateY(0);
      opacity: 0.65;
    }

    50% {
      transform: rotate(45deg) translateY(3px);
      opacity: 1;
    }
  }


  /* ==========================================================
   TOAST DE PREVIEW — aparece só no mobile, uma única vez
========================================================== */
  @media (max-width: 900px) {

    .toast-preview {
      position: fixed;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%) scale(0.85);

      z-index: 9998;

      background: rgba(5, 12, 30, 0.96);
      border: 1px solid rgba(0, 217, 255, 0.25);
      border-radius: 24px;

      padding: 28px 32px;

      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 16px;

      text-align: center;
      max-width: 300px;
      width: 88vw;

      box-shadow:
        0 0 40px rgba(0, 217, 255, 0.15),
        0 20px 60px rgba(0, 0, 0, 0.6);

      /* Começa invisível */
      opacity: 0;
      pointer-events: none;
      transition:
        opacity 0.4s ease,
        transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    }

    /* Quando ativo */
    .toast-preview.toast-visivel {
      opacity: 1;
      pointer-events: auto;
      transform: translate(-50%, -50%) scale(1);
    }

    .toast-preview-emoji {
      font-size: 36px;
      line-height: 1;
    }

    .toast-preview-titulo {
      font-size: 16px;
      font-weight: 700;
      color: #fff;
      line-height: 1.3;
    }

    .toast-preview-sub {
      font-size: 13px;
      color: rgba(255, 255, 255, 0.55);
      line-height: 1.5;
    }

    /* Setas animadas de scroll para baixo */
    .toast-preview-setas {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 4px;
      margin-top: 4px;
    }

    .toast-preview-setas span {
      display: block;
      width: 14px;
      height: 14px;
      border-right: 2px solid rgba(0, 217, 255, 0.8);
      border-bottom: 2px solid rgba(0, 217, 255, 0.8);
      transform: rotate(45deg);
      opacity: 0;
      animation: toastSeta 1.2s ease-in-out infinite;
    }

    .toast-preview-setas span:nth-child(2) {
      animation-delay: 0.2s;
    }

    .toast-preview-setas span:nth-child(3) {
      animation-delay: 0.4s;
    }

    @keyframes toastSeta {
      0% {
        opacity: 0;
        transform: rotate(45deg) translateY(-4px);
      }

      50% {
        opacity: 1;
      }

      100% {
        opacity: 0;
        transform: rotate(45deg) translateY(6px);
      }
    }

    /* Backdrop escuro atrás do toast */
    .toast-preview-backdrop {
      position: fixed;
      inset: 0;
      z-index: 9997;
      background: rgba(0, 0, 0, 0.5);
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.4s ease;
    }

    .toast-preview-backdrop.toast-visivel {
      opacity: 1;
      pointer-events: auto;
    }
  }
}