/* PWA Component Styles */

/* Offline Status Banner */
.pwa-offline-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: #1e2330;
  color: #f2f4f8;
  font-size: 0.85rem;
  font-weight: 500;
  text-align: center;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15);
  transform: translateY(100%);
  transition: transform 0.3s var(--ease-out);
}

.pwa-offline-banner.visible {
  transform: translateY(0);
}

.pwa-offline-banner.online {
  background: #10b981;
  color: #ffffff;
}

.pwa-offline-banner .pwa-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #f59e0b;
  display: inline-block;
  animation: pulse 2s infinite;
}

.pwa-offline-banner.online .pwa-status-dot {
  background-color: #ffffff;
  animation: none;
}

/* Floating Install Toast / Card */
.pwa-install-banner {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9000;
  width: calc(100% - 32px);
  max-width: 380px;
  background: var(--surface, #181b26);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.12));
  border-radius: var(--radius-lg, 16px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35), 0 2px 8px rgba(0, 0, 0, 0.2);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transform: translateY(120%);
  opacity: 0;
  visibility: hidden;
  transition: transform 0.35s var(--ease-out, cubic-bezier(0.16, 1, 0.3, 1)),
              opacity 0.35s var(--ease-out, cubic-bezier(0.16, 1, 0.3, 1)),
              visibility 0.35s;
  backdrop-filter: blur(12px);
}

.pwa-install-banner.visible {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
}

/* Close (X) button */
.pwa-close-x {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-muted, #8e95a5);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 2;
}

.pwa-close-x:hover {
  color: var(--text-color, #ffffff);
  background: var(--hover-bg, rgba(255, 255, 255, 0.1));
}

/* Header */
.pwa-install-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-right: 24px; /* avoid overlap with close button */
}

.pwa-app-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  background: var(--bg, #12141d);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.pwa-install-header-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.pwa-install-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-color, #f2f4f8);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pwa-install-subtitle {
  font-size: 0.76rem;
  color: var(--text-muted, #8e95a5);
  font-weight: 500;
  margin-top: 2px;
}

/* Description */
.pwa-install-desc {
  font-size: 0.82rem;
  color: var(--text-muted, #a0a7b8);
  line-height: 1.4;
  margin: 0;
}

/* Footer / Actions */
.pwa-install-footer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 2px;
}

.btn-pwa-install {
  width: 100%;
  background: var(--accent, #3b82f6);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md, 8px);
  padding: 9px 16px;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.btn-pwa-install:hover {
  background: var(--accent-hover, #2563eb);
  transform: translateY(-1px);
}

.btn-pwa-install:active {
  transform: translateY(0);
}

/* Secondary Links Row */
.pwa-secondary-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.78rem;
}

.btn-pwa-dismiss,
.btn-pwa-never {
  background: transparent;
  color: var(--text-muted, #8e95a5);
  border: none;
  font-size: 0.78rem;
  font-weight: 500;
  padding: 4px 6px;
  cursor: pointer;
  border-radius: var(--radius-sm, 4px);
  white-space: nowrap; /* Crucial: Prevents wrapping into two lines */
  transition: color 0.2s ease, background 0.2s ease;
}

.btn-pwa-dismiss:hover {
  color: var(--text-color, #ffffff);
}

.btn-pwa-never:hover {
  color: #ef4444;
}

.pwa-link-divider {
  color: var(--text-muted, #525866);
  font-size: 0.7rem;
  user-select: none;
}

/* Nav Install Button */
.pwa-nav-install-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-md, 8px);
  background: var(--accent-soft, rgba(59, 130, 246, 0.12));
  color: var(--accent, #3b82f6);
  border: 1px solid rgba(59, 130, 246, 0.2);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.pwa-nav-install-btn:hover {
  background: var(--accent, #3b82f6);
  color: #ffffff;
}

/* Mobile responsive layout */
@media (max-width: 480px) {
  .pwa-install-banner {
    bottom: 12px;
    left: 12px;
    right: 12px;
    width: auto;
    padding: 14px 16px;
  }

  .pwa-install-title {
    font-size: 0.9rem;
  }

  .pwa-install-desc {
    font-size: 0.78rem;
  }

  .btn-pwa-install {
    padding: 8px 14px;
    font-size: 0.84rem;
  }
}
