/**
 * Shared loading and failure states for the chatOAME Excalidraw editor.
 *
 * Both live inside whatever container the consumer is about to fill with the
 * editor, so a teacher never sees an empty modal wondering whether anything is
 * happening. The error state is deliberately compact rather than stretching to
 * fill a full-viewport dialog.
 */

.chatoame-excalidraw-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  box-sizing: border-box;
  min-height: 180px;
  padding: 28px 24px;
  margin: 0 auto;
  max-width: 30rem;
  text-align: center;
  color: #24333d;
  font-size: 0.95rem;
  line-height: 1.5;
}

.chatoame-excalidraw-state--error {
  border: 1px solid #d8ccc8;
  border-radius: 12px;
  background: #fdfbfa;
}

.chatoame-excalidraw-state__title {
  margin: 0;
  font-weight: 700;
  font-size: 1rem;
}

.chatoame-excalidraw-state__body {
  margin: 0;
  color: #4a5b66;
}

.chatoame-excalidraw-state__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.chatoame-excalidraw-btn {
  min-height: 40px; /* comfortable touch target on tablets */
  padding: 8px 16px;
  border: 1px solid #6d7f8a;
  border-radius: 10px;
  background: #fff;
  color: #24333d;
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}

.chatoame-excalidraw-btn:hover {
  background: #f2f5f7;
}

.chatoame-excalidraw-btn:focus-visible {
  outline: 3px solid #4f6f85;
  outline-offset: 2px;
}

.chatoame-excalidraw-btn--primary {
  background: #4f6f85;
  border-color: #4f6f85;
  color: #fff;
}

.chatoame-excalidraw-btn--primary:hover {
  background: #446075;
}

.chatoame-excalidraw-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid #cad5dc;
  border-top-color: #4f6f85;
  border-radius: 50%;
  animation: chatoame-excalidraw-spin 0.9s linear infinite;
}

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

/* Respect a teacher who has asked the OS for less motion. */
@media (prefers-reduced-motion: reduce) {
  .chatoame-excalidraw-spinner {
    animation-duration: 3s;
  }
}

@media (max-width: 480px) {
  .chatoame-excalidraw-state {
    padding: 20px 14px;
    min-height: 150px;
  }
  .chatoame-excalidraw-state__actions {
    flex-direction: column;
    align-self: stretch;
  }
  .chatoame-excalidraw-btn {
    width: 100%;
  }
}
