/* Modular 3D Holographic Study Engine Showcase (60 FPS GPU-composited) */
.sc3d-shell {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sc3d-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.sc3d-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.sc3d-tab {
  flex-shrink: 0;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #94A3B8;
  border-radius: 9px;
  padding: 7px 13px;
  min-height: 40px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

.sc3d-tab:hover {
  color: #F8FAFC;
  border-color: rgba(56, 189, 248, 0.35);
}

.sc3d-tab.active {
  background: rgba(56, 189, 248, 0.16);
  border-color: rgba(56, 189, 248, 0.5);
  color: #F8FAFC;
  box-shadow: 0 0 18px -6px rgba(56, 189, 248, 0.55);
}

.sc3d-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.sc3d-stage {
  position: relative;
  width: 100%;
  min-height: 430px;
  perspective: 1400px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 26px 14px 34px 14px;
  overflow: hidden;
  border-radius: 12px;
  background:
    radial-gradient(circle at 50% 45%, rgba(56, 189, 248, 0.14), transparent 62%),
    radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    #05070B;
  background-size: 100% 100%, 22px 22px, 100% 100%;
  cursor: grab;
  user-select: none;
  touch-action: pan-y;
}

.sc3d-stage:active {
  cursor: grabbing;
}

.sc3d-stack {
  position: relative;
  width: 100%;
  max-width: 560px;
  min-height: 330px;
  transform-style: preserve-3d;
  will-change: transform;
  transition: transform 90ms linear;
}

.sc3d-stack.idle-float {
  transform: rotateX(4deg) rotateY(-5deg);
  transition: transform 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes sc3dIdle {
  0%, 100% { transform: rotateX(7deg) rotateY(-8deg) translateY(0px); }
  50% { transform: rotateX(11deg) rotateY(8deg) translateY(-6px); }
}

.sc3d-layer {
  position: relative;
  width: 100%;
  border-radius: 14px;
  transform-style: preserve-3d;
  transition: transform 420ms cubic-bezier(0.22, 1, 0.36, 1), opacity 300ms ease;
}

/* Back Layer: Video & Transcript Core */
.sc3d-layer-back {
  position: absolute;
  inset: 14px -10px -14px 10px;
  background: rgba(13, 17, 26, 0.86);
  border: 1px solid rgba(56, 189, 248, 0.25);
  padding: 14px 18px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.85);
  transform: translateZ(-44px);
  pointer-events: none;
}

/* Middle Layer: AI + KaTeX Engine */
.sc3d-layer-mid {
  position: absolute;
  inset: 7px -5px -7px 5px;
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.94), rgba(7, 9, 14, 0.96));
  border: 1px solid rgba(56, 189, 248, 0.38);
  padding: 14px 18px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  box-shadow: 0 20px 40px -12px rgba(2, 132, 199, 0.25);
  transform: translateZ(-16px);
  pointer-events: none;
}

/* Front Layer: Print-Ready A4 Question Card */
.sc3d-layer-front {
  position: relative;
  background: #FFFFFF;
  color: #0F172A;
  border: 1px solid #E2E8F0;
  border-top: 4px solid #0284C7;
  padding: 18px 20px;
  box-shadow:
    0 32px 64px -16px rgba(0, 0, 0, 0.9),
    0 0 36px -10px rgba(56, 189, 248, 0.35);
  transform: translateZ(28px);
}

.sc3d-exploded .sc3d-layer-back {
  transform: translateZ(-78px) translateX(-18px) translateY(22px);
}

.sc3d-exploded .sc3d-layer-mid {
  transform: translateZ(-10px) translateX(0px) translateY(8px);
}

.sc3d-exploded .sc3d-layer-front {
  transform: translateZ(64px) translateX(14px) translateY(-10px);
}

/* 3D Flip Animation on Subject Switch */
.sc3d-stack.flip-pulse .sc3d-layer-front {
  animation: sc3dCardFlip 460ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes sc3dCardFlip {
  0% { transform: translateZ(28px) rotateY(0deg) scale(1); opacity: 1; }
  45% { transform: translateZ(56px) rotateY(14deg) scale(0.97); opacity: 0.72; }
  100% { transform: translateZ(28px) rotateY(0deg) scale(1); opacity: 1; }
}

/* Floating 3D Holo Glyphs */
.sc3d-holo {
  position: absolute;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(13, 17, 26, 0.9);
  border: 1px solid rgba(56, 189, 248, 0.5);
  color: #38BDF8;
  font-family: "JetBrains Mono", monospace;
  font-weight: 700;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 22px -4px rgba(56, 189, 248, 0.55);
  transform: translateZ(72px);
  pointer-events: none;
  animation: sc3dOrbit 4.8s ease-in-out infinite;
}

.sc3d-holo-1 { top: -16px; right: 14px; animation-delay: 0s; }
.sc3d-holo-2 { bottom: -14px; left: 16px; animation-delay: 1.5s; }
.sc3d-holo-3 { top: 44%; right: -18px; width: 34px; height: 34px; font-size: 14px; animation-delay: 2.6s; }

@keyframes sc3dOrbit {
  0%, 100% { transform: translateZ(72px) translateY(0px) rotate(0deg); }
  50% { transform: translateZ(88px) translateY(-8px) rotate(6deg); }
}

.sc3d-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid #E2E8F0;
  padding-bottom: 9px;
  margin-bottom: 12px;
}

.sc3d-badge {
  background: #0F172A;
  color: #38BDF8;
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 5px;
}

.sc3d-stem {
  font-size: 13.5px;
  line-height: 1.55;
  color: #0F172A;
  margin-bottom: 12px;
}

.sc3d-opts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.sc3d-opt {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 12px;
  color: #1E293B;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  min-height: 40px;
  transition: border-color 140ms ease, background 140ms ease;
}

.sc3d-opt:hover {
  border-color: #38BDF8;
}

.sc3d-opt.ans {
  background: rgba(16, 185, 129, 0.14);
  border-color: #10B981;
  font-weight: 700;
  color: #065F46;
}

.sc3d-opt.wrong-opt {
  background: rgba(245, 158, 11, 0.14);
  border-color: #F59E0B;
  color: #92400E;
}

.sc3d-card-foot {
  margin-top: 12px;
  padding-top: 9px;
  border-top: 1px dashed #CBD5E1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px;
  color: #475569;
  flex-wrap: wrap;
  gap: 6px;
}

.sc3d-hint {
  text-align: center;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: #94A3B8;
}

@media (max-width: 767px) {
  .sc3d-stage {
    min-height: 360px;
    padding: 20px 10px 26px 10px;
  }
  .sc3d-layer-back { inset: 10px -4px -10px 4px; }
  .sc3d-layer-mid { inset: 5px -2px -5px 2px; }
  .sc3d-layer-front { padding: 14px 14px; }
  .sc3d-opts { grid-template-columns: 1fr; }
  .sc3d-holo-3 { display: none; }
}
