/* ============================================================
   AKGLS PWA — UI Components
   Install banner, update toast, online/offline indicators
   ============================================================ */

/* ── Install Banner ─────────────────────────────────────────── */
#akgls-install-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 99999;
  background: #1e3a8a;
  color: #fff;
  padding: 0.85rem 1rem;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.25);
  animation: slideUp 0.35s cubic-bezier(0.34,1.56,0.64,1) both;
}

@keyframes slideUp {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.akgls-install-inner {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  max-width: 700px;
  margin: 0 auto;
}

.akgls-install-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.akgls-install-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  line-height: 1.4;
}

.akgls-install-text strong {
  font-size: 0.95rem;
  font-weight: 700;
}

.akgls-install-text span {
  font-size: 0.82rem;
  opacity: 0.85;
}

.akgls-install-btn {
  border: none;
  cursor: pointer;
  font-weight: 600;
  border-radius: 8px;
  padding: 0.5rem 1.1rem;
  font-size: 0.875rem;
  transition: opacity 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}

.akgls-install-btn:hover { opacity: 0.85; }

.akgls-install-accept {
  background: #fff;
  color: #1e3a8a;
}

.akgls-install-dismiss {
  background: rgba(255,255,255,0.15);
  color: #fff;
  padding: 0.5rem 0.8rem;
  font-size: 1.1rem;
  line-height: 1;
}

/* ── Toast Notifications ─────────────────────────────────────── */
.akgls-toast {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 99998;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: #1e293b;
  color: #f1f5f9;
  border-radius: 0.875rem;
  padding: 1rem 1.25rem;
  max-width: 360px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
  animation: toastIn 0.3s cubic-bezier(0.34,1.56,0.64,1) both;
  border-left: 4px solid #3b82f6;
}

@keyframes toastIn {
  from { transform: translateX(120%) scale(0.9); opacity: 0; }
  to   { transform: translateX(0) scale(1);      opacity: 1; }
}

.akgls-toast-success { border-left-color: #22c55e; }
.akgls-toast-warning { border-left-color: #f59e0b; }
.akgls-toast-error   { border-left-color: #ef4444; }

.akgls-toast-icon {
  font-size: 1.4rem;
  line-height: 1;
  flex-shrink: 0;
}

.akgls-toast-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.akgls-toast-body strong {
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
}

.akgls-toast-body span {
  font-size: 0.82rem;
  opacity: 0.8;
  line-height: 1.45;
}

.akgls-toast-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.6rem;
  flex-wrap: wrap;
}

.akgls-toast-btn {
  border: none;
  cursor: pointer;
  border-radius: 6px;
  padding: 0.35rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 600;
  transition: opacity 0.15s;
}

.akgls-toast-btn:hover { opacity: 0.82; }

.akgls-toast-btn.primary {
  background: #3b82f6;
  color: #fff;
}

.akgls-toast-btn.secondary {
  background: rgba(255,255,255,0.12);
  color: #e2e8f0;
}

.akgls-toast-close {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
  padding: 0;
  margin-left: 0.25rem;
  flex-shrink: 0;
  transition: color 0.15s;
}

.akgls-toast-close:hover { color: #fff; }

/* Multiple toasts stacked */
.akgls-toast + .akgls-toast {
  bottom: calc(1.25rem + 90px);
}

/* ── Display mode badge (standalone) ─────────────────────────── */
@media (display-mode: standalone) {
  .akgls-pwa-hide-installed {
    display: none !important;
  }
}

/* ── Offline page link indicator ─────────────────────────────── */
body.is-offline a[href^="http"]:not([href*="akgls.org"])::after {
  content: " (offline)";
  font-size: 0.75em;
  opacity: 0.6;
}

/* ── Mobile responsive ───────────────────────────────────────── */
@media (max-width: 480px) {
  .akgls-toast {
    right: 0.75rem;
    left:  0.75rem;
    max-width: none;
    bottom: 0.75rem;
  }

  #akgls-install-banner {
    padding: 0.75rem;
  }

  .akgls-install-text span {
    display: none;
  }
}
