/* ══ API ERROR OVERLAY ══ */
#api-error-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000; /* Above everything */
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: none; /* Hidden by default */
  align-items: center;
  justify-content: center;
  animation: fadeInOverlay 0.4s ease-out;
}

@keyframes fadeInOverlay {
  from { opacity: 0; }
  to { opacity: 1; }
}

.api-error-card {
  background: #fff;
  width: 100%;
  max-width: 420px;
  padding: 40px 30px;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  text-align: center;
  transform: translateY(0);
  animation: slideUpCard 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUpCard {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.api-error-icon-wrap {
  width: 80px;
  height: 80px;
  background: #fff5f5;
  color: #fa5252;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  margin: 0 auto 24px;
  position: relative;
}

.api-error-icon-wrap i {
  position: relative;
  z-index: 1;
}

.api-error-pulse {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #fa5252;
  opacity: 0.2;
  animation: pulseIcon 2s infinite;
}

@keyframes pulseIcon {
  0% { transform: scale(1); opacity: 0.2; }
  70% { transform: scale(1.6); opacity: 0; }
  100% { transform: scale(1.6); opacity: 0; }
}

.api-error-card h2 {
  font-size: 20px;
  font-weight: 700;
  color: #1a1b1e;
  margin-bottom: 12px;
}

.api-error-card p {
  font-size: 14px;
  color: #5c5f66;
  line-height: 1.6;
  margin-bottom: 30px;
}

.btn-retry-connection {
  width: 100%;
  height: 48px;
  background: #228be6;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(34, 139, 230, 0.25);
}

.btn-retry-connection:hover {
  background: #1c7ed6;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(34, 139, 230, 0.3);
}

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

.btn-retry-connection:disabled {
  background: #ced4da;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* Spinner inside button */
.btn-retry-connection .spinner-retry {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spinRetry 0.8s linear infinite;
  display: none;
}

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

.btn-retry-connection.loading .spinner-retry {
  display: block;
}

.btn-retry-connection.loading .icon-retry {
  display: none;
}
