/* ============================================================
   EduMarkets Platform — Shell Styles
   Handles module mounting, loading states, and platform nav.
   ============================================================ */

/* ── Module mount container ── */
#module-mount {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* ── Module transition overlay (full-screen, covers header + content) ── */
.module-transition-overlay {
  position: fixed;
  inset: 0;
  z-index: 350;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  opacity: 1;
  transition: opacity 0.3s ease;
  pointer-events: all;
}
.module-transition-overlay[hidden] { display: none; }
.module-transition-overlay.hiding {
  opacity: 0;
  pointer-events: none;
}

.module-transition-logo {
  height: 72px;
  width: auto;
}

.module-transition-spinner {
  width: 28px;
  height: 28px;
  border: 2.5px solid var(--border);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ── Loading state while module JS loads ── */
.platform-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  gap: 16px;
  color: var(--text-muted);
}

.platform-loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.platform-loading-label {
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.03em;
}

/* ── No-module state (shown on load before first module) ── */
.platform-welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 70vh;
  text-align: center;
  padding: 40px 24px;
}

.platform-welcome h1 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text);
}

.platform-welcome p {
  color: var(--text-muted);
  max-width: 480px;
  font-size: 0.92rem;
  line-height: 1.6;
}

/* ── Module switcher list in user-menu ── */
.user-menu-loading {
  padding: 10px 16px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Active module highlight in switcher */
.user-menu-item.module-active {
  color: var(--color-accent);
  font-weight: 600;
}

.user-menu-item.module-active::before {
  content: '▸ ';
  font-size: 0.7em;
}

/* Disabled module (not yet enabled by trainer) */
.user-menu-item.module-disabled {
  opacity: 0.5;
  cursor: default;
  pointer-events: none;
}

/* ── Shared Modal Dialog (used across all modules) ────────────────────── */

.iro-dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
}

.iro-dialog {
  background: var(--bg-surface, #151518);
  border: 1px solid var(--border, #333);
  border-radius: 12px;
  width: min(960px, 92vw);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.iro-dialog.iro-dialog-wide {
  width: min(1100px, 94vw);
}

.iro-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border, #333);
  flex-shrink: 0;
}

.iro-dialog-header h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}

.iro-dialog-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.6);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
}
.iro-dialog-close:hover {
  color: #fff;
  background: rgba(255,255,255,0.1);
}

.iro-dialog-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
}

[data-theme="light"] .iro-dialog-close { color: rgba(0,0,0,0.5); }
[data-theme="light"] .iro-dialog-close:hover { color: #000; background: rgba(0,0,0,0.08); }
