/* Loading screen design - shared by index.html and offline.html
   See docs/PROMPTS/125-network-detection.md */

#pwa-loading-screen.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding-top: 48px; /* Task 129: Account for visible topbar */
}

#pwa-loading-topbar.loading-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 48px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid #e5e7eb;
  z-index: 10002;
  display: flex; /* Task 129: Show topbar+red rat from start for offline debugging */
  align-items: center;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.loading-topbar-inner {
  max-width: 768px;
  margin: 0 auto;
  width: 100%;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.loading-topbar-brand {
  display: flex;
  align-items: center;
  gap: 6px;
}

.loading-topbar-title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #1f2937;
}

.loading-image-wrapper {
  width: 100%;
  max-width: 512px;
  padding: 16px;
}

.loading-image-wrapper img {
  width: 100%;
  height: auto;
  max-height: 384px;
  object-fit: contain;
}

.loading-message {
  margin-top: 24px;
  color: #6b7280;
  font-size: 14px;
  font-weight: 500;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  animation: pwa-loading-pulse 1.5s ease-in-out infinite;
}

@keyframes pwa-loading-pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

.loading-error {
  display: none;
  margin-top: 24px;
  padding: 16px;
  max-width: 400px;
  background: #fee2e2;
  border: 1px solid #fca5a5;
  border-radius: 8px;
  color: #991b1b;
}

.loading-error-title {
  font-weight: 600;
  margin-bottom: 8px;
}

.loading-error-message {
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 12px;
}

.loading-error-details {
  font-size: 12px;
  color: #7f1d1d;
  margin-bottom: 12px;
  font-family: monospace;
  word-break: break-all;
}

.loading-error-btn {
  background: #dc2626;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  margin-right: 8px;
}

.loading-error-btn-secondary {
  background: white;
  color: #dc2626;
  border: 1px solid #dc2626;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
