/**
 * LYNQx PWA Styles
 * Install banner, toasts, offline indicators, PWA-specific UI
 */

/* ============================================
   INSTALL BANNER
   ============================================ */
#lynx-install-banner {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  max-width: 480px;
  width: calc(100% - 32px);
  animation: lynxInstallSlide 0.4s ease-out;
}

@keyframes lynxInstallSlide {
  from { opacity: 0; transform: translateX(-50%) translateY(40px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

#lynx-install-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: linear-gradient(135deg, rgba(10,10,18,0.98), rgba(15,15,24,0.98));
  border: 1px solid rgba(212,175,55,0.15);
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5), 0 0 20px rgba(212,175,55,0.05);
  backdrop-filter: blur(20px);
}

#lynx-install-text {
  flex: 1;
  min-width: 0;
}

#lynx-install-title {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 2px;
}

#lynx-install-sub {
  font-size: 12px;
  color: #64748b;
  line-height: 1.4;
}

#lynx-install-btn {
  padding: 10px 20px;
  background: linear-gradient(135deg, #D4AF37, #B8860B);
  color: #000;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
  white-space: nowrap;
}

#lynx-install-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(212,175,55,0.3);
}

#lynx-install-dismiss {
  padding: 4px 8px;
  background: none;
  border: none;
  color: #55556a;
  font-size: 20px;
  cursor: pointer;
  transition: color 0.2s;
  flex-shrink: 0;
  line-height: 1;
}

#lynx-install-dismiss:hover {
  color: #fff;
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.lynx-toast {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 10001;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  max-width: 360px;
  opacity: 0;
  transform: translateY(-20px);
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  backdrop-filter: blur(10px);
}

.lynx-toast-success {
  background: rgba(16,185,129,0.15);
  border: 1px solid rgba(16,185,129,0.2);
  color: #34d399;
}

.lynx-toast-warning {
  background: rgba(245,158,11,0.15);
  border: 1px solid rgba(245,158,11,0.2);
  color: #fbbf24;
}

.lynx-toast-error {
  background: rgba(239,68,68,0.15);
  border: 1px solid rgba(239,68,68,0.2);
  color: #f87171;
}

/* ============================================
   UPDATE NOTIFICATION
   ============================================ */
#lynx-update-toast {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10001;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  background: linear-gradient(135deg, rgba(10,10,18,0.98), rgba(15,15,24,0.98));
  border: 1px solid rgba(0,212,170,0.2);
  border-radius: 14px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.4);
  backdrop-filter: blur(20px);
  animation: lynxUpdateSlide 0.4s ease-out;
  font-size: 14px;
  color: #e2e8f0;
}

#lynx-update-toast button {
  padding: 8px 16px;
  background: linear-gradient(135deg, #00d4aa, #059669);
  color: #000;
  border: none;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

#lynx-update-toast button:hover {
  box-shadow: 0 4px 16px rgba(0,212,170,0.3);
}

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

/* ============================================
   PWA-SPECIFIC BODY STATES
   ============================================ */
body.lynx-installed {
  /* When running as installed app */
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

/* Hide browser UI chrome when in standalone mode */
@media (display-mode: standalone) {
  body {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }
}

/* ============================================
   OFFLINE INDICATOR
   ============================================ */
.lynx-offline-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #f59e0b, #ef4444);
  z-index: 99999;
  animation: lynxOfflinePulse 2s ease-in-out infinite;
}

@keyframes lynxOfflinePulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */
@media (max-width: 600px) {
  #lynx-install-banner {
    bottom: 12px;
    width: calc(100% - 24px);
  }

  #lynx-install-inner {
    padding: 12px 14px;
    gap: 10px;
  }

  #lynx-install-title {
    font-size: 14px;
  }

  #lynx-install-sub {
    font-size: 11px;
  }

  #lynx-install-btn {
    padding: 8px 14px;
    font-size: 12px;
  }

  .lynx-toast {
    left: 16px;
    right: 16px;
    top: auto;
    bottom: 100px;
    max-width: none;
  }
}
