/*
 * Author: Yogabrata Mukhopadhyay
 * Organization: ManjuLab
 * Copyright (c) 2026 ManjuLab. All rights reserved.
 */
/* ManjuLAB Online Portal — SaaS hub, folders, login, study room */
@import url('./portal-loop.css?v=10');

.portal-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.portal-header {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}
.portal-header .back-link {
  color: var(--cyan-light);
  text-decoration: none;
  font-size: 0.9rem;
}
.portal-header .back-link:hover { text-decoration: underline; }
.portal-header h1 {
  font-size: 1rem;
  font-weight: 600;
  color: #f1f5f9;
  text-align: center;
  flex: 1;
}

.portal-main {
  flex: 1;
  position: relative;
  z-index: 5;
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 24px 48px;
  width: 100%;
}

.portal-hero {
  text-align: center;
  margin-bottom: 36px;
}
.portal-hero .eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cyan-light);
}
.portal-hero h2 {
  font-size: clamp(1.4rem, 3vw, 1.85rem);
  color: #f8fafc;
  margin-top: 8px;
}
.portal-hero p {
  color: var(--muted);
  font-size: 0.95rem;
  max-width: 520px;
  margin: 12px auto 0;
}

/* SaaS folder grid */
.folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 20px;
  max-width: 900px;
  margin: 0 auto;
}
.folder-card {
  position: relative;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: center;
  padding: 0;
  color: inherit;
  font: inherit;
  transition: transform 0.25s ease;
}
.folder-card:hover { transform: translateY(-4px); }
.folder-card:focus-visible {
  outline: 2px solid var(--cyan-light);
  outline-offset: 4px;
  border-radius: 12px;
}
.folder-card.is-static { cursor: pointer; opacity: 0.92; }

.folder-icon {
  position: relative;
  height: 100px;
  margin-bottom: 10px;
}
.folder-icon::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 88px;
  height: 64px;
  border-radius: 0 10px 10px 10px;
  background: linear-gradient(145deg, rgba(6, 182, 212, 0.35), rgba(15, 23, 42, 0.9));
  border: 1px solid rgba(103, 232, 249, 0.25);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.folder-icon::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 18px;
  transform: translateX(-50%);
  margin-left: -22px;
  width: 44px;
  height: 14px;
  border-radius: 6px 6px 0 0;
  background: linear-gradient(90deg, rgba(6, 182, 212, 0.5), rgba(6, 182, 212, 0.25));
  border: 1px solid rgba(103, 232, 249, 0.2);
  border-bottom: none;
}
.folder-card[data-vertical="education"] .folder-icon::before {
  background: linear-gradient(145deg, rgba(16, 185, 129, 0.4), rgba(15, 23, 42, 0.9));
  border-color: rgba(52, 211, 153, 0.35);
}
.folder-card[data-vertical="hvac"] .folder-icon::before {
  background: linear-gradient(145deg, rgba(249, 115, 22, 0.35), rgba(15, 23, 42, 0.9));
}
.folder-card[data-vertical="restaurant"] .folder-icon::before {
  background: linear-gradient(145deg, rgba(234, 179, 8, 0.35), rgba(15, 23, 42, 0.9));
}
.folder-card[data-vertical="hospital"] .folder-icon::before {
  background: linear-gradient(145deg, rgba(239, 68, 68, 0.35), rgba(15, 23, 42, 0.9));
}
.folder-card[data-vertical="events"] .folder-icon::before {
  background: linear-gradient(145deg, rgba(168, 85, 247, 0.35), rgba(15, 23, 42, 0.9));
}
.folder-card[data-vertical="landscaping"] .folder-icon::before {
  background: linear-gradient(145deg, rgba(34, 197, 94, 0.35), rgba(15, 23, 42, 0.9));
}

.folder-emoji {
  position: relative;
  z-index: 1;
  font-size: 1.75rem;
  line-height: 100px;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.4));
}
.folder-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #e2e8f0;
  line-height: 1.3;
}
.folder-tagline {
  display: block;
  font-size: 0.62rem;
  line-height: 1.35;
  color: var(--cyan-light);
  opacity: 0.85;
  max-width: 150px;
  margin: 4px auto 0;
  font-weight: 400;
}
.login-error {
  color: #fca5a5;
  font-size: 0.78rem;
  margin: 8px 0 0;
}

.portal-login-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(2, 6, 23, 0.88);
  backdrop-filter: blur(8px);
}

.portal-login-card {
  width: min(100%, 380px);
  padding: 28px 24px;
  border-radius: 16px;
  background: linear-gradient(160deg, rgba(30, 41, 59, 0.98), rgba(15, 23, 42, 0.98));
  border: 1px solid rgba(56, 189, 248, 0.25);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
  text-align: center;
}

.portal-login-card h2 {
  margin: 8px 0 6px;
  color: #f8fafc;
  font-size: 1.2rem;
}

.portal-login-lead {
  color: #94a3b8;
  font-size: 0.85rem;
  margin: 0 0 18px;
}

.portal-login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
}

.portal-login-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.78rem;
  color: #cbd5e1;
}

.portal-login-form input {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(15, 23, 42, 0.8);
  color: #f1f5f9;
  font: inherit;
}

body.portal-login-locked .portal-main,
body.portal-login-locked .portal-header {
  filter: blur(4px);
  pointer-events: none;
  user-select: none;
}
.folder-badge {
  display: inline-block;
  margin-top: 6px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
}
.folder-badge.live {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
  border: 1px solid rgba(52, 211, 153, 0.35);
}
.folder-badge.platform {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

/* Microservice cards */
.sku-grid {
  display: grid;
  gap: 16px;
  max-width: 720px;
  margin: 0 auto;
}
.sku-card {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  text-align: left;
  padding: 18px 20px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  cursor: pointer;
  color: inherit;
  font: inherit;
  transition: border-color 0.2s, transform 0.2s;
}
.sku-card:hover:not(:disabled) {
  border-color: rgba(103, 232, 249, 0.4);
  transform: translateX(4px);
}
.sku-card:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.sku-card .sku-icon { font-size: 1.75rem; }
.sku-card .sku-body { flex: 1; }
.sku-card .sku-body strong {
  display: block;
  color: #f1f5f9;
  font-size: 1rem;
}
.sku-card .sku-body span {
  font-size: 0.8rem;
  color: var(--muted);
}

/* Login modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(2, 6, 23, 0.82);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}
.modal-panel {
  width: 100%;
  max-width: 400px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.95);
  padding: 28px 24px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
  transform: translateY(12px);
  transition: transform 0.25s;
}
.modal-backdrop.open .modal-panel { transform: translateY(0); }
.modal-panel h3 {
  font-size: 1.15rem;
  color: #f8fafc;
  margin-bottom: 4px;
}
.modal-panel .modal-sub {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 20px;
}
.modal-panel label {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 4px;
}
.modal-panel input,
.modal-panel select {
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(2, 6, 23, 0.6);
  color: #e2e8f0;
  font-size: 0.9rem;
}
.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}
.btn-portal {
  flex: 1;
  padding: 11px 16px;
  border-radius: 999px;
  border: none;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
}
.btn-portal-primary {
  background: linear-gradient(135deg, #06b6d4, #0891b2);
  color: #0f172a;
}
.btn-portal-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
}
.role-pick {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
.role-pick button {
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(2, 6, 23, 0.5);
  color: #cbd5e1;
  cursor: pointer;
  font-size: 0.85rem;
}
.role-pick button.active {
  border-color: rgba(103, 232, 249, 0.5);
  background: rgba(6, 182, 212, 0.15);
  color: #67e8f9;
}
.role-pick button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Study room */
.study-room-page.student-ambience {
  --lamp-glow: rgba(251, 191, 36, 0.12);
  --desk-accent: rgba(6, 182, 212, 0.15);
}
.study-room-page.teacher-ambience {
  --lamp-glow: rgba(148, 163, 184, 0.1);
  --desk-accent: rgba(251, 191, 36, 0.12);
}
.study-desk {
  position: relative;
  border-radius: 20px;
  border: 1px solid var(--border);
  background:
    radial-gradient(ellipse 60% 40% at 20% 0%, var(--lamp-glow), transparent),
    linear-gradient(180deg, rgba(15, 23, 42, 0.85), rgba(2, 6, 23, 0.92));
  min-height: 420px;
  overflow: hidden;
}
.lamp-glow {
  position: absolute;
  top: -20px;
  left: 24px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--lamp-glow), transparent 70%);
  pointer-events: none;
}
.book-rack {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}
.book-spine {
  flex-shrink: 0;
  width: 36px;
  height: 52px;
  border-radius: 4px 8px 8px 4px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 4px;
  font-size: 0.55rem;
  font-weight: 700;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
  color: rgba(255,255,255,0.85);
}
.book-spine.sci { background: linear-gradient(180deg, #059669, #047857); }
.book-spine.math { background: linear-gradient(180deg, #0284c7, #0369a1); }

.study-layout {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}
@media (min-width: 900px) {
  .study-layout { grid-template-columns: 220px 1fr 200px; }
}

.chapter-list {
  list-style: none;
  padding: 12px;
  max-height: 360px;
  overflow-y: auto;
}
.chapter-list li button {
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  margin-bottom: 4px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: #cbd5e1;
  font-size: 0.78rem;
  cursor: pointer;
}
.chapter-list li button.active,
.chapter-list li button:hover {
  background: rgba(6, 182, 212, 0.12);
  color: #67e8f9;
}

.chat-panel {
  display: flex;
  flex-direction: column;
  min-height: 320px;
  padding: 12px;
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
  max-height: 280px;
}
.chat-bubble {
  max-width: 88%;
  padding: 8px 12px;
  border-radius: 14px;
  font-size: 0.82rem;
  line-height: 1.45;
}
.chat-bubble.tutor { align-self: flex-start; background: rgba(51, 65, 85, 0.8); }
.chat-bubble.student { align-self: flex-end; background: rgba(6, 182, 212, 0.2); }
.chat-bubble.peer { align-self: flex-start; background: rgba(139, 92, 246, 0.15); border: 1px solid rgba(167, 139, 250, 0.2); }
.chat-input-row {
  display: flex;
  gap: 8px;
}
.study-quick-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.study-quick-btn {
  font-size: 0.72rem;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(103, 232, 249, 0.35);
  background: rgba(6, 182, 212, 0.1);
  color: #67e8f9;
  cursor: pointer;
}
.study-quick-btn:hover {
  background: rgba(6, 182, 212, 0.2);
}
.chat-input-row input {
  flex: 1;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(2, 6, 23, 0.5);
  color: #e2e8f0;
}

.teacher-placeholder {
  text-align: center;
  padding: 48px 24px;
  color: var(--muted);
}
.teacher-placeholder h3 { color: #fbbf24; margin-bottom: 8px; }

.portal-note {
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 24px;
}
.portal-note a { color: var(--cyan-light); }

/* Live online badge */
.online-live-badge {
  font-size: 0.68rem;
  color: #6ee7b7;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(52, 211, 153, 0.35);
  background: rgba(16, 185, 129, 0.08);
  margin-left: 8px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.online-live-badge:hover {
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(52, 211, 153, 0.55);
}

/* Subject orbs (replaces book spines) */
.subject-orbs {
  display: flex;
  gap: 12px;
  justify-content: center;
  padding: 16px 12px 8px;
}
.subject-orb {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  border: 1px solid rgba(148, 163, 184, 0.25);
  box-shadow: 0 0 24px rgba(6, 182, 212, 0.15);
}
.subject-orb.science {
  background: radial-gradient(circle at 30% 30%, rgba(16, 185, 129, 0.45), rgba(15, 23, 42, 0.85));
}
.subject-orb.math {
  background: radial-gradient(circle at 30% 30%, rgba(6, 182, 212, 0.45), rgba(15, 23, 42, 0.85));
}

/* Circular microservice nav (portal pages) */
.portal-circle-grid {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(24px, 5vw, 48px);
  justify-content: center;
  align-items: center;
  margin: 0 auto;
  max-width: 960px;
}
.portal-circle-grid .portal {
  width: min(200px, 40vw);
  height: min(200px, 40vw);
}
.portal-circle-grid .portal-sub {
  font-size: 0.62rem;
  line-height: 1.35;
}
.portal-circle-grid .portal-title {
  font-size: clamp(0.82rem, 2vw, 0.95rem);
}
.portal-circle-grid .portal-icon {
  font-size: 1.6rem;
}
.portal-circle-grid .online-thumb-badge {
  display: block;
  margin-top: 4px;
  font-size: 0.58rem;
  color: #6ee7b7;
}
button.portal {
  border: none;
  background: transparent;
  padding: 0;
  font: inherit;
  cursor: pointer;
}
button.portal:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
button.portal:disabled:hover {
  transform: none;
}

/* Rhytoma stream circles */
.stream-circle-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  justify-content: center;
  margin: 28px 0;
}
.stream-circle-grid .portal {
  width: min(160px, 36vw);
  height: min(160px, 36vw);
}
.stream-nested {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(148, 163, 184, 0.15);
}
.stream-nested h3 {
  text-align: center;
  font-size: 0.85rem;
  color: #94a3b8;
  margin-bottom: 16px;
}
.folder-card .online-thumb-badge,
.sku-card .online-thumb-badge {
  display: block;
  margin-top: 8px;
  font-size: 0.68rem;
  color: #6ee7b7;
  font-weight: 500;
}

/* Study room — outer peers panel */
.study-room-wrap {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.study-room-wrap .study-desk {
  flex: 1;
  min-width: 0;
}
.peers-outer-panel {
  width: 280px;
  flex-shrink: 0;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.75);
  overflow: hidden;
}
.peers-outer-panel.collapsed .peers-chevron {
  transform: rotate(-90deg);
}
.peers-outer-toggle {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  border: none;
  background: rgba(6, 182, 212, 0.1);
  color: #67e8f9;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}
.peers-chevron {
  transition: transform 0.2s;
  opacity: 0.7;
}
.peers-outer-body {
  padding: 10px 12px 14px;
  max-height: 420px;
  overflow-y: auto;
}
.peers-hint {
  font-size: 0.65rem;
  color: #94a3b8;
  margin: 0 0 10px;
  line-height: 1.4;
}
.peers-filter-row select {
  width: 100%;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(2, 6, 23, 0.6);
  color: #e2e8f0;
  font-size: 0.75rem;
  margin-bottom: 10px;
}
.peers-roster {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.peer-roster-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.15);
  background: rgba(2, 6, 23, 0.4);
}
.peer-avatar {
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.peer-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.peer-meta strong {
  font-size: 0.78rem;
  color: #f1f5f9;
}
.peer-loc {
  font-size: 0.65rem;
  color: #94a3b8;
}
.peer-school {
  font-size: 0.6rem;
  color: #64748b;
  line-height: 1.3;
}
.peer-invite-btn {
  font-size: 0.62rem !important;
  padding: 4px 8px !important;
  white-space: nowrap;
  align-self: center;
}
.peers-empty {
  font-size: 0.72rem;
  color: #64748b;
  padding: 8px;
}
.active-peers {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(148, 163, 184, 0.15);
}
.peers-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
  margin-bottom: 6px;
}
#activePeerList {
  list-style: none;
  margin: 0;
  padding: 0;
}
#activePeerList li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: #c4b5fd;
  margin-bottom: 4px;
}
#activePeerList img {
  border-radius: 50%;
}

/* Admin dashboard */
.admin-page .admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.admin-stat-card {
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.6);
}
.admin-stat-card strong {
  display: block;
  font-size: 1.4rem;
  color: #67e8f9;
}
.admin-stat-card span {
  font-size: 0.72rem;
  color: #94a3b8;
}
.admin-table-wrap {
  overflow-x: auto;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.2);
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}
.admin-table th,
.admin-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}
.admin-table th {
  color: #94a3b8;
  font-weight: 600;
  background: rgba(2, 6, 23, 0.5);
}
.admin-table tr.bot-row td:first-child {
  color: #fbbf24;
}
.admin-table tr.real-row td:first-child {
  color: #6ee7b7;
}
.admin-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 600;
}
.admin-badge.bot {
  background: rgba(251, 191, 36, 0.15);
  color: #fcd34d;
}
.admin-badge.real {
  background: rgba(52, 211, 153, 0.15);
  color: #6ee7b7;
}
.admin-badge.online {
  background: rgba(6, 182, 212, 0.15);
  color: #67e8f9;
}
.admin-badge.offline {
  background: rgba(100, 116, 139, 0.15);
  color: #64748b;
}

@media (max-width: 960px) {
  .study-room-wrap {
    flex-direction: column;
  }
  .peers-outer-panel {
    width: 100%;
  }
}

/* CBSE10 hub */
.cbse10-hub-grid {
  max-width: 920px;
  margin: 0 auto;
}

/* Game Room WIP circle — visible in every track hub, not clickable yet */
.portal.portal--wip,
.portal.portal--game-room.is-static {
  opacity: 0.72;
  cursor: not-allowed;
  filter: grayscale(0.15);
}
.portal.portal--wip .portal-sub,
.portal.portal--game-room.is-static .portal-sub {
  color: #fbbf24;
  font-weight: 600;
}

/* World curriculum hub — universe / multi-ring orbit */
.world-hub-universe,
.world-hub {
  position: relative;
  width: min(920px, 98vw);
  height: min(920px, 98vw);
  margin: 0 auto 32px;
  isolation: isolate;
}
.world-hub-orbit-stage {
  position: absolute;
  inset: 0;
  z-index: 2;
}
.world-hub-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.85;
}
.world-hub-ring-path,
.world-hub-ring circle {
  fill: none;
  stroke: rgba(103, 232, 249, 0.14);
  stroke-width: 1;
  stroke-dasharray: 5 12;
}
.world-hub-ring line {
  stroke: rgba(167, 139, 250, 0.12);
  stroke-width: 1;
}
.world-hub-orbit-track {
  position: absolute;
  inset: 0;
  animation: world-orbit-spin var(--orbit-duration, 140s) linear infinite;
  will-change: transform;
}
/* Static ring — countries fixed on orbit (no vertical stack) */
.world-hub--static .world-hub-orbit-stage {
  position: absolute;
  inset: 0;
}
.world-hub-static-ring {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.world-hub-static-node {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(128px, 22vmin);
  height: min(128px, 22vmin);
  margin: 0;
  pointer-events: auto;
  transform:
    rotate(var(--node-angle, 0deg))
    translateY(calc(-1 * var(--ring-offset, 38vmin)))
    rotate(calc(-1 * var(--node-angle, 0deg)))
    translate(-50%, -50%);
  transition: transform 0.25s ease, filter 0.25s ease;
  z-index: 3;
}
.world-hub-static-node.portal--hub-satellite-india {
  width: min(148px, 25vmin);
  height: min(148px, 25vmin);
  z-index: 4;
}
.world-hub-static-node:hover {
  z-index: 9;
  filter: brightness(1.1);
  transform:
    rotate(var(--node-angle, 0deg))
    translateY(calc(-1 * var(--ring-offset, 38vmin)))
    rotate(calc(-1 * var(--node-angle, 0deg)))
    translate(-50%, -50%)
    scale(1.06);
}
.world-hub--static .world-hub .portal--hub-satellite {
  position: absolute;
  left: auto;
  top: auto;
  margin-left: 0;
  margin-top: 0;
}
.world-hub-orbit-track--ccw {
  animation-direction: reverse;
}
.world-hub-orbit-track--1 {
  animation-duration: var(--orbit-duration, 200s);
}
@keyframes world-orbit-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.world-hub-orbit-arm {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  transform: rotate(var(--hub-angle, 0deg)) translate(var(--orbit-radius, 38vmin))
    rotate(calc(-1 * var(--hub-angle, 0deg)));
  pointer-events: none;
}
.world-hub-orbit-arm .portal {
  pointer-events: auto;
  animation: world-orbit-counter var(--orbit-counter, 140s) linear infinite;
}
.world-hub-orbit-track--ccw .world-hub-orbit-arm .portal {
  animation-direction: reverse;
}
@keyframes world-orbit-counter {
  from { transform: rotate(0deg); }
  to { transform: rotate(-360deg); }
}
.world-hub .portal--hub-center {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(200px, 34vmin);
  height: min(200px, 34vmin);
  z-index: 5;
  animation: world-center-glow 6s ease-in-out infinite;
}
@keyframes world-center-glow {
  0%, 100% { filter: drop-shadow(0 0 24px rgba(167, 139, 250, 0.35)); }
  50% { filter: drop-shadow(0 0 42px rgba(6, 182, 212, 0.45)); }
}
.world-hub .portal--hub-center:hover {
  transform: translate(-50%, -50%) scale(1.06);
  z-index: 8;
}
.world-hub .portal--hub-satellite {
  position: relative;
  left: auto;
  top: auto;
  width: min(128px, 22vmin);
  height: min(128px, 22vmin);
  margin-left: calc(min(64px, 11vmin) * -1);
  margin-top: calc(min(64px, 11vmin) * -1);
  z-index: 3;
}
.world-hub .portal--hub-satellite:hover {
  z-index: 9;
  filter: brightness(1.08);
}
.world-hub .portal--hub-satellite-india {
  width: min(148px, 25vmin);
  height: min(148px, 25vmin);
  margin-left: calc(min(74px, 12.5vmin) * -1);
  margin-top: calc(min(74px, 12.5vmin) * -1);
  z-index: 4;
}
.world-hub .portal--hub-satellite-india .portal-ring {
  box-shadow: 0 0 56px rgba(255, 153, 51, 0.45), inset 0 0 32px rgba(19, 136, 8, 0.12);
}
.portal-core--center {
  gap: 8px;
}
.flag-medallion--lg {
  width: min(72px, 16vw);
  height: min(72px, 16vw);
}
.flag-medallion--xl {
  width: min(80px, 18vw);
  height: min(80px, 18vw);
}
.portal-orbit--slow {
  animation-duration: 48s;
}
.portal-hero--compact {
  margin-bottom: 12px;
}
.portal-hero--compact h2 {
  font-size: clamp(1.35rem, 3.5vw, 1.85rem);
}
.portal--international { --flag-glow: rgba(167, 139, 250, 0.6); }

.portal--country-generic { --flag-glow: rgba(56, 189, 248, 0.55); }
.portal--country-generic .portal-ring {
  background: radial-gradient(circle, rgba(56, 189, 248, 0.35) 0%, rgba(15, 23, 42, 0.2) 55%, transparent 70%);
}
.flag-medallion .flag-emoji {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  line-height: 1;
  filter: drop-shadow(0 0 8px var(--flag-glow, rgba(56, 189, 248, 0.4)));
}
.world-hub-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(226, 232, 240, 0.75);
  font-size: 0.95rem;
  z-index: 1;
}
.world-hub[data-country-count]:not([data-country-count="0"]) .world-hub-loading {
  display: none;
}

/* Portal circle layout overrides (loop visuals in portal-loop.css) */
a.portal {
  transition: filter 0.25s, z-index 0s, transform 0.25s ease;
}
a.portal:hover {
  z-index: 5;
}
a.portal:not(.portal--hub-satellite):not(.portal--hub-center):hover {
  transform: scale(1.04);
}
.world-hub .portal--hub-center:hover {
  transform: translate(-50%, -50%) scale(1.05);
}

/* Flag medallions — SVG discs with national ring colors */
.flag-medallion {
  width: min(56px, 14vw);
  height: min(56px, 14vw);
  border-radius: 50%;
  overflow: hidden;
  box-shadow:
    0 0 0 3px rgba(255, 255, 255, 0.12),
    0 0 24px var(--flag-glow, rgba(103, 232, 249, 0.35));
  flex-shrink: 0;
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}
.flag-medallion svg {
  width: 100%;
  height: 100%;
  display: block;
}
a.portal:hover .flag-medallion {
  transform: scale(1.08) rotate(-3deg);
  box-shadow:
    0 0 0 4px rgba(255, 255, 255, 0.2),
    0 0 36px var(--flag-glow, rgba(103, 232, 249, 0.55));
}
.portal--country-india { --flag-glow: rgba(255, 153, 51, 0.55); }
.portal--country-india .portal-ring {
  background: radial-gradient(circle, rgba(255, 153, 51, 0.35) 0%, rgba(19, 136, 8, 0.2) 50%, transparent 72%);
  box-shadow: 0 0 48px rgba(255, 153, 51, 0.25);
}
.portal--country-india .portal-core {
  background: linear-gradient(160deg, rgba(255, 153, 51, 0.22), rgba(15, 23, 42, 0.92) 45%, rgba(19, 136, 8, 0.18));
}
.portal--country-singapore { --flag-glow: rgba(239, 68, 68, 0.5); }
.portal--country-singapore .portal-ring {
  background: radial-gradient(circle, rgba(239, 68, 68, 0.38) 0%, transparent 68%);
}
.portal--country-singapore .portal-core {
  background: linear-gradient(160deg, rgba(239, 68, 68, 0.28), rgba(15, 23, 42, 0.9));
}
.portal--country-uk { --flag-glow: rgba(59, 130, 246, 0.5); }
.portal--country-uk .portal-ring {
  background: radial-gradient(circle, rgba(220, 38, 38, 0.28) 0%, rgba(29, 78, 216, 0.25) 45%, transparent 70%);
}
.portal--country-uk .portal-core {
  background: linear-gradient(145deg, rgba(29, 78, 216, 0.25), rgba(15, 23, 42, 0.9));
}
.portal--country-canada { --flag-glow: rgba(220, 38, 38, 0.45); }
.portal--country-canada .portal-ring {
  background: radial-gradient(circle, rgba(220, 38, 38, 0.32) 0%, transparent 68%);
}
.portal--country-canada .portal-core {
  background: linear-gradient(160deg, rgba(220, 38, 38, 0.22), rgba(15, 23, 42, 0.92));
}
.portal--country-usa { --flag-glow: rgba(59, 130, 246, 0.55); }
.portal--country-usa .portal-ring {
  background: radial-gradient(circle, rgba(220, 38, 38, 0.28) 0%, rgba(29, 78, 216, 0.32) 55%, transparent 72%);
}
.portal--country-usa .portal-core {
  background: linear-gradient(145deg, rgba(29, 78, 216, 0.28), rgba(15, 23, 42, 0.9));
}
.globe-medallion {
  width: min(64px, 15vw);
  height: min(64px, 15vw);
  --flag-glow: rgba(167, 139, 250, 0.6);
}

/* Country search */
.world-hub-search {
  max-width: 420px;
  margin: 0 auto 28px;
  position: relative;
  z-index: 20;
}
.world-hub-search-row {
  display: flex;
  gap: 0;
  border-radius: 999px;
  border: 1px solid rgba(103, 232, 249, 0.28);
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(10px);
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}
.world-hub-search-row:focus-within {
  border-color: rgba(103, 232, 249, 0.55);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.15), 0 8px 32px rgba(0, 0, 0, 0.3);
}
.world-hub-search-row input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 14px 18px;
  color: #f1f5f9;
  font: inherit;
  font-size: 0.95rem;
  min-width: 0;
}
.world-hub-search-row input::placeholder {
  color: #64748b;
}
.world-hub-search-row input:focus {
  outline: none;
}
.world-hub-search-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 20px;
  border: none;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.45), rgba(139, 92, 246, 0.45));
  color: #f8fafc;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.2s, transform 0.15s;
  white-space: nowrap;
}
.world-hub-search-btn:hover {
  filter: brightness(1.12);
}
.world-hub-search-btn:active {
  transform: scale(0.98);
}
.world-hub-search-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.world-hub-search-hint {
  text-align: center;
  font-size: 0.72rem;
  color: #64748b;
  margin-top: 10px;
}
#countrySearchResults {
  list-style: none;
  margin: 12px 0 0;
  padding: 8px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(12px);
  max-height: 280px;
  overflow-y: auto;
}
#countrySearchResults[hidden] {
  display: none;
}
#countrySearchResults .world-search-empty {
  padding: 12px 14px;
  font-size: 0.82rem;
  color: #94a3b8;
}
#countrySearchResults .world-search-result-item {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 12px 14px;
  margin: 0;
  border: none;
  border-radius: 12px;
  background: rgba(30, 41, 59, 0.6);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s;
}
#countrySearchResults .world-search-result-item:hover {
  background: rgba(51, 65, 85, 0.85);
}
#countrySearchResults .world-search-result-item .result-flag {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 0 16px var(--flag-glow, rgba(103, 232, 249, 0.3));
}
#countrySearchResults .world-search-result-item .result-flag svg {
  width: 100%;
  height: 100%;
  display: block;
}
#countrySearchResults .world-search-result-item .result-text strong {
  display: block;
  color: #f1f5f9;
  font-size: 0.9rem;
}
#countrySearchResults .world-search-result-item .result-text span {
  font-size: 0.72rem;
  color: #94a3b8;
}
#countrySearchResults li + li {
  margin-top: 6px;
}

/* Search filter states on orbit */
.world-hub--filtered .is-search-dim {
  opacity: 0.22;
  filter: grayscale(0.6) blur(1px);
  pointer-events: none;
}
.world-hub--filtered .is-search-match {
  opacity: 1;
  z-index: 6;
}
.world-hub--filtered .is-search-focus {
  animation: search-pulse 1.2s ease-in-out infinite;
}
@keyframes search-pulse {
  0%, 100% { filter: drop-shadow(0 0 12px var(--flag-glow, rgba(103, 232, 249, 0.4))); }
  50% { filter: drop-shadow(0 0 28px var(--flag-glow, rgba(103, 232, 249, 0.75))); }
}
.country-flag {
  font-size: 1.35rem;
  line-height: 1;
}
@media (max-width: 640px) {
  .world-hub-universe,
  .world-hub {
    width: min(100vw, 420px);
    height: min(100vw, 420px);
    margin-bottom: 20px;
  }
  .world-hub .portal--hub-satellite,
  .world-hub .portal--hub-satellite-india {
    width: min(96px, 20vmin);
    height: min(96px, 20vmin);
    margin-left: calc(min(48px, 10vmin) * -1);
    margin-top: calc(min(48px, 10vmin) * -1);
  }
  .world-hub .portal--hub-center {
    width: min(120px, 28vmin);
    height: min(120px, 28vmin);
  }
  .world-hub-search {
    max-width: 96vw;
  }
  .country-track-orbit {
    width: min(100vw, 360px);
    height: min(100vw, 360px);
  }
}

/* Country hub — track orbit + capabilities */
.country-hub-root {
  min-height: 100vh;
  position: relative;
  z-index: 1;
}
.country-hub-loading {
  min-height: 40vh;
}
.country-hub-main {
  max-width: 960px;
  margin: 0 auto;
}
.country-track-orbit {
  position: relative;
  width: min(520px, 92vw);
  height: min(520px, 92vw);
  margin: 24px auto 32px;
}
.country-track-orbit-ring {
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  border: 1px dashed rgba(103, 232, 249, 0.22);
  box-shadow: inset 0 0 48px rgba(6, 182, 212, 0.06);
  animation: portal-spin 90s linear infinite;
}
.country-track-orbit-core {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 2;
  text-align: center;
}
.country-track-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #e2e8f0;
  letter-spacing: 0.04em;
}
.country-track-arm {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  transform: rotate(var(--hub-angle, 0deg)) translate(min(200px, 38vw))
    rotate(calc(-1 * var(--hub-angle, 0deg)));
}
.portal--track-satellite {
  position: relative;
  width: min(140px, 28vw);
  height: min(140px, 28vw);
  margin-left: calc(min(70px, 14vw) * -1);
  margin-top: calc(min(70px, 14vw) * -1);
}
.country-capabilities {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  max-width: 720px;
  margin: 0 auto 24px;
  padding: 0 12px;
}
.country-capability {
  flex: 1 1 140px;
  max-width: 160px;
  padding: 14px 12px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.55);
  text-align: center;
  font-size: 0.72rem;
  color: #94a3b8;
  transition: border-color 0.25s, transform 0.25s;
}
.country-capability:hover {
  border-color: rgba(103, 232, 249, 0.35);
  transform: translateY(-2px);
}
.country-capability-icon {
  display: block;
  font-size: 1.35rem;
  margin-bottom: 6px;
}
.country-capability strong {
  display: block;
  color: #f1f5f9;
  font-size: 0.78rem;
  margin-bottom: 4px;
}
.country-service-grid {
  max-width: 880px;
}
.country-hub-note {
  text-align: center;
}
@media (prefers-reduced-motion: reduce) {
  .world-hub-orbit-track,
  .world-hub-orbit-arm .portal,
  .country-track-orbit-ring,
  .portal-orbit,
  .portal-ring {
    animation: none !important;
  }
}

/* Practice */
.practice-card {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 20px;
}
.practice-card label {
  display: block;
  margin: 10px 0 4px;
  font-size: 0.78rem;
  color: #94a3b8;
}
.practice-card select,
.practice-card input[type="number"] {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(2, 6, 23, 0.6);
  color: #e2e8f0;
}
.figure-note,
.figure-badge {
  font-size: 0.75rem;
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.08);
  border-left: 3px solid #fbbf24;
  padding: 8px 10px;
  border-radius: 0 8px 8px 0;
  margin: 8px 0;
}

/* Mock exam */
.mock-exam-page {
  background: #0f172a;
}
.mock-exam-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  background: rgba(2, 6, 23, 0.95);
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}
.mock-clock-wrap {
  text-align: center;
  flex: 1;
}
.mock-clock {
  font-family: ui-monospace, monospace;
  font-size: clamp(2rem, 6vw, 3.5rem);
  font-weight: 700;
  color: #6ee7b7;
  letter-spacing: 0.05em;
}
.mock-clock.urgent {
  color: #f87171;
  animation: mock-pulse 1s ease-in-out infinite;
}
@keyframes mock-pulse {
  50% { opacity: 0.75; }
}
.mock-clock-label {
  font-size: 0.72rem;
  color: #94a3b8;
}
.mock-integrity {
  display: flex;
  gap: 14px;
  font-size: 0.75rem;
  color: #94a3b8;
}
.mock-exam-main {
  max-width: 820px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}
.mock-paper-header {
  text-align: center;
  border-bottom: 2px double rgba(148, 163, 184, 0.35);
  padding-bottom: 16px;
  margin-bottom: 24px;
}
.mock-paper-header h1 {
  font-size: 1.15rem;
  color: #f1f5f9;
}
.mock-q-block {
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px dashed rgba(148, 163, 184, 0.15);
}
.mock-q-num {
  font-weight: 600;
  color: #cbd5e1;
}
.verified-tag {
  font-size: 0.65rem;
  color: #6ee7b7;
  font-weight: 500;
  margin-left: 8px;
}
.mock-q-prompt {
  margin: 10px 0;
  line-height: 1.55;
  color: #e2e8f0;
}
.mock-opt {
  display: block;
  padding: 8px 10px;
  margin: 4px 0;
  border-radius: 8px;
  cursor: pointer;
  color: #cbd5e1;
}
.mock-opt:hover {
  background: rgba(148, 163, 184, 0.08);
}

/* Forum */
.forum-main {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 20px;
  max-width: 1100px;
  align-items: start;
}
.forum-sidebar {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 16px;
  padding: 16px;
}
.sahadeva-card {
  text-align: center;
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}
.sahadeva-avatar {
  font-size: 2rem;
}
.sahadeva-card strong {
  display: block;
  color: #f1f5f9;
}
.sahadeva-card span {
  font-size: 0.72rem;
  color: #67e8f9;
}
.thread-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.thread-row {
  text-align: left;
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(15, 23, 42, 0.55);
  color: #e2e8f0;
  cursor: pointer;
}
.thread-row:hover {
  border-color: rgba(103, 232, 249, 0.35);
}
.thread-row strong {
  display: block;
  margin: 4px 0;
}
.thread-tag {
  font-size: 0.62rem;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
}
.thread-tag.science {
  background: rgba(52, 211, 153, 0.15);
  color: #6ee7b7;
}
.thread-tag.mathematics {
  background: rgba(96, 165, 250, 0.15);
  color: #93c5fd;
}
.tag-pred {
  display: inline-block;
  margin-top: 6px;
  font-size: 0.62rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(167, 139, 250, 0.2);
  color: #c4b5fd;
}
.thread-detail {
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 16px;
  padding: 20px;
}
.forum-post {
  padding: 14px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
}
.forum-post.sahadeva {
  background: rgba(167, 139, 250, 0.06);
  margin: 0 -12px;
  padding: 14px 12px;
  border-radius: 10px;
}
.post-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.post-head img {
  border-radius: 50%;
}
.disclaimer {
  font-size: 0.7rem;
  color: #fbbf24;
  font-style: italic;
  margin-top: 8px;
}
@media (max-width: 768px) {
  .forum-main {
    grid-template-columns: 1fr;
  }
}
