/* Mol* panel viewer — Drug of the Day pages (shared) */

#molstar-viewer {
  position: relative;
  width: 100%;
  height: 440px;
  min-height: 320px;
  background: var(--bg, #0a0e14);
  cursor: grab;
  overflow: hidden;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}
#molstar-viewer:active { cursor: grabbing; }
#molstar-viewer canvas {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  touch-action: none;
}
#molstar-viewer.molstar-ready { opacity: 1; }
#molstar-viewer.molstar-unavailable { opacity: 0.35; }

[data-theme="light"] #molstar-viewer {
  background: #f4f6fb;
}

.molstar-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: rgba(10, 14, 20, 0.72);
  z-index: 2;
  transition: opacity 0.35s ease;
  pointer-events: none;
}
[data-theme="light"] .molstar-loading {
  background: rgba(255, 255, 255, 0.82);
}
.molstar-loading.hidden {
  opacity: 0;
  pointer-events: none;
}
.molstar-spinner {
  width: 28px;
  height: 28px;
  border: 2px solid rgba(34, 211, 238, 0.15);
  border-top-color: #22D3EE;
  border-radius: 50%;
  animation: molstar-spin 0.9s linear infinite;
}
.molstar-loading-text {
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 11px;
  color: var(--fg-muted, #8a93a8);
  letter-spacing: 0.06em;
}
@keyframes molstar-spin {
  to { transform: rotate(360deg); }
}

.molstar-error {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 440px;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 12px;
  color: var(--fg-muted, #8a93a8);
  flex-direction: column;
  gap: 0.5rem;
  background: var(--bg, #0a0e14);
  text-align: center;
  padding: 1rem;
}

@media (max-width: 900px) {
  #molstar-viewer { height: 360px; }
  .molstar-error { height: 360px; }
}

@media (prefers-reduced-motion: reduce) {
  .molstar-spinner { animation: none; }
}