/* ==========================================================================
   Motion & Animation Vault - Category 6: Motion Physics & Easing Personalities
   Demos 36–40
   ========================================================================== */

/* --------------------------------------------------------------------------
   Common Container for Cat 6
   -------------------------------------------------------------------------- */
.cat6-demo-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 250px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: space-between;
  border-radius: 12px;
  background: radial-gradient(circle at 50% 30%, rgba(26, 32, 48, 0.5) 0%, rgba(11, 13, 18, 0.98) 100%);
  padding: 1.1rem;
  box-sizing: border-box;
  overflow: hidden;
}

.cat6-grid-layout {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 1rem;
  align-items: center;
  width: 100%;
}

@media (max-width: 520px) {
  .cat6-grid-layout {
    grid-template-columns: 1fr;
  }
}

/* --------------------------------------------------------------------------
   Inline SVG Curve Graph Visualizer
   -------------------------------------------------------------------------- */
.cat6-curve-box {
  background: #0f121a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 0.6rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.5);
}

.cat6-curve-svg {
  width: 100%;
  height: 95px;
  overflow: visible;
}

.cat6-grid-line {
  stroke: rgba(255, 255, 255, 0.07);
  stroke-width: 1;
}

.cat6-axis-line {
  stroke: rgba(255, 255, 255, 0.2);
  stroke-width: 1.5;
}

.cat6-curve-path {
  fill: none;
  stroke: #6366f1;
  stroke-width: 2.5;
  stroke-linecap: round;
  filter: drop-shadow(0 0 6px rgba(99, 102, 241, 0.6));
}

.cat6-handle-line {
  stroke: rgba(255, 255, 255, 0.25);
  stroke-width: 1;
  stroke-dasharray: 2 2;
}

.cat6-handle-point {
  fill: #38bdf8;
  stroke: #ffffff;
  stroke-width: 1.5;
}

.cat6-tracer-dot {
  fill: #ec4899;
  stroke: #ffffff;
  stroke-width: 2;
  filter: drop-shadow(0 0 8px #ec4899);
}

.cat6-formula-badge {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.68rem;
  color: #38bdf8;
  margin-top: 0.35rem;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* --------------------------------------------------------------------------
   Live Sliding Puck Track Raceway
   -------------------------------------------------------------------------- */
.cat6-track-container {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  width: 100%;
}

.cat6-track-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 600;
  color: #94a3b8;
}

.cat6-track-distance {
  color: #64748b;
  font-family: monospace;
}

.cat6-track-lane {
  position: relative;
  height: 28px;
  background: #0d1017;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9999px;
  display: flex;
  align-items: center;
  padding: 0 4px;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

/* Track tick marks */
.cat6-track-lane::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    90deg,
    transparent 0,
    transparent calc(25% - 1px),
    rgba(255, 255, 255, 0.08) calc(25% - 1px),
    rgba(255, 255, 255, 0.08) 25%
  );
  pointer-events: none;
}

/* Glowing Cyber Puck */
.cat6-puck {
  position: absolute;
  left: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffffff 0%, var(--puck-color, #6366f1) 60%, #312e81 100%);
  box-shadow: 0 0 12px var(--puck-glow, rgba(99, 102, 241, 0.8)), 0 2px 4px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  will-change: transform;
}

.cat6-puck::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: #ffffff;
  opacity: 0.8;
}

/* --------------------------------------------------------------------------
   Interactive UI Context Preview Box
   -------------------------------------------------------------------------- */
.cat6-ui-preview {
  margin-top: 0.75rem;
  background: #111420;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 0.5rem;
}

/* UI Preview Demo 36: Command Palette Popup */
.cat6-ui-palette {
  width: 85%;
  max-width: 240px;
  background: #1e2433;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #e2e8f0;
  font-size: 0.75rem;
  transform: translateY(20px) scale(0.92);
  opacity: 0;
  pointer-events: none;
}

.cat6-ui-palette.active {
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* UI Preview Demo 37: Spring Reaction Pill */
.cat6-ui-spring-pill {
  background: linear-gradient(135deg, #ec4899 0%, #f43f5e 100%);
  color: #ffffff;
  border-radius: 9999px;
  padding: 0.4rem 0.9rem;
  font-size: 0.78rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  box-shadow: 0 6px 16px rgba(244, 63, 94, 0.4);
  transform: scale(0);
  opacity: 0;
}

.cat6-ui-spring-pill.active {
  transform: scale(1);
  opacity: 1;
}

/* UI Preview Demo 38: Luxury Editorial Card */
.cat6-ui-luxury-modal {
  width: 90%;
  max-width: 250px;
  background: #161922;
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 6px;
  padding: 0.6rem 0.8rem;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6);
  transform: translateY(30px);
  opacity: 0;
  color: #f1f5f9;
}

.cat6-ui-luxury-modal.active {
  transform: translateY(0);
  opacity: 1;
}

.cat6-luxury-title {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: #e2d9b8;
  margin: 0 0 0.2rem 0;
}

.cat6-luxury-text {
  font-size: 0.7rem;
  color: #94a3b8;
  margin: 0;
}

/* UI Preview Demo 39: Mechanical Telemetry Gauge */
.cat6-ui-telemetry {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 90%;
  justify-content: center;
}

.cat6-telemetry-dial {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid #06b6d4;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cat6-dial-needle {
  position: absolute;
  width: 2px;
  height: 16px;
  background: #ef4444;
  bottom: 50%;
  left: calc(50% - 1px);
  transform-origin: bottom center;
  transform: rotate(0deg);
}

.cat6-telemetry-tape {
  font-family: ui-monospace, monospace;
  font-size: 0.72rem;
  color: #38bdf8;
  background: rgba(6, 182, 212, 0.1);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  border: 1px solid rgba(6, 182, 212, 0.3);
}

/* UI Preview Demo 40: 8-Bit Retro Stepped Text */
.cat6-ui-retro-box {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.75rem;
  color: #22c55e;
  background: #051608;
  border: 1px solid #16a34a;
  padding: 0.4rem 0.6rem;
  border-radius: 4px;
  width: 90%;
  text-shadow: 0 0 6px rgba(34, 197, 94, 0.6);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cat6-retro-meter {
  display: flex;
  gap: 2px;
}

.cat6-meter-bar {
  width: 6px;
  height: 12px;
  background: rgba(34, 197, 94, 0.2);
  transition: background 0.1s;
}

.cat6-meter-bar.active {
  background: #22c55e;
  box-shadow: 0 0 4px #22c55e;
}

/* --------------------------------------------------------------------------
   Cat 6 Controls Bar
   -------------------------------------------------------------------------- */
.cat6-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.75rem;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.cat6-btn-group {
  display: flex;
  gap: 0.35rem;
}

.cat6-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.cat6-btn:hover {
  background: rgba(99, 102, 241, 0.25);
  border-color: rgba(99, 102, 241, 0.5);
  color: #ffffff;
}

.cat6-btn-accent {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  border-color: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
}

.cat6-btn-accent:hover {
  background: linear-gradient(135deg, #4338ca 0%, #6d28d9 100%);
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.5);
}

/* --------------------------------------------------------------------------
   "RACE ALL 5" Raceway Overlay / Panel
   -------------------------------------------------------------------------- */
.cat6-raceway-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 7, 12, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  box-sizing: border-box;
  animation: cat6-fadein 0.25s ease-out;
}

@keyframes cat6-fadein {
  from { opacity: 0; }
  to { opacity: 1; }
}

.cat6-raceway-panel {
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
  background: #111420;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.7), 0 0 32px rgba(99, 102, 241, 0.2);
  padding: 1.5rem;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.cat6-raceway-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.cat6-raceway-title {
  color: #f8fafc;
  font-size: 1.25rem;
  font-weight: 800;
  margin: 0 0 0.25rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cat6-raceway-subtitle {
  color: #94a3b8;
  font-size: 0.82rem;
  margin: 0;
}

.cat6-raceway-close-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 0.35rem;
  border-radius: 6px;
  transition: all 0.2s;
}

.cat6-raceway-close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

/* 5 Track Stack */
.cat6-raceway-tracks {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: #090b10;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 1rem;
}

.cat6-race-lane-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.cat6-race-lane-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
}

.cat6-race-lane-name {
  font-weight: 700;
  color: #e2e8f0;
}

.cat6-race-lane-badge {
  font-family: monospace;
  font-size: 0.68rem;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: #38bdf8;
}

.cat6-race-lane-rank {
  font-size: 0.72rem;
  font-weight: 800;
  color: #fbbf24;
  opacity: 0;
  transition: opacity 0.2s;
}

.cat6-race-lane-rank.visible {
  opacity: 1;
}

.cat6-race-lane-track {
  position: relative;
  height: 22px;
  background: #141722;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  display: flex;
  align-items: center;
  padding: 0 3px;
  overflow: hidden;
}

.cat6-race-lane-track::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(239, 68, 68, 0.6);
  box-shadow: 0 0 6px #ef4444;
}

.cat6-race-puck {
  position: absolute;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  will-change: transform;
}

.cat6-raceway-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
