/**
 * Melior Ecosystem - Unified PWA Auto-Update & Version Display Styles
 */

/* 1. Bottom Version Badge */
.melior-app-version-tag {
  position: fixed;
  bottom: 8px;
  right: 12px;
  z-index: 9998;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.3px;
  color: rgba(226, 232, 240, 0.75);
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  padding: 3px 10px;
  cursor: pointer;
  user-select: none;
  transition: all 0.25s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.melior-app-version-tag:hover {
  color: #00f0ff;
  border-color: rgba(0, 240, 255, 0.5);
  background: rgba(15, 23, 42, 0.95);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.35);
  transform: translateY(-1px);
}

/* 2. Responsive adjustments */
@media (max-width: 600px) {
  .melior-app-version-tag {
    bottom: 6px;
    right: 8px;
    font-size: 10px;
    padding: 2px 8px;
  }
}

/* 3. Slide-up Update Banner */
.pwa-update-banner-bar {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10001;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid #00f0ff;
  box-shadow: 0 4px 24px rgba(0, 240, 255, 0.3), 0 0 0 1px rgba(0, 240, 255, 0.2);
  border-radius: 12px;
  padding: 10px 16px;
  color: #f8fafc;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  max-width: calc(100vw - 32px);
  width: auto;
  animation: pwaSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes pwaSlideUp {
  from {
    opacity: 0;
    transform: translate(-50%, 20px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

.pwa-update-content {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  color: #f1f5f9;
}

.pwa-update-icon {
  font-size: 16px;
  animation: pwaPulse 1.8s infinite;
}

@keyframes pwaPulse {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.15); opacity: 1; }
}

.pwa-update-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pwa-btn-restart {
  background: linear-gradient(135deg, #00f0ff, #0099ff);
  color: #041019;
  border: none;
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.pwa-btn-restart:hover {
  background: linear-gradient(135deg, #33f3ff, #1aa3ff);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.5);
  transform: translateY(-1px);
}

.pwa-btn-dismiss {
  background: transparent;
  color: #94a3b8;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.2s;
}

.pwa-btn-dismiss:hover {
  color: #f8fafc;
}

/* 4. Unified Toast */
.pwa-autoupdate-toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10002;
  display: none;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 240, 255, 0.4);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  color: #e2f8ff;
  border-radius: 20px;
  padding: 8px 18px;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  pointer-events: none;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  animation: pwaFadeIn 0.25s ease-out;
}

@keyframes pwaFadeIn {
  from { opacity: 0; transform: translate(-50%, -10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
