/* ==========================================================================
   PWA INSTALL GUIDE - Animated Installation Walkthrough
   Separate module for PWA installation instructions modal
   ========================================================================== */

/* ==========================================================================
   MODAL CONTAINER & STRUCTURE
   ========================================================================== */

.pwa-install-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.pwa-install-modal.is-open {
  opacity: 1;
  visibility: visible;
}

.pwa-install-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.pwa-install-modal__content {
  position: relative;
  width: 100%;
  max-width: 420px;
  max-height: 85vh;
  background: var(--ol-surface-2);
  border-radius: 16px 16px 0 0;
  overflow: hidden;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
  box-shadow: 0 -4px 32px rgba(0, 0, 0, 0.4);
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.pwa-install-modal.is-open .pwa-install-modal__content {
  transform: translateY(0);
}

.pwa-install-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--ol-border);
}

.pwa-install-modal__title {
  font-size: 20px;
  font-weight: 700;
  color: var(--ol-text);
  margin: 0;
}

.pwa-install-modal__close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ol-surface-3);
  border: none;
  border-radius: 50%;
  color: var(--ol-text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.pwa-install-modal__close:hover {
  background: var(--ol-surface-4);
  color: var(--ol-text);
}

.pwa-install-modal__body {
  padding: 24px 20px;
  overflow-y: auto;
  max-height: calc(85vh - 80px);
}

/* PWA Install Instructions Container */
.pwa-install-instructions {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 28px;
}

/* ==========================================================================
   PHONE MOCKUP DEMO - Animated installation walkthrough
   ========================================================================== */

.pwa-phone-demo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 8px 0;
}

/* Phone Frame */
.pwa-phone-frame {
  position: relative;
  width: 180px;
  height: 340px;
  background: #1a1a1a;
  border-radius: 24px;
  padding: 6px;
  box-shadow: 
    0 0 0 2px #333,
    0 8px 32px rgba(0, 0, 0, 0.5),
    inset 0 0 1px 1px rgba(255, 255, 255, 0.1);
}

.pwa-phone-screen {
  position: relative;
  width: 100%;
  height: 100%;
  background: #0f0f0f;
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   iOS SAFARI UI ELEMENTS
   ========================================================================== */

/* Safari URL Bar */
.pwa-safari-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  background: #1c1c1e;
  flex-shrink: 0;
}

.pwa-safari-url {
  background: #2c2c2e;
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 9px;
  color: rgba(255, 255, 255, 0.6);
  text-align: center;
  width: 100%;
}

/* Page Content Placeholder */
.pwa-page-content {
  flex: 1;
  background: linear-gradient(180deg, 
    #1a1a1a 0%, 
    #252525 20%, 
    #1f1f1f 40%, 
    #2a2a2a 60%, 
    #222 80%, 
    #1a1a1a 100%
  );
  min-height: 160px;
}

/* Safari Bottom Toolbar */
.pwa-safari-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 6px 4px 10px;
  background: #1c1c1e;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.pwa-safari-btn {
  position: relative;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #007AFF;
  border-radius: 6px;
}

.pwa-safari-btn svg {
  width: 16px;
  height: 16px;
}

.pwa-safari-share {
  color: #007AFF;
}

/* ==========================================================================
   ANDROID CHROME UI ELEMENTS
   ========================================================================== */

/* Chrome URL Bar */
.pwa-chrome-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: #202124;
  flex-shrink: 0;
}

.pwa-chrome-url {
  flex: 1;
  background: #303134;
  padding: 6px 10px;
  border-radius: 16px;
  font-size: 9px;
  color: rgba(255, 255, 255, 0.7);
}

.pwa-chrome-menu {
  position: relative;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  border-radius: 50%;
}

.pwa-chrome-menu svg {
  width: 14px;
  height: 14px;
}

/* ==========================================================================
   TAP ANIMATIONS & RIPPLE EFFECTS
   ========================================================================== */

/* Tap Target & Ripple Effect */
.pwa-tap-target {
  position: relative;
  overflow: hidden;
}

.pwa-tap-ripple {
  position: absolute;
  inset: -50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
  border-radius: 50%;
  transform: scale(0);
  opacity: 0;
}

/* Animated Finger/Tap Cursor */
.pwa-tap-finger {
  position: absolute;
  width: 26px;
  height: 26px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.95) 20%, rgba(255, 255, 255, 0.5) 50%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  z-index: 100;
  filter: blur(1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* ==========================================================================
   iOS SHARE SHEET
   ========================================================================== */

.pwa-ios-share-sheet {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 200px;
  background: #2c2c2e;
  border-radius: 12px 12px 0 0;
  padding: 6px 0 0;
  transform: translateY(100%);
  opacity: 0;
  transition: none;
  z-index: 10;
  overflow: hidden;
}

.pwa-share-sheet-handle {
  width: 32px;
  height: 4px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
  margin: 0 auto 8px;
}

.pwa-share-sheet-apps {
  display: flex;
  justify-content: space-around;
  padding: 0 6px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.pwa-share-app {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.pwa-share-app-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
}

.pwa-share-app span {
  font-size: 7px;
  color: rgba(255, 255, 255, 0.7);
}

.pwa-share-sheet-actions {
  padding: 6px;
  position: relative;
  overflow: hidden;
  max-height: 110px;
  /* Container clips the scrolling content so it doesn't overlap apps row */
}

/* Wrapper for scrollable actions content */
.pwa-share-actions-scroll {
  position: relative;
}

.pwa-share-action {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  color: white;
  font-size: 10px;
  border-radius: 8px;
  background: #3a3a3c;
  margin-bottom: 3px;
}

.pwa-share-action svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* Blurred share actions (not the target) */
.pwa-share-action--blurred {
  filter: blur(1.5px);
  opacity: 0.5;
}

/* Target action - Add to Home Screen (highlighted) */
.pwa-share-action--target {
  background: #48484a;
  filter: none;
  opacity: 1;
}

/* Actions below the target */
.pwa-share-action--below {
  filter: blur(1.5px);
  opacity: 0.4;
}

/* ==========================================================================
   iOS ADD TO HOME SCREEN DIALOG
   ========================================================================== */

.pwa-ios-add-dialog {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #1c1c1e;
  opacity: 0;
  transform: scale(0.95);
  transition: none;
  display: flex;
  flex-direction: column;
  z-index: 20;
}

.pwa-add-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.pwa-add-cancel,
.pwa-add-confirm {
  background: none;
  border: none;
  color: #007AFF;
  font-size: 11px;
  cursor: pointer;
  padding: 4px 6px;
  position: relative;
}

.pwa-add-title {
  font-size: 10px;
  font-weight: 600;
  color: white;
}

.pwa-add-dialog-preview {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
}

.pwa-add-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--ol-primary, #5865F2) 0%, #7289da 100%);
  border-radius: 12px;
  background-size: cover;
  background-position: center;
}

.pwa-add-name {
  font-size: 12px;
  color: white;
  text-align: center;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ==========================================================================
   iOS HOME SCREEN (shows after installation)
   ========================================================================== */

.pwa-ios-homescreen {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  opacity: 0;
  transition: none;
  display: flex;
  flex-direction: column;
  z-index: 25;
  padding: 8px 6px;
}

.pwa-homescreen-time {
  text-align: center;
  font-size: 22px;
  font-weight: 300;
  color: white;
  margin-bottom: 10px;
  letter-spacing: 1px;
}

.pwa-homescreen-apps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px 4px;
  padding: 4px 6px;
  row-gap: 10px;
}

.pwa-homescreen-app {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.pwa-homescreen-app-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #3a3a3c;
  flex-shrink: 0;
}

.pwa-homescreen-app span {
  font-size: 7px;
  color: white;
  text-align: center;
  max-width: 36px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.1;
}

/* Installed app with highlight effect */
.pwa-homescreen-app--installed .pwa-homescreen-app-icon {
  background: linear-gradient(135deg, var(--ol-primary, #5865F2) 0%, #7289da 100%);
  background-size: cover;
  background-position: center;
  box-shadow: 0 0 20px rgba(88, 101, 242, 0.6);
  animation: ios-installed-glow 2s ease-in-out infinite;
}

@keyframes ios-installed-glow {
  0%, 100% { box-shadow: 0 0 10px rgba(88, 101, 242, 0.4); }
  50% { box-shadow: 0 0 25px rgba(88, 101, 242, 0.8); }
}

.pwa-homescreen-dock {
  position: absolute;
  bottom: 6px;
  left: 6px;
  right: 6px;
  display: flex;
  justify-content: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 6px 10px;
  border-radius: 16px;
}

.pwa-dock-icon {
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  aspect-ratio: 1;
  border-radius: 7px;
  background: #3a3a3c;
  flex-shrink: 0;
}

/* ==========================================================================
   ANDROID CHROME DROPDOWN MENU
   ========================================================================== */

.pwa-chrome-dropdown {
  position: absolute;
  top: 36px;
  right: 6px;
  width: 130px;
  background: #303134;
  border-radius: 6px;
  padding: 6px 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transform: scale(0.9) translateY(-8px);
  transform-origin: top right;
  transition: none;
  z-index: 10;
}

.pwa-chrome-menu-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 10px;
}

.pwa-chrome-menu-item svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  opacity: 0.7;
}

.pwa-chrome-menu-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: 3px 0;
}

.pwa-chrome-install {
  color: #8ab4f8;
}

.pwa-chrome-install svg {
  opacity: 1;
  color: #8ab4f8;
}

/* ==========================================================================
   ANDROID INSTALL DIALOG
   ========================================================================== */

.pwa-android-dialog {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  opacity: 0;
  transition: none;
  z-index: 20;
}

.pwa-android-dialog-content {
  background: #303134;
  border-radius: 14px;
  padding: 16px;
  width: 100%;
  text-align: center;
}

.pwa-android-dialog-icon {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--ol-primary, #5865F2) 0%, #7289da 100%);
  border-radius: 10px;
  margin: 0 auto 10px;
  background-size: cover;
  background-position: center;
}

.pwa-android-dialog-title {
  font-size: 12px;
  font-weight: 600;
  color: white;
  margin-bottom: 3px;
}

.pwa-android-dialog-desc {
  font-size: 9px;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 12px;
}

.pwa-android-dialog-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.pwa-android-cancel,
.pwa-android-install {
  background: none;
  border: none;
  padding: 6px 12px;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 4px;
  position: relative;
}

.pwa-android-cancel {
  color: #8ab4f8;
}

.pwa-android-install {
  color: #8ab4f8;
  background: rgba(138, 180, 248, 0.1);
}

/* ==========================================================================
   ANDROID HOME SCREEN (shows after installation)
   ========================================================================== */

.pwa-android-homescreen {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  opacity: 0;
  transition: none;
  display: flex;
  flex-direction: column;
  z-index: 25;
  padding: 8px 6px;
}

/* Android dock variation (slightly different styling) */
.pwa-android-dock {
  border-radius: 0;
  background: rgba(0, 0, 0, 0.3);
}

/* ==========================================================================
   STEP INDICATORS
   ========================================================================== */

.pwa-demo-steps {
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
}

.pwa-demo-step {
  padding: 5px 10px;
  background: var(--ol-surface-3);
  border-radius: 14px;
  font-size: 10px;
  font-weight: 600;
  color: var(--ol-text-muted);
  transition: all 0.3s ease;
  white-space: nowrap;
}

.pwa-demo-step.active {
  background: var(--ol-primary);
  color: white;
}

/* ==========================================================================
   iOS ANIMATION KEYFRAMES
   Animation timing: 9s total loop
   - Step 1 (0-3s): Tap share button
   - Step 2 (3-6s): Tap "Add to Home Screen"  
   - Step 3 (6-9s): Tap "Add" to confirm
   ========================================================================== */

/* iOS Demo Animation Bindings */
.pwa-phone-demo--ios .pwa-tap-finger {
  animation: ios-finger-move 9s ease-in-out infinite;
}

.pwa-phone-demo--ios .pwa-safari-share .pwa-tap-ripple {
  animation: ios-tap-ripple-1 9s ease-in-out infinite;
}

.pwa-phone-demo--ios .pwa-ios-share-sheet {
  animation: ios-share-sheet 9s ease-in-out infinite;
}

.pwa-phone-demo--ios .pwa-share-action[data-step="2"] .pwa-tap-ripple {
  animation: ios-tap-ripple-2 9s ease-in-out infinite;
}

.pwa-phone-demo--ios .pwa-ios-add-dialog {
  animation: ios-add-dialog 9s ease-in-out infinite;
}

.pwa-phone-demo--ios .pwa-ios-homescreen {
  animation: ios-homescreen 9s ease-in-out infinite;
}

.pwa-phone-demo--ios .pwa-add-confirm .pwa-tap-ripple {
  animation: ios-tap-ripple-3 9s ease-in-out infinite;
}

/* iOS Step Indicators */
.pwa-phone-demo--ios .pwa-demo-step[data-for="1"] {
  animation: step-active-1 9s ease-in-out infinite;
}
.pwa-phone-demo--ios .pwa-demo-step[data-for="2"] {
  animation: step-active-2 9s ease-in-out infinite;
}
.pwa-phone-demo--ios .pwa-demo-step[data-for="3"] {
  animation: step-active-3 9s ease-in-out infinite;
}

/* iOS Share Sheet Actions Scroll - animate the scroll wrapper, not the container */
.pwa-phone-demo--ios .pwa-share-actions-scroll {
  animation: ios-actions-scroll 9s ease-in-out infinite;
}

/* Prevent layout shift during animation */
.pwa-share-actions-scroll {
  will-change: transform;
}

/* iOS Finger Movement - 3 precise taps */
@keyframes ios-finger-move {
  /* Step 1: Tap Share button (center of toolbar) */
  0%, 3% { 
    opacity: 0;
    bottom: 24px;
    left: 50%;
    right: auto;
    top: auto;
    transform: translate(-50%, 0);
  }
  6% {
    opacity: 1;
    bottom: 24px;
    left: 50%;
    transform: translate(-50%, 0);
  }
  10%, 12% {
    opacity: 1;
    bottom: 24px;
    left: 50%;
    transform: translate(-50%, 0) scale(0.85);
  }
  16%, 30% {
    opacity: 0;
  }
  
  /* Step 2: Wait for scroll, then tap "Add to Home Screen" 
     After scroll (-70px), target action should be visible in middle of share sheet */
  31%, 38% {
    opacity: 0;
    bottom: 55px;
    left: 50%;
    right: auto;
    top: auto;
    transform: translate(-50%, 0);
  }
  42% {
    opacity: 1;
    bottom: 55px;
    left: 50%;
    transform: translate(-50%, 0);
  }
  46%, 48% {
    opacity: 1;
    bottom: 55px;
    left: 50%;
    transform: translate(-50%, 0) scale(0.85);
  }
  52%, 65% {
    opacity: 0;
  }
  
  /* Step 3: Tap "Add" button (top right of dialog) */
  66%, 69% {
    opacity: 0;
    bottom: auto;
    left: auto;
    top: 16px;
    right: 18px;
    transform: translate(0, 0);
  }
  73% {
    opacity: 1;
    top: 16px;
    right: 18px;
    transform: translate(0, 0);
  }
  77%, 79% {
    opacity: 1;
    transform: scale(0.85);
  }
  85%, 100% {
    opacity: 0;
  }
}

/* iOS Tap Ripples */
@keyframes ios-tap-ripple-1 {
  0%, 9% { transform: scale(0); opacity: 0; }
  10%, 13% { transform: scale(2); opacity: 0.8; }
  16%, 100% { transform: scale(3); opacity: 0; }
}

@keyframes ios-tap-ripple-2 {
  0%, 45% { transform: scale(0); opacity: 0; }
  46%, 49% { transform: scale(2); opacity: 0.8; }
  52%, 100% { transform: scale(3); opacity: 0; }
}

@keyframes ios-tap-ripple-3 {
  0%, 76% { transform: scale(0); opacity: 0; }
  77%, 80% { transform: scale(2); opacity: 0.8; }
  83%, 100% { transform: scale(3); opacity: 0; }
}

/* iOS Share Sheet Animation - slides up */
@keyframes ios-share-sheet {
  0%, 14% { transform: translateY(100%); opacity: 0; }
  18%, 54% { transform: translateY(0); opacity: 1; }
  58%, 100% { transform: translateY(100%); opacity: 0; }
}

/* iOS Share Sheet Actions Scroll - scrolls up to reveal Add to Home Screen */
@keyframes ios-actions-scroll {
  /* Initially showing top items (Copy, Add Bookmark, etc.) */
  0%, 24% { 
    transform: translateY(0); 
  }
  /* Scroll up to reveal "Add to Home Screen" - scroll just enough to show it clearly */
  32%, 54% { 
    transform: translateY(-70px); 
  }
  /* Reset when sheet closes */
  58%, 100% { 
    transform: translateY(0); 
  }
}

/* iOS Add Dialog Animation */
@keyframes ios-add-dialog {
  0%, 56% { opacity: 0; transform: scale(0.95); }
  60%, 80% { opacity: 1; transform: scale(1); }
  84%, 100% { opacity: 0; transform: scale(0.95); }
}

/* iOS Home Screen Animation - shows after Add tap */
@keyframes ios-homescreen {
  0%, 82% { opacity: 0; }
  86%, 96% { opacity: 1; }
  100% { opacity: 0; }
}

/* ==========================================================================
   ANDROID ANIMATION KEYFRAMES
   ========================================================================== */

/* Android Demo Animation Bindings */
.pwa-phone-demo--android .pwa-tap-finger {
  animation: android-finger-move 9s ease-in-out infinite;
}

.pwa-phone-demo--android .pwa-chrome-menu .pwa-tap-ripple {
  animation: android-tap-ripple-1 9s ease-in-out infinite;
}

.pwa-phone-demo--android .pwa-chrome-dropdown {
  animation: android-dropdown 9s ease-in-out infinite;
}

.pwa-phone-demo--android .pwa-chrome-install .pwa-tap-ripple {
  animation: android-tap-ripple-2 9s ease-in-out infinite;
}

.pwa-phone-demo--android .pwa-android-dialog {
  animation: android-dialog 9s ease-in-out infinite;
}

.pwa-phone-demo--android .pwa-android-homescreen {
  animation: android-homescreen 9s ease-in-out infinite;
}

.pwa-phone-demo--android .pwa-android-install .pwa-tap-ripple {
  animation: android-tap-ripple-3 9s ease-in-out infinite;
}

/* Android Step Indicators */
.pwa-phone-demo--android .pwa-demo-step[data-for="1"] {
  animation: step-active-1 9s ease-in-out infinite;
}
.pwa-phone-demo--android .pwa-demo-step[data-for="2"] {
  animation: step-active-2 9s ease-in-out infinite;
}
.pwa-phone-demo--android .pwa-demo-step[data-for="3"] {
  animation: step-active-3 9s ease-in-out infinite;
}

/* Android Finger Movement - 3 precise taps */
@keyframes android-finger-move {
  /* Step 1: Tap 3-dot menu (top right) */
  0%, 3% { 
    opacity: 0;
    top: 14px;
    right: 14px;
    left: auto;
    bottom: auto;
    transform: translate(0, 0);
  }
  6% {
    opacity: 1;
    top: 14px;
    right: 14px;
    transform: translate(0, 0);
  }
  10%, 12% {
    opacity: 1;
    transform: scale(0.85);
  }
  16%, 32% {
    opacity: 0;
  }
  
  /* Step 2: Tap "Install app" in dropdown - positioned at 3rd item */
  33%, 36% {
    opacity: 0;
    top: 115px;
    right: 45px;
    left: auto;
    bottom: auto;
    transform: translate(0, 0);
  }
  40% {
    opacity: 1;
    top: 115px;
    right: 45px;
    transform: translate(0, 0);
  }
  44%, 46% {
    opacity: 1;
    transform: scale(0.85);
  }
  50%, 65% {
    opacity: 0;
  }
  
  /* Step 3: Tap "Install" button in dialog */
  66%, 69% {
    opacity: 0;
    top: auto;
    left: auto;
    bottom: 100px;
    right: 30px;
    transform: translate(0, 0);
  }
  73% {
    opacity: 1;
    bottom: 100px;
    right: 30px;
    transform: translate(0, 0);
  }
  77%, 79% {
    opacity: 1;
    transform: scale(0.85);
  }
  85%, 100% {
    opacity: 0;
  }
}

/* Android Tap Ripples */
@keyframes android-tap-ripple-1 {
  0%, 9% { transform: scale(0); opacity: 0; }
  10%, 13% { transform: scale(2); opacity: 0.8; }
  16%, 100% { transform: scale(3); opacity: 0; }
}

@keyframes android-tap-ripple-2 {
  0%, 43% { transform: scale(0); opacity: 0; }
  44%, 47% { transform: scale(2); opacity: 0.8; }
  50%, 100% { transform: scale(3); opacity: 0; }
}

@keyframes android-tap-ripple-3 {
  0%, 76% { transform: scale(0); opacity: 0; }
  77%, 80% { transform: scale(2); opacity: 0.8; }
  83%, 100% { transform: scale(3); opacity: 0; }
}

/* Android Dropdown Animation */
@keyframes android-dropdown {
  0%, 14% { opacity: 0; transform: scale(0.9) translateY(-8px); }
  18%, 52% { opacity: 1; transform: scale(1) translateY(0); }
  56%, 100% { opacity: 0; transform: scale(0.9) translateY(-8px); }
}

/* Android Dialog Animation */
@keyframes android-dialog {
  0%, 54% { opacity: 0; }
  58%, 80% { opacity: 1; }
  84%, 100% { opacity: 0; }
}

/* Android Home Screen Animation - shows after Install tap */
@keyframes android-homescreen {
  0%, 82% { opacity: 0; }
  86%, 96% { opacity: 1; }
  100% { opacity: 0; }
}

/* ==========================================================================
   SHARED STEP INDICATOR ANIMATIONS
   ========================================================================== */

@keyframes step-active-1 {
  0%, 32% { background: var(--ol-primary); color: white; }
  33%, 100% { background: var(--ol-surface-3); color: var(--ol-text-muted); }
}

@keyframes step-active-2 {
  0%, 32% { background: var(--ol-surface-3); color: var(--ol-text-muted); }
  33%, 65% { background: var(--ol-primary); color: white; }
  66%, 100% { background: var(--ol-surface-3); color: var(--ol-text-muted); }
}

@keyframes step-active-3 {
  0%, 65% { background: var(--ol-surface-3); color: var(--ol-text-muted); }
  66%, 100% { background: var(--ol-primary); color: white; }
}

/* ==========================================================================
   OTHER/UNKNOWN DEVICE INSTRUCTIONS
   ========================================================================== */

.pwa-install-device-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--ol-surface-3);
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--ol-text-muted);
}

.pwa-install-device-hint svg {
  flex-shrink: 0;
  color: var(--ol-primary);
}

.pwa-other-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pwa-other-option {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--ol-surface-3);
  border-radius: 12px;
}

.pwa-other-option-icon {
  position: relative;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  flex-shrink: 0;
}

.pwa-other-option-icon svg {
  width: 28px;
  height: 28px;
  position: relative;
  z-index: 1;
}

.pwa-other-option-icon--ios {
  background: linear-gradient(135deg, #007AFF 0%, #5856D6 100%);
  color: white;
}

.pwa-other-option-icon--android {
  background: linear-gradient(135deg, #4285F4 0%, #34A853 100%);
  color: white;
}

.pwa-other-pulse {
  position: absolute;
  inset: 0;
  border-radius: 14px;
  border: 2px solid currentColor;
  opacity: 0;
  animation: other-pulse 2s ease-in-out infinite;
}

@keyframes other-pulse {
  0%, 100% { transform: scale(1); opacity: 0; }
  50% { transform: scale(1.15); opacity: 0.4; }
}

.pwa-other-option-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pwa-other-option-label {
  font-size: 16px;
  font-weight: 700;
  color: var(--ol-text);
}

.pwa-other-option-action {
  font-size: 12px;
  color: var(--ol-text-muted);
}

.pwa-other-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 12px;
  color: var(--ol-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pwa-other-divider::before,
.pwa-other-divider::after {
  content: '';
  flex: 1;
  max-width: 60px;
  height: 1px;
  background: var(--ol-border);
}

/* ==========================================================================
   BENEFITS SECTION
   ========================================================================== */

.pwa-install-benefits {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 20px 0 8px;
  margin-top: 8px;
  border-top: 1px solid var(--ol-border);
}

.pwa-install-benefit {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--ol-surface-3);
  border-radius: 20px;
  color: var(--ol-text-muted);
  font-size: 12px;
  font-weight: 600;
}

.pwa-install-benefit svg {
  color: var(--ol-primary);
  flex-shrink: 0;
}

/* ==========================================================================
   ENTRANCE ANIMATION
   ========================================================================== */

.pwa-install-modal.is-open .pwa-phone-demo {
  animation: pwaPhoneFadeIn 0.5s ease backwards;
  animation-delay: 0.2s;
}

@keyframes pwaPhoneFadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   RESPONSIVE STYLES
   ========================================================================== */

/* Small mobile screens */
@media (max-width: 380px) {
  .pwa-install-modal__body {
    padding: 20px 16px;
  }
  
  .pwa-phone-frame {
    width: 160px;
    height: 300px;
  }
  
  .pwa-demo-step {
    padding: 5px 8px;
    font-size: 9px;
  }
  
  .pwa-install-benefits {
    gap: 6px;
  }
  
  .pwa-install-benefit {
    padding: 5px 10px;
    font-size: 10px;
  }
  
  .pwa-other-option {
    padding: 12px;
    gap: 12px;
  }
  
  .pwa-other-option-icon {
    width: 48px;
    height: 48px;
  }
  
  .pwa-other-option-icon svg {
    width: 24px;
    height: 24px;
  }
  
  .pwa-other-option-label {
    font-size: 14px;
  }
  
  .pwa-homescreen-app-icon {
    width: 26px;
    height: 26px;
    border-radius: 6px;
  }
  
  .pwa-dock-icon {
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
    border-radius: 6px;
  }
  
  .pwa-homescreen-time {
    font-size: 18px;
  }
}

/* Desktop: Center modal */
@media (min-width: 769px) {
  .pwa-install-modal {
    align-items: center;
  }
  
  .pwa-install-modal__content {
    border-radius: 16px;
    max-width: 440px;
    transform: scale(0.95) translateY(20px);
    opacity: 0;
  }
  
  .pwa-install-modal.is-open .pwa-install-modal__content {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}
