/* ==========================================================================
   MINIMALIST & CLEAN PORTAL STYLES (Matching College Site Aesthetic)
   Clean, light, modern, subtle borders, Inter font, no heavy dark clutter
   ========================================================================== */

:root {
  --portal-bg: #f8fafc;
  --portal-card-bg: #ffffff;
  --portal-border: #e2e8f0;
  --portal-border-hover: #cbd5e1;
  --portal-text-main: #0f172a;
  --portal-text-muted: #64748b;
  --portal-text-faint: #94a3b8;

  --portal-blue: #2563eb;
  --portal-blue-dark: #1d4ed8;
  --portal-blue-light: #eff6ff;
  --portal-emerald: #059669;
  --portal-emerald-light: #ecfdf5;
  --portal-amber: #d97706;
  --portal-amber-light: #fffbeb;

  --portal-radius-sm: 8px;
  --portal-radius-md: 12px;
  --portal-radius-lg: 16px;
  --portal-radius-full: 9999px;

  --portal-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --portal-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --portal-shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
  --portal-shadow-modal: 0 25px 50px -12px rgba(15, 23, 42, 0.25);
}

/* ==========================================================================
   1. MINIMALIST GATEWAY MODAL (Clean, Light, Beautiful)
   ========================================================================== */
.min-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms ease-out;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

.min-modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.min-gateway-card {
  width: 100%;
  max-width: 820px;
  background: #ffffff;
  border: 1px solid var(--portal-border);
  border-radius: var(--portal-radius-lg);
  box-shadow: var(--portal-shadow-modal);
  padding: 32px;
  color: var(--portal-text-main);
  transform: scale(0.97) translateY(8px);
  transition: transform 160ms cubic-bezier(0.16, 1, 0.3, 1);
  max-height: 90vh;
  overflow-y: auto;
}

.min-modal-backdrop.active .min-gateway-card {
  transform: scale(1) translateY(0);
}

.min-gateway-header {
  text-align: center;
  margin-bottom: 28px;
}

.min-gateway-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--portal-blue-light);
  color: var(--portal-blue-dark);
  border: 1px solid #bfdbfe;
  padding: 4px 14px;
  border-radius: var(--portal-radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.min-gateway-title {
  font-size: 1.65rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
  margin: 0 0 8px 0;
}

.min-gateway-subtitle {
  font-size: 0.92rem;
  color: var(--portal-text-muted);
  margin: 0;
}

.min-gateway-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.min-role-card {
  background: #ffffff;
  border: 1.5px solid var(--portal-border);
  border-radius: var(--portal-radius-md);
  padding: 20px;
  cursor: pointer;
  transition: all 140ms ease-out;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: left;
}

.min-role-card:hover {
  border-color: var(--portal-blue);
  background: #f8fafc;
  transform: translateY(-2px);
  box-shadow: var(--portal-shadow-md);
}

.min-role-card.primary-card {
  border-color: #93c5fd;
  background: #fafcff;
}

.min-role-card.primary-card:hover {
  border-color: var(--portal-blue);
  background: #eff6ff;
}

.min-role-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--portal-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin-bottom: 12px;
}

.min-role-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--portal-text-main);
  margin: 0 0 6px 0;
}

.min-role-desc {
  font-size: 0.8rem;
  color: var(--portal-text-muted);
  line-height: 1.45;
  margin: 0 0 16px 0;
  flex-grow: 1;
}

.min-role-btn {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  border-radius: var(--portal-radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  border: 1px solid var(--portal-border);
  background: #ffffff;
  color: var(--portal-text-main);
  transition: all 120ms ease;
}

.min-role-card:hover .min-role-btn {
  background: var(--portal-blue);
  color: #ffffff;
  border-color: var(--portal-blue);
}

/* ==========================================================================
   2. UNOBTRUSIVE FLOATING ROLE SWITCHER PILL (Bottom-Right Corner)
   ========================================================================== */
#floating-role-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--portal-border);
  border-radius: var(--portal-radius-full);
  padding: 4px 6px;
  display: flex;
  align-items: center;
  gap: 4px;
  box-shadow: var(--portal-shadow-lg);
  font-family: 'Inter', system-ui, sans-serif;
  transition: transform 140ms ease, box-shadow 140ms ease;
}

#floating-role-widget:hover {
  box-shadow: 0 14px 30px -4px rgba(0, 0, 0, 0.12);
}

.pill-role-btn {
  background: transparent;
  border: none;
  border-radius: var(--portal-radius-full);
  padding: 6px 14px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--portal-text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 130ms ease;
  white-space: nowrap;
}

.pill-role-btn:hover {
  color: var(--portal-text-main);
  background: #f1f5f9;
}

.pill-role-btn.active {
  background: var(--portal-blue);
  color: #ffffff;
}

.pill-action-icon {
  width: 30px;
  height: 30px;
  border-radius: var(--portal-radius-full);
  border: 1px solid var(--portal-border);
  background: #ffffff;
  color: var(--portal-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 130ms ease;
}

.pill-action-icon:hover {
  color: var(--portal-blue);
  border-color: #93c5fd;
  background: #eff6ff;
}

/* ==========================================================================
   3. TEACHER STUDIO & STUDENT PORTAL (Minimalist & Clean Design)
   ========================================================================== */
.min-view-section {
  display: none;
  min-height: 100vh;
  background: var(--portal-bg);
  color: var(--portal-text-main);
  font-family: 'Inter', system-ui, sans-serif;
}

.min-view-section.active {
  display: block;
}

/* Top Clean Sub-header for Teacher / Student Views */
.min-sub-header {
  background: #ffffff;
  border-bottom: 1px solid var(--portal-border);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.min-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border: 1px solid var(--portal-border);
  padding: 6px 14px;
  border-radius: var(--portal-radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--portal-text-main);
  cursor: pointer;
  transition: all 120ms ease;
}

.min-back-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.min-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 20px 80px 20px;
}

/* Minimalist Hero Card */
.min-hero-card {
  background: #ffffff;
  border: 1px solid var(--portal-border);
  border-radius: var(--portal-radius-lg);
  padding: 28px;
  box-shadow: var(--portal-shadow-sm);
  margin-bottom: 24px;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 24px;
}

@media (max-width: 900px) {
  .min-hero-card {
    grid-template-columns: 1fr;
  }
}

.min-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--portal-blue-light);
  color: var(--portal-blue-dark);
  padding: 3px 10px;
  border-radius: var(--portal-radius-full);
  font-size: 0.72rem;
  font-weight: 600;
  margin-bottom: 10px;
}

.min-hero-title {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #0f172a;
  margin: 0 0 8px 0;
}

.min-hero-meta {
  font-size: 0.9rem;
  color: var(--portal-text-muted);
  line-height: 1.5;
  margin-bottom: 16px;
}

.min-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 14px;
}

@media (max-width: 600px) {
  .min-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.min-metric-box {
  background: #f8fafc;
  border: 1px solid var(--portal-border);
  border-radius: var(--portal-radius-sm);
  padding: 12px;
}

.min-metric-num {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--portal-blue-dark);
  font-family: 'JetBrains Mono', monospace;
}

.min-metric-lbl {
  font-size: 0.72rem;
  color: var(--portal-text-muted);
  font-weight: 500;
  margin-top: 2px;
}

/* Minimalist Turtle Canvas Box */
.min-turtle-box {
  background: #f8fafc;
  border: 1px solid var(--portal-border);
  border-radius: var(--portal-radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
}

.min-turtle-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.min-turtle-canvas-wrap {
  background: #0f172a;
  border-radius: var(--portal-radius-sm);
  overflow: hidden;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#min-hero-turtle-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.min-turtle-code {
  margin-top: 8px;
  background: #ffffff;
  border: 1px solid var(--portal-border);
  border-radius: var(--portal-radius-sm);
  padding: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: #0f172a;
  height: 52px;
  resize: none;
}

.min-turtle-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

/* Navigation Subtabs */
.min-subtabs-bar {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.min-subtab-btn {
  background: #ffffff;
  border: 1px solid var(--portal-border);
  border-radius: var(--portal-radius-sm);
  padding: 8px 16px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--portal-text-muted);
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 120ms ease;
}

.min-subtab-btn:hover {
  color: var(--portal-text-main);
  border-color: #cbd5e1;
}

.min-subtab-btn.active {
  background: var(--portal-blue);
  color: #ffffff;
  border-color: var(--portal-blue);
}

/* Document Cards */
.min-doc-card {
  background: #ffffff;
  border: 1px solid var(--portal-border);
  border-radius: var(--portal-radius-md);
  padding: 24px;
  box-shadow: var(--portal-shadow-sm);
  margin-bottom: 20px;
}

.min-doc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--portal-border);
  padding-bottom: 14px;
}

.min-doc-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

/* Clean Tables */
.min-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--portal-border);
  border-radius: var(--portal-radius-sm);
}

.min-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  text-align: left;
}

.min-table th {
  background: #f8fafc;
  color: var(--portal-text-muted);
  font-weight: 600;
  padding: 10px 14px;
  border-bottom: 1px solid var(--portal-border);
}

.min-table td {
  padding: 10px 14px;
  border-bottom: 1px solid #f1f5f9;
  color: var(--portal-text-main);
}

.min-table tr:hover td {
  background: #f8fafc;
}

.min-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
}

.min-badge.blue {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #dbeafe;
}

.min-badge.green {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

/* Presentation Carousel */
.min-carousel-box {
  background: #f8fafc;
  border: 1px solid var(--portal-border);
  border-radius: var(--portal-radius-md);
  padding: 20px;
  margin-bottom: 18px;
}

/* 3D AUD FULLSCREEN CONTAINER */
.min-threed-frame {
  width: 100%;
  height: calc(100vh - 65px);
  border: none;
  display: block;
}
