/* =====================================================================
   GymDiet Master — iOS PWA Install Assistant Styles
   Follows AGENTS.md Design System (Dark Neon + Light Theme Support)
   ===================================================================== */

body.telegram-webapp .ios-install-banner,
.telegram-webapp .ios-install-banner,
.hide-apk-banner .ios-install-banner {
  display: none !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

.ios-install-banner {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s ease;
}

.ios-install-banner.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.ios-install-banner.is-closing {
  opacity: 0;
  pointer-events: none;
}

.ios-install-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.ios-install-card {
  position: relative;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  background: #080c14;
  border: 1.5px solid rgba(0, 240, 118, 0.3);
  border-bottom: none;
  border-radius: 28px 28px 0 0;
  box-shadow: 0 -16px 48px rgba(0, 0, 0, 0.8), 0 0 32px rgba(0, 240, 118, 0.12);
  padding: 16px 20px calc(24px + env(safe-area-inset-bottom, 20px));
  box-sizing: border-box;
  transform: translateY(100%);
  transition: transform 0.38s cubic-bezier(0.16, 1, 0.3, 1);
  color: #ffffff;
}

.ios-install-banner.is-visible .ios-install-card {
  transform: translateY(0);
}

.ios-install-banner.is-closing .ios-install-card {
  transform: translateY(100%);
}

.ios-install-handle {
  width: 44px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  margin: 0 auto 14px;
}

.ios-install-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ios-install-close:active {
  background: rgba(255, 255, 255, 0.16);
  transform: scale(0.92);
}

.ios-install-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.ios-install-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  box-shadow: 0 4px 18px rgba(0, 240, 118, 0.28);
  border: 1.5px solid rgba(0, 240, 118, 0.4);
  flex-shrink: 0;
}

.ios-install-kicker {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #00f076;
  display: block;
  margin-bottom: 2px;
}

.ios-install-title {
  margin: 0;
  font-size: 18px;
  font-weight: 900;
  color: #ffffff;
}

.ios-install-sub {
  margin: 4px 0 0;
  font-size: 12.5px;
  color: #94a3b8;
  line-height: 1.4;
}

.ios-install-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 14px;
  margin-bottom: 18px;
}

.ios-install-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.ios-install-step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(0, 240, 118, 0.15);
  color: #00f076;
  border: 1px solid rgba(0, 240, 118, 0.35);
  font-size: 12px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.ios-install-step-info {
  flex: 1;
  font-size: 13.5px;
  line-height: 1.45;
  color: #cbd5e1;
}

.ios-install-step-info strong {
  color: #ffffff;
}

.ios-install-step-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 4px 10px;
  margin-top: 6px;
  font-size: 12px;
  color: #f1f5f9;
}

.ios-install-step-badge.is-highlight {
  background: rgba(0, 240, 118, 0.12);
  border-color: rgba(0, 240, 118, 0.35);
  color: #00f076;
}

.ios-install-step-badge.is-highlight strong {
  color: #00f076;
}

.ios-install-footer {
  margin-top: 6px;
}

.ios-install-btn-ok {
  width: 100%;
  background: #00f076 !important;
  color: #04120b !important;
  border: none !important;
  border-radius: 16px !important;
  padding: 14px 20px !important;
  font-size: 15px !important;
  font-weight: 900 !important;
  box-shadow: 0 8px 24px rgba(0, 240, 118, 0.35) !important;
  cursor: pointer !important;
  transition: transform 0.15s ease, opacity 0.2s ease !important;
}

.ios-install-btn-ok:active {
  transform: scale(0.98) !important;
}

.ios-install-pointer {
  display: flex;
  justify-content: center;
  margin-top: 10px;
}

.ios-pointer-arrow {
  color: #00f076;
  font-size: 22px;
  font-weight: 900;
  animation: iosBouncePointer 1.4s ease-in-out infinite;
}

@keyframes iosBouncePointer {
  0%, 100% {
    transform: translateY(0);
    opacity: 0.7;
  }
  50% {
    transform: translateY(8px);
    opacity: 1;
  }
}

/* =====================================================================
   Light Theme Support
   ===================================================================== */
html[data-theme="light"] .ios-install-card,
body.light-theme .ios-install-card {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  box-shadow: 0 -16px 48px rgba(15, 23, 42, 0.15), 0 0 24px rgba(0, 240, 118, 0.08);
  color: #0f172a;
}

html[data-theme="light"] .ios-install-handle,
body.light-theme .ios-install-handle {
  background: #cbd5e1;
}

html[data-theme="light"] .ios-install-close,
body.light-theme .ios-install-close {
  background: #f1f5f9;
  border-color: #e2e8f0;
  color: #64748b;
}

html[data-theme="light"] .ios-install-kicker,
body.light-theme .ios-install-kicker {
  color: #059669;
}

html[data-theme="light"] .ios-install-title,
body.light-theme .ios-install-title {
  color: #0f172a;
}

html[data-theme="light"] .ios-install-sub,
body.light-theme .ios-install-sub {
  color: #475569;
}

html[data-theme="light"] .ios-install-steps,
body.light-theme .ios-install-steps {
  background: #f8fafc;
  border-color: #e2e8f0;
}

html[data-theme="light"] .ios-install-step-info,
body.light-theme .ios-install-step-info {
  color: #334155;
}

html[data-theme="light"] .ios-install-step-info strong,
body.light-theme .ios-install-step-info strong {
  color: #0f172a;
}

html[data-theme="light"] .ios-install-step-badge,
body.light-theme .ios-install-step-badge {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #0f172a;
}

html[data-theme="light"] .ios-install-step-badge.is-highlight,
body.light-theme .ios-install-step-badge.is-highlight {
  background: #f0fdf4;
  border-color: #86efac;
  color: #059669;
}

html[data-theme="light"] .ios-install-step-badge.is-highlight strong,
body.light-theme .ios-install-step-badge.is-highlight strong {
  color: #059669;
}
