/**
 * SKKIN Progressive Web App (PWA) Styling
 * Desktop Install Popup & iOS Step-by-Step Installation Modal
 */

/* ==========================================================================
   1. DESKTOP / LAPTOP FLOATING INSTALL PROMPT CARD
   ========================================================================== */
.skkin-pwa-install-banner {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999980;
  max-width: 380px;
  width: calc(100vw - 32px);
  background: rgba(18, 18, 18, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(197, 168, 128, 0.35);
  border-radius: 18px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.08);
  padding: 18px 20px;
  color: #ffffff;
  transform: translateY(120%);
  opacity: 0;
  visibility: hidden;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease, visibility 0.4s;
  pointer-events: none;
}

.skkin-pwa-install-banner.is-visible {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.skkin-pwa-banner-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  position: relative;
}

.skkin-pwa-app-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: #111;
  border: 1px solid rgba(212, 175, 55, 0.4);
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
}

.skkin-pwa-app-icon img,
.skkin-pwa-app-icon svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.skkin-pwa-banner-text {
  flex: 1;
  padding-right: 20px;
}

.skkin-pwa-banner-eyebrow {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #c5a880;
  margin-bottom: 2px;
}

.skkin-pwa-banner-title {
  margin: 0 0 4px 0;
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.3;
  letter-spacing: 0.2px;
}

.skkin-pwa-banner-desc {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.72);
}

.skkin-pwa-close-btn {
  position: absolute;
  top: -4px;
  right: -6px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 18px;
  line-height: 1;
  padding: 6px;
  cursor: pointer;
  border-radius: 50%;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.skkin-pwa-close-btn:hover {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.1);
}

.skkin-pwa-banner-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.skkin-pwa-btn-install {
  flex: 1;
  background: linear-gradient(135deg, #dfba73 0%, #c5a880 100%);
  color: #111111;
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 4px 14px rgba(197, 168, 128, 0.3);
  transition: all 0.25s ease;
}

.skkin-pwa-btn-install:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(197, 168, 128, 0.45);
  background: linear-gradient(135deg, #ebd08d 0%, #d4b58b 100%);
}

.skkin-pwa-btn-dismiss {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.7);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.skkin-pwa-btn-dismiss:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.3);
}

/* ==========================================================================
   2. iOS STEP-BY-STEP INSTALLATION MODAL
   ========================================================================== */
.skkin-ios-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 999990;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.skkin-ios-modal-backdrop.is-active {
  display: flex !important;
  opacity: 1;
  visibility: visible;
}

.skkin-ios-modal-dialog {
  background: #ffffff;
  color: #111111;
  border-radius: 24px;
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(0, 0, 0, 0.05);
  padding: 32px 28px;
  position: relative;
  transform: scale(0.92) translateY(20px);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.skkin-ios-modal-backdrop.is-active .skkin-ios-modal-dialog {
  transform: scale(1) translateY(0);
}

.skkin-ios-modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: #f4f4f4;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #666666;
  font-size: 16px;
  transition: all 0.2s ease;
}

.skkin-ios-modal-close:hover {
  background: #e8e8e8;
  color: #111111;
  transform: rotate(90deg);
}

.skkin-ios-modal-header {
  text-align: center;
  margin-bottom: 24px;
}

.skkin-ios-modal-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(197, 168, 128, 0.15);
  color: #936e3c;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.skkin-ios-modal-title {
  margin: 0 0 8px 0;
  font-size: 22px;
  font-weight: 800;
  color: #111111;
  letter-spacing: -0.3px;
  line-height: 1.25;
}

.skkin-ios-modal-subtitle {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: #666666;
}

/* Steps list */
.skkin-ios-steps-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 24px;
}

.skkin-ios-step-item {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #faf8f5;
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 16px;
  padding: 14px 16px;
  transition: all 0.2s ease;
}

.skkin-ios-step-item:hover {
  background: #f5f0e8;
  border-color: rgba(197, 168, 128, 0.3);
  transform: translateX(3px);
}

.skkin-ios-step-num {
  width: 32px;
  height: 32px;
  background: #111111;
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  flex-shrink: 0;
}

.skkin-ios-step-content {
  flex: 1;
}

.skkin-ios-step-title {
  margin: 0 0 2px 0;
  font-size: 14px;
  font-weight: 700;
  color: #111111;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.skkin-ios-step-desc {
  margin: 0;
  font-size: 12px;
  color: #666666;
  line-height: 1.4;
}

.skkin-ios-step-icon-preview {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 600;
  color: #007aff;
  box-shadow: 0 2px 5px rgba(0,0,0,0.04);
}

.skkin-ios-step-icon-preview svg {
  width: 16px;
  height: 16px;
  margin-right: 4px;
}

.skkin-ios-step-preview-bubble {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid #e5e5ea;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(0,0,0,0.04);
}

.skkin-ios-step-preview-bubble svg {
  width: 24px;
  height: 24px;
}

/* Modal Bottom CTA */
.skkin-ios-modal-footer {
  text-align: center;
  padding-top: 14px;
  border-top: 1px solid #eeeeee;
}

.skkin-ios-gotit-btn {
  width: 100%;
  background: #111111;
  color: #ffffff;
  border: none;
  border-radius: 14px;
  padding: 14px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.25s ease;
}

.skkin-ios-gotit-btn:hover {
  background: #333333;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
}

.skkin-ios-safari-hint {
  margin: 10px 0 0 0;
  font-size: 11.5px;
  color: #888888;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

/* ==========================================================================
   3. RESPONSIVE ADAPTATIONS
   ========================================================================== */
@media (max-width: 540px) {
  .skkin-pwa-install-banner {
    bottom: 16px;
    right: 16px;
    left: 16px;
    width: auto;
    padding: 16px;
  }
  
  .skkin-ios-modal-dialog {
    padding: 24px 20px;
    border-radius: 20px;
  }
  
  .skkin-ios-modal-title {
    font-size: 19px;
  }
}

/* ==========================================================================
   4. FLOATING PWA TOASTS (Network Status & App Updates)
   ========================================================================== */
.skkin-pwa-toast-container {
  position: fixed !important;
  top: 20px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  z-index: 9999999 !important;
  display: none !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 10px !important;
  pointer-events: none !important;
  max-width: 90vw !important;
}

.skkin-pwa-toast-container.has-toasts {
  display: flex !important;
}

.skkin-pwa-toast {
  display: none !important;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border-radius: 9999px;
  font-family: var(--font-heading, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  transform: translateY(-50px) scale(0.95);
  opacity: 0;
  visibility: hidden;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.skkin-pwa-toast.is-visible {
  display: inline-flex !important;
  transform: translateY(0) scale(1);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.skkin-pwa-toast--offline {
  background: #18181b;
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.35);
}

.skkin-pwa-toast--online {
  background: #064e3b;
  color: #a7f3d0;
  border: 1px solid rgba(167, 243, 208, 0.4);
}

.skkin-pwa-toast--update {
  background: #111111;
  color: #ffffff;
  border: 1px solid #dfba73;
}

.skkin-pwa-toast-btn {
  background: #dfba73 !important;
  color: #111111 !important;
  border: none !important;
  padding: 5px 12px !important;
  border-radius: 9999px !important;
  font-size: 11.5px !important;
  font-weight: 800 !important;
  cursor: pointer !important;
  margin-left: 6px !important;
  transition: transform 0.2s ease !important;
}

.skkin-pwa-toast-btn:hover {
  transform: scale(1.05) !important;
}

/* ==========================================================================
   5. DRAWER QUICK INSTALL ACTION
   ========================================================================== */
.skkin-drawer-pwa-install {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 12px 16px;
  padding: 12px 16px;
  background: linear-gradient(135deg, #111111 0%, #1f2937 100%);
  border-radius: 12px;
  color: #ffffff;
  text-decoration: none !important;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  transition: all 0.2s ease;
}

.skkin-drawer-pwa-install:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.skkin-drawer-pwa-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.skkin-drawer-pwa-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.skkin-drawer-pwa-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.skkin-drawer-pwa-title {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  display: block;
}

.skkin-drawer-pwa-desc {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.7);
  display: block;
}

.skkin-drawer-pwa-badge {
  background: #dfba73;
  color: #111111;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 9999px;
  letter-spacing: 0.03em;
}

/* Hide install triggers when already running as installed standalone PWA */
body.skkin-pwa-standalone .skkin-pwa-install-banner,
body.skkin-pwa-standalone .skkin-drawer-pwa-install,
body.skkin-pwa-standalone .skkin-pwa-install-trigger {
  display: none !important;
}

/* Safe area insets for iOS standalone */
body.skkin-pwa-standalone .skkin-announcement-bar {
  padding-top: calc(8px + env(safe-area-inset-top));
}

