/* The Veloda Pass extension walkthrough (apps/veloda-pass/extension-setup.html
   and its four translations). Builds on setup-extension.css (the mock browser,
   the rows, the toggle) and adds what this guide needs on top: five stages
   instead of four, a pointing arrow, a step counter and a progress line.

   Own file for the same reason as setup-extension.css: the site's
   Content-Security-Policy is `style-src 'self'`, so no <style> blocks and no
   style="" attributes. Logical properties throughout, so the Arabic page
   mirrors itself. Everything is CSS: no script, nothing to load. */

.pass-guide .screen { height: 330px; }

/* Five stages on one 20s timeline, 4s each, with a short cross-fade. */
.pass-guide .stage { animation: pg-show 20s infinite; }
.pass-guide .p1 { animation-delay: 0s; }
.pass-guide .p2 { animation-delay: 4s; }
.pass-guide .p3 { animation-delay: 8s; }
.pass-guide .p4 { animation-delay: 12s; }
.pass-guide .p5 { animation-delay: 16s; }
@keyframes pg-show {
  0%   { opacity: 0; transform: translateY(8px) scale(.99); }
  2.5% { opacity: 1; transform: translateY(0) scale(1); }
  18%  { opacity: 1; transform: translateY(0) scale(1); }
  20%  { opacity: 0; transform: translateY(-8px) scale(.99); }
  100% { opacity: 0; }
}

/* The address bar says what each stage is about. */
.pass-guide .omni { position: relative; height: 31px; }
.pass-guide .omni > span { position: absolute; inset-inline-start: 14px; top: 6px; opacity: 0;
  animation: pg-show 20s infinite; }
.pass-guide .omni .o1 { animation-delay: 0s; }
.pass-guide .omni .o2 { animation-delay: 4s; }
.pass-guide .omni .o3 { animation-delay: 8s; }
.pass-guide .omni .o4 { animation-delay: 12s; }
.pass-guide .omni .o5 { animation-delay: 16s; }

/* A thin line along the top of the screen fills over the whole loop. */
.pass-guide .progress { position: absolute; top: 0; inset-inline-start: 0; height: 3px; width: 100%;
  background: linear-gradient(90deg, var(--accent), var(--success));
  transform-origin: left; animation: pg-progress 20s linear infinite; z-index: 6; }
[dir="rtl"] .pass-guide .progress { transform-origin: right; }
@keyframes pg-progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* "Step 2 of 5" in the corner of every stage. */
.pass-guide .count { position: absolute; top: 16px; inset-inline-end: 16px;
  font-size: 12px; font-weight: 700; letter-spacing: .04em; color: var(--accent);
  border: 1px solid var(--accent); border-radius: 20px; padding: 3px 10px;
  background: rgba(0, 0, 0, .25); }

.pass-guide .title { font-size: 18px; font-weight: 800; margin: 2px 0 14px; padding-inline-end: 110px; }
.pass-guide .hint { color: var(--text-dim); font-size: 13px; margin-top: 10px; }

/* A big arrow beside what to click, pointing at it and nudging toward it.
   It follows its target in the row, so it is always next to it, in both
   directions; on the Arabic page it is mirrored to point the other way. */
.pass-guide .with-arrow { display: flex; align-items: center; gap: 12px; }
.pass-guide .with-arrow > :first-child { flex: 0 1 auto; min-width: 0; }
.pass-guide .with-arrow.grow > :first-child { flex: 1 1 auto; }
.pass-guide .pointer { flex: none; width: 46px; height: 46px; color: var(--accent);
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .55));
  animation: pg-nudge .9s ease-in-out infinite; }
.pass-guide .pointer svg { width: 100%; height: 100%; display: block; }
@keyframes pg-nudge { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(-9px); } }
[dir="rtl"] .pass-guide .pointer svg { transform: scaleX(-1); }
[dir="rtl"] .pass-guide .pointer { animation-name: pg-nudge-rtl; }
@keyframes pg-nudge-rtl { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(9px); } }

/* Stage 1: the download button, pressed, and the file it gives. */
.pass-guide .btn-get { display: inline-flex; align-items: center; gap: 10px;
  background: var(--accent); color: var(--accent-text); font-weight: 800;
  padding: 12px 18px; border-radius: 12px; box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
  animation: pg-press 20s infinite; }
@keyframes pg-press { 0%, 6% { transform: scale(1); } 8% { transform: scale(.94); } 10%, 100% { transform: scale(1); } }
.pass-guide .file { display: flex; align-items: center; gap: 10px; margin-top: 18px;
  padding: 10px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-card);
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; direction: ltr;
  width: max-content; max-width: 100%; opacity: 0; animation: pg-pop 20s infinite; animation-delay: 0s; }
@keyframes pg-pop { 0%, 9% { opacity: 0; transform: translateY(6px); } 12%, 100% { opacity: 1; transform: translateY(0); } }

/* Stage 2: right-click › Extract All, and the folder that appears. */
.pass-guide .menu { width: 240px; flex: none; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 10px; padding: 6px; box-shadow: 0 10px 30px rgba(0, 0, 0, .4); margin-top: 10px; }
.pass-guide .menu div { padding: 8px 12px; border-radius: 7px; color: var(--text-dim); font-size: 14px; }
.pass-guide .menu .on { background: var(--accent); color: var(--accent-text); font-weight: 700; }
.pass-guide .p2 .file { animation-delay: 4s; }

/* Stage 4: the toggle flips a little after the stage appears. */
.pass-guide .p4 .toggle { animation: pg-flip 20s infinite; animation-delay: 12s; }
.pass-guide .p4 .toggle::after { animation: pg-knob 20s infinite; animation-delay: 12s; }
[dir="rtl"] .pass-guide .p4 .toggle::after { animation-name: pg-knob-rtl; }
@keyframes pg-flip { 0%, 7% { background: var(--border); } 9%, 100% { background: var(--success); } }
@keyframes pg-knob { 0%, 7% { transform: translateX(0); } 9%, 100% { transform: translateX(20px); } }
@keyframes pg-knob-rtl { 0%, 7% { transform: translateX(0); } 9%, 100% { transform: translateX(-20px); } }

/* Stage 5: load the folder, then the extension is there and on. */
.pass-guide .p5 .btn-load { animation: pg-press 20s infinite; animation-delay: 16s; }
.pass-guide .p5 .folder { opacity: 1; animation: none; }
.pass-guide .p5 .extcard { margin-top: 16px; opacity: 0; animation: pg-pop 20s infinite; animation-delay: 16s; }
.pass-guide .p5 .badge { animation: pg-pop 20s infinite; animation-delay: 16.4s; }

/* The written steps under the animation: numbered circles. */
.pass-steps { list-style: none; counter-reset: step; padding: 0; margin: 26px 0 0; }
.pass-steps li { counter-increment: step; position: relative; padding-inline-start: 48px;
  margin-bottom: 16px; line-height: 1.7; }
.pass-steps li::before { content: counter(step); position: absolute; inset-inline-start: 0; top: 0;
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-text); font-weight: 800; }
.pass-steps code { direction: ltr; unicode-bidi: isolate; }

.pass-download { text-align: center; margin: 22px 0 6px; }
.pass-download .btn { font-size: 17px; padding: 14px 26px; }
.pass-download .small { color: var(--text-dim); font-size: 13px; margin-top: 8px; }

/* Narrow screens: a smaller stage, the arrows out of the way of the text. */
@media (max-width: 560px) {
  .pass-guide .screen { height: 360px; }
  .pass-guide .pointer { width: 36px; height: 36px; }
}

@media (prefers-reduced-motion: reduce) {
  .pass-guide .stage, .pass-guide .omni > span { animation: none; opacity: 0; }
  .pass-guide .p5, .pass-guide .omni .o5 { opacity: 1; }
  .pass-guide .pointer, .pass-guide .progress { animation: none; }
  .pass-guide .p5 .extcard, .pass-guide .p5 .badge { animation: none; opacity: 1; }
}
