/* ==========================================================================
   Cloud International Concierge — Progressive Web App Styling
   ========================================================================== */

/* In-App Install Trigger Buttons */
.ci-pwa-install-trigger {
  display: none; /* revealed via JS when beforeinstallprompt fires */
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #184149 0%, #123036 100%);
  color: #f5fafa !important;
  border: 1px solid rgba(223, 159, 40, 0.4);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(24, 65, 73, 0.15);
  transition: all 0.25s ease;
  text-decoration: none !important;
  z-index: 100;
}

.ci-pwa-install-trigger:hover {
  background: #df9f28;
  color: #3b2302 !important;
  border-color: #cb8d1c;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(223, 159, 40, 0.25);
}

.ci-pwa-install-trigger .dashicons,
.ci-pwa-install-trigger svg {
  font-size: 16px;
  width: 16px;
  height: 16px;
}

/* Nav Bar Specific Install Item */
.ci-menu-pwa-item {
  display: flex;
  align-items: center;
}

.ci-menu-pwa-btn {
  background: #184149;
  color: #f5fafa !important;
  padding: 7px 14px !important;
  border-radius: 8px;
  font-size: 13px !important;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(223, 159, 40, 0.3);
  transition: all 0.2s ease;
  cursor: pointer;
}

.ci-menu-pwa-btn:hover {
  background: #df9f28 !important;
  color: #3b2302 !important;
}

/* Floating Bottom Install Banner */
.ci-pwa-banner {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #ffffff;
  border: 1px solid #d5e0dc;
  border-radius: 16px;
  padding: 16px 20px;
  display: none;
  align-items: center;
  gap: 16px;
  max-width: 420px;
  width: calc(100vw - 48px);
  box-shadow: 0 12px 36px rgba(24, 65, 73, 0.16);
  z-index: 99999;
  transform: translateY(20px);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}

.ci-pwa-banner.ci-pwa-banner-visible {
  display: flex;
  transform: translateY(0);
  opacity: 1;
}

.ci-pwa-banner-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: #184149;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  flex-shrink: 0;
  overflow: hidden;
}

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

.ci-pwa-banner-info {
  flex: 1;
  min-width: 0;
}

.ci-pwa-banner-title {
  font-size: 14px;
  font-weight: 700;
  color: #184149;
  margin: 0 0 2px 0;
  line-height: 1.2;
}

.ci-pwa-banner-desc {
  font-size: 12px;
  color: #5e7470;
  margin: 0;
  line-height: 1.35;
}

.ci-pwa-banner-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.ci-pwa-btn-install {
  background: #df9f28;
  color: #3b2302;
  border: none;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}

.ci-pwa-btn-install:hover {
  background: #cb8d1c;
}

.ci-pwa-btn-dismiss {
  background: transparent;
  color: #5e7470;
  border: none;
  font-size: 18px;
  line-height: 1;
  padding: 6px;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ci-pwa-btn-dismiss:hover {
  color: #184149;
  background: #edf4f1;
}

/* Offline / Toast Bar */
.ci-pwa-toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-30px);
  background: #184149;
  color: #ffffff;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  z-index: 999999;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.ci-pwa-toast.ci-pwa-toast-visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.ci-pwa-toast.ci-toast-offline {
  background: #991b1b;
}

.ci-pwa-toast.ci-toast-online {
  background: #1c7d6b;
}

/* iOS Safari Modal / Instruction Card */
.ci-pwa-ios-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 999999;
  align-items: flex-end;
  justify-content: center;
  padding: 20px;
}

.ci-pwa-ios-card {
  background: #ffffff;
  border-radius: 20px;
  padding: 28px 24px;
  max-width: 440px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0,0,0,0.3);
  position: relative;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from { transform: translateY(40px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.ci-pwa-ios-card h3 {
  color: #184149;
  font-size: 18px;
  margin-bottom: 12px;
}

.ci-pwa-ios-step {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  margin: 14px 0;
  font-size: 14px;
  color: #182825;
}

.ci-pwa-ios-step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #edf4f1;
  color: #184149;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Hide install triggers when already running inside standalone PWA window */
.ci-pwa-standalone .ci-pwa-install-trigger,
.ci-pwa-standalone .ci-menu-pwa-item,
.ci-pwa-standalone #ci-pwa-banner {
  display: none !important;
}

@media (max-width: 640px) {
  .ci-pwa-banner {
    bottom: 16px;
    right: 16px;
    width: calc(100vw - 32px);
    padding: 12px 14px;
  }
}
