/* overlays.css
   Loading overlay, error panel, and the landscape rotation prompt. */

/* Loading indicator */
#loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  background: rgba(16, 22, 31, 0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  z-index: 10;
  border-radius: 18px;
}

#loading-overlay.hidden {
  display: none;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(33, 225, 159, 0.2);
  border-top-color: var(--ax-emerald);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  color: var(--ax-emerald);
  font-size: 1.1rem;
  font-weight: 500;
}

.loading-bar {
  width: 250px;
  height: 4px;
  background: rgba(33, 225, 159, 0.2);
  border-radius: 2px;
  overflow: hidden;
}

.loading-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--ax-emerald), var(--ax-accent));
  width: 0%;
  transition: width 0.3s ease;
}

/* Error message */
.error-message {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255, 50, 50, 0.15);
  border: 1px solid rgba(255, 50, 50, 0.5);
  color: #ffb3b3;
  padding: 24px 32px;
  border-radius: 12px;
  text-align: center;
  z-index: 20;
  display: none;
  max-width: 400px;
}

.error-message.show {
  display: block;
}

.error-message h3 {
  margin: 0 0 12px 0;
  color: #ff6b6b;
  font-size: 1.3rem;
}

.error-message p {
  margin: 0 0 16px 0;
  font-size: 0.95rem;
  line-height: 1.5;
}

.error-message .error-details {
  font-size: 0.85rem;
  color: rgba(255, 179, 179, 0.7);
  margin-bottom: 16px;
  font-family: monospace;
}

.retry-btn {
  background: rgba(3, 79, 132, 0.9);
  border: 1px solid var(--ax-accent);
  color: var(--ax-accent);
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.retry-btn:hover {
  background: rgba(3, 79, 132, 1);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(56, 255, 199, 0.3);
}

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

.retry-btn:focus-visible {
  outline: 2px solid var(--ax-accent);
  outline-offset: 2px;
}

/* Landscape mode prompt for mobile */
#landscape-prompt {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(11, 16, 23, 0.98);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  z-index: 30;
  padding: 20px;
  text-align: center;
}

#landscape-prompt.show {
  display: flex;
}

.rotate-icon {
  width: 80px;
  height: 80px;
  animation: rotate-hint 2s ease-in-out infinite;
}

.rotate-icon svg {
  width: 100%;
  height: 100%;
  fill: var(--ax-accent);
  filter: drop-shadow(0 4px 12px rgba(56, 255, 199, 0.4));
}

@keyframes rotate-hint {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(90deg); }
}

#landscape-prompt h2 {
  margin: 0;
  color: var(--ax-accent);
  font-size: 1.5rem;
}

#landscape-prompt p {
  margin: 0;
  color: rgba(233, 244, 255, 0.8);
  font-size: 1.1rem;
}

#landscape-prompt .ios-hint {
  display: none;
  margin-top: 12px;
  color: rgba(56, 255, 199, 0.9);
  font-size: 0.95rem;
  font-style: italic;
}

body.is-ios #landscape-prompt .ios-hint {
  display: block;
}

/* OneTrust appends #onetrust-consent-sdk as a child of <body>, which is
   display:flex with a 20px gap. Left alone, the wrapper becomes a zero-height
   flex item that still contributes a gap, so the canvas visibly shrinks and
   reflows a second or two after load when the SDK injects. display:contents
   removes the wrapper from layout; its position:fixed banner children render
   exactly as before. */
#onetrust-consent-sdk {
  display: contents;
}
