/* Visualizer workspace layout */
.visualizer-page {
  font-family: 'Inter', 'Poppins', sans-serif;
  color: var(--text-color);
  padding-left: 15px;
}

.visualizer-hero {
  background: linear-gradient(135deg, #0f172a, #1d2b53);
  border-radius: 1.5rem;
  color: #f8fafc;
  position: relative;
  overflow: hidden;
  padding: 1.75rem;
}

.visualizer-hero__decor {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.visualizer-hero__decor::before,
.visualizer-hero__decor::after {
  content: "";
  position: absolute;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.45;
}

.visualizer-hero__decor::before {
  background: radial-gradient(circle, rgba(59, 130, 246, 0.9), transparent 70%);
  top: -80px;
  right: -40px;
}

.visualizer-hero__decor::after {
  background: radial-gradient(circle, rgba(236, 72, 153, 0.8), transparent 70%);
  bottom: -120px;
  left: -60px;
}

.visualizer-hero__heading {
  font-weight: 600;
  letter-spacing: 0.02em;
}

.visualizer-hero__subtext {
  color: rgba(255, 255, 255, 0.65);
}

.visualizer-hero .hero-actions .btn {
  border-radius: 999px;
}

.hero-actions__run {
  box-shadow: 0 12px 24px rgba(59, 130, 246, 0.35);
}

.hero-actions__back {
  border-color: rgba(255, 255, 255, 0.3);
  color: #e2e8f0;
}

.visualizer-hero__badge {
  background: rgba(15, 23, 42, 0.35);
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 999px;
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.visualizer-hero__pulse {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.7);
}

.pulse-dot {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: #22c55e;
  position: relative;
  display: inline-block;
}

.pulse-dot::after {
  content: "";
  position: absolute;
  inset: -0.2rem;
  border-radius: 50%;
  border: 1px solid rgba(34, 197, 94, 0.6);
  animation: heroPulse 1.8s infinite;
}

@keyframes heroPulse {
  0% {
    transform: scale(0.8);
    opacity: 0.9;
  }
  100% {
    transform: scale(1.6);
    opacity: 0;
  }
}

.hero-stats {
  margin-top: 0.5rem;
}

.hero-stat-chip {
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 0.85rem;
  padding: 0.65rem 1rem;
  min-width: 140px;
}

.hero-stat-label {
  display: block;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.65);
  text-transform: uppercase;
}

.hero-stat-value {
  font-size: 0.95rem;
  font-weight: 600;
}

.glass-card.card {
  background: rgba(10, 16, 30, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 1.25rem;
  color: #e2e8f0;
}

.glass-card .card-header {
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
  background: rgba(10, 16, 30, 0.95);
  padding: 1rem 1.25rem;
}

.glass-card .card-body {
  background: rgba(15, 23, 42, 0.85);
  padding: 1.25rem;
}

.code-scroll {
  background: #020617;
  border-radius: 1rem;
  max-height: 440px;
  overflow: auto;
  padding: 1rem;
}

.code-scroll--embedded {
  padding: 0;
  overflow: hidden;
}

.code-scroll--compact {
  max-height: 260px;
}

.console-output {
  color: #f8fafc !important;
}

.code-line {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.9rem;
  padding: 0.15rem 0.5rem;
  border-radius: 0.35rem;
  color: #94a3b8;
  white-space: pre-wrap;
}

.code-line--active {
  background: linear-gradient(90deg, rgba(34, 197, 94, 0.35), rgba(34, 197, 94, 0.15));
  color: #e2fbed;
  border-left: 4px solid #22c55e;
  font-weight: 600;
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.35);
}

.code-mirror-shell {
  min-height: 420px;
}

.code-mirror-shell .CodeMirror {
  height: 420px;
  background: transparent;
  color: #e2e8f0;
  font-size: 0.95rem;
}

.code-mirror-shell .CodeMirror-gutters {
  background: #050b1c;
  border-right: 1px solid rgba(148, 163, 184, 0.25);
}

.code-mirror-shell .CodeMirror-gutter {
  background: #050b1c !important;
  color: #ffffff;
}

.code-mirror-shell .CodeMirror-gutter,
.code-mirror-shell .CodeMirror-linenumbers,
.code-mirror-shell .CodeMirror-linenumber,
.code-mirror-shell .CodeMirror-gutter-elt {
  color: #ffffff;
  font-weight: 600;
}

.code-mirror-shell .CodeMirror-foldgutter-open,
.code-mirror-shell .CodeMirror-foldgutter-folded {
  color: #94a3b8;
}

.CodeMirror.cm-s-default,
.CodeMirror.cm-s-dracula {
  background: transparent;
}

.cm-trace-active {
  background: linear-gradient(90deg, rgba(34, 197, 94, 0.4), rgba(34, 197, 94, 0.12)) !important;
  box-shadow: inset 0 0 12px rgba(34, 197, 94, 0.35);
}

.code-scroll pre {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.92rem;
  color: #e2e8f0;
}

.stat-chip {
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 0.85rem;
  padding: 0.85rem;
  min-height: 84px;
}

.variable-scroll {
  max-height: 340px;
  overflow: auto;
}

.row-changed {
  background: rgba(59, 130, 246, 0.12) !important;
}

.stdout-delta {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
  border-radius: 0.75rem;
  padding: 0.55rem 0.9rem;
  font-size: 0.85rem;
  margin-top: 0.75rem;
  display: none;
}

.stdout-delta.active {
  display: block;
}

.callstack-list {
  list-style: none;
  padding-left: 0;
  margin-bottom: 0;
}

.callstack-list li {
  border-left: 2px solid rgba(148, 163, 184, 0.4);
  padding-left: 0.75rem;
  margin-bottom: 0.65rem;
}

#calcBreakdownOutput {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.92rem;
  line-height: 1.5;
  color: #e2e8f0;
}

#calcBreakdownOutput .calc-text {
  white-space: pre-wrap;
}

#calcBreakdownOutput code,
#calcBreakdownOutput .calc-inline {
  background: rgba(15, 23, 42, 0.6);
  padding: 0.15rem 0.35rem;
  border-radius: 0.35rem;
  color: #93c5fd;
  display: inline-block;
  margin-bottom: 0.15rem;
}

#calcBreakdownOutput strong {
  color: #f8fafc;
}

.breakdown-entry {
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 1rem;
  padding: 1rem;
}

.breakdown-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  margin-bottom: 0.5rem;
}

.breakdown-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.4);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8rem;
  color: #bfdbfe;
  text-transform: none;
}

.breakdown-code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.9rem;
  color: #f8fafc;
  background: rgba(2, 6, 23, 0.7);
  padding: 0.45rem 0.65rem;
  border-radius: 0.65rem;
  margin-bottom: 0.75rem;
}

.breakdown-preview {
  font-size: 0.9rem;
  color: #e2e8f0;
  margin-bottom: 0.5rem;
}

.breakdown-details summary {
  color: #93c5fd;
  cursor: pointer;
  font-weight: 600;
}

.breakdown-details summary::marker {
  color: #93c5fd;
}

.breakdown-details > div {
  margin-top: 0.5rem;
}

.breakdown-context {
  font-size: 0.85rem;
  color: #94a3b8;
  margin-bottom: 0.5rem;
}

.timeline-nav .btn {
  min-width: 3.5rem;
  padding: 0.85rem 1rem;
  font-size: 1.2rem;
  font-weight: 600;
  border-radius: 0.85rem;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.4);
}

.diff-before {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
}

.diff-after {
  background: rgba(34, 197, 94, 0.18);
  color: #bbf7d0;
}

@media (max-width: 991.98px) {
  .code-scroll {
    max-height: 320px;
  }
}


/* ==========================================
   Variable Tracking Card Styles
   ========================================== */

.variable-tracking-scroll {
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.3) transparent;
}

.variable-tracking-scroll::-webkit-scrollbar {
  width: 6px;
}

.variable-tracking-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.variable-tracking-scroll::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.3);
  border-radius: 3px;
}

.variable-tracking-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.5);
}

#variableTrackingTable {
  font-size: 0.95rem;
}

#variableTrackingTable thead th {
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  padding: 0.75rem 0.6rem;
  color: #94a3b8;
}

#variableTrackingTable tbody tr {
  transition: all 0.2s ease;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

#variableTrackingTable tbody tr:hover {
  background: rgba(59, 130, 246, 0.08) !important;
}

#variableTrackingTable tbody td {
  padding: 0.7rem 0.6rem;
  vertical-align: middle;
  font-size: 0.95rem;
}

.var-tracking-active {
  background: linear-gradient(90deg, rgba(34, 197, 94, 0.2), rgba(34, 197, 94, 0.05)) !important;
  border-left: 3px solid #22c55e !important;
  animation: varHighlight 0.5s ease;
}

.var-changed-highlight {
  background: linear-gradient(90deg, rgba(251, 191, 36, 0.25), rgba(251, 191, 36, 0.08)) !important;
  border-left: 3px solid #fbbf24 !important;
  animation: varChangedPulse 0.6s ease;
}

@keyframes varChangedPulse {
  0% {
    background: rgba(251, 191, 36, 0.4);
  }
  100% {
    background: rgba(251, 191, 36, 0.25);
  }
}

@keyframes varHighlight {
  0% {
    background: rgba(34, 197, 94, 0.4);
  }
  100% {
    background: rgba(34, 197, 94, 0.2);
  }
}

.var-before code,
.var-initial code {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  padding: 0.3rem 0.55rem;
  border-radius: 0.4rem;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.9rem;
  font-weight: 500;
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.var-after code,
.var-current code {
  background: rgba(34, 197, 94, 0.18);
  color: #bbf7d0;
  padding: 0.3rem 0.55rem;
  border-radius: 0.4rem;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.9rem;
  font-weight: 500;
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.variable-tracking-controls .btn-group .btn {
  font-size: 0.9rem;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-weight: 500;
}

.variable-tracking-controls .btn-group .btn.active {
  background: rgba(59, 130, 246, 0.25);
  border-color: rgba(59, 130, 246, 0.5);
  color: #93c5fd;
}

/* ==========================================
   Inspector Tabs Styles
   ========================================== */

#inspectorTabs {
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.5);
  padding: 0.25rem 0.5rem 0;
}

#inspectorTabs .nav-link {
  color: #94a3b8;
  border: none;
  border-radius: 0.5rem 0.5rem 0 0;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  font-weight: 600;
  transition: all 0.2s ease;
  margin-right: 0.25rem;
}

#inspectorTabs .nav-link:hover {
  color: #e2e8f0;
  background: rgba(59, 130, 246, 0.1);
}

#inspectorTabs .nav-link.active {
  color: #f8fafc;
  background: rgba(59, 130, 246, 0.2);
  border-bottom: 2px solid #3b82f6;
}

#inspectorTabs .nav-link i {
  font-size: 0.9rem;
}

#inspectorTabContent {
  min-height: 450px;
  height: 450px;
  overflow: hidden;
}

#inspectorTabContent .tab-pane {
  animation: fadeInTab 0.2s ease;
  height: 100%;
  overflow-y: auto;
}

@keyframes fadeInTab {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Compact variable tracking for tabs */
#trackingPane .variable-tracking-controls .btn {
  font-size: 0.85rem;
  padding: 0.45rem 0.75rem;
  font-weight: 500;
}

#trackingPane #variableTrackingTable {
  font-size: 0.95rem;
}

#trackingPane #variableTrackingTable th {
  font-size: 0.85rem;
  padding: 0.6rem 0.5rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

#trackingPane #variableTrackingTable td {
  padding: 0.65rem 0.5rem;
  font-size: 0.95rem;
}

#trackingPane #variableTrackingTable .badge {
  font-size: 0.75rem;
  padding: 0.3rem 0.5rem;
  font-weight: 600;
}

#trackingPane #variableTrackingTable code {
  font-size: 0.9rem;
  padding: 0.25rem 0.5rem;
}

#trackingPane .var-timeline-row {
  margin-bottom: 0.5rem;
}

#trackingPane .var-timeline-label {
  width: 70px;
  font-size: 0.85rem;
  font-weight: 500;
}

#trackingPane .var-timeline-track {
  height: 22px;
}

#trackingPane .var-timeline-dot {
  width: 12px;
  height: 12px;
}

#variableTimeline p {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
}


/* ==========================================
   Improved Inspector Card Styles
   ========================================== */

/* Changes Tab - Improved Table */
.changes-table {
  border-collapse: separate;
  border-spacing: 0;
}

.changes-table thead th {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.6rem 0.5rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.changes-table tbody tr {
  transition: all 0.15s ease;
}

.changes-table tbody tr:hover {
  background: rgba(59, 130, 246, 0.08);
}

.changes-table td {
  padding: 0.5rem;
  vertical-align: middle;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
}

.changes-table code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.85rem;
  padding: 0.2rem 0.4rem;
  border-radius: 0.25rem;
}

.changes-table .diff-before code {
  background: rgba(239, 68, 68, 0.12);
}

.changes-table .diff-after code {
  background: rgba(34, 197, 94, 0.12);
}

/* Empty State Styling */
.empty-state {
  color: #94a3b8;
}

.empty-state i {
  opacity: 0.6;
}

/* Text color utilities */
.text-purple {
  color: #a78bfa;
}

/* Improved Tab Content */
#inspectorTabContent {
  min-height: 400px;
  max-height: 450px;
  overflow: hidden;
}

#inspectorTabContent .tab-pane {
  height: 100%;
  overflow-y: auto;
}

/* Breakdown Entry Improvements */
.breakdown-entry {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 0.75rem;
  padding: 1rem;
  margin: 0.5rem;
}

.breakdown-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: #94a3b8;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.breakdown-pill {
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.7rem;
  color: #93c5fd;
  font-weight: 500;
}

.breakdown-code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.9rem;
  color: #f8fafc;
  background: rgba(2, 6, 23, 0.5);
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  margin-bottom: 0.75rem;
  border-left: 3px solid #3b82f6;
}

.breakdown-context {
  font-size: 0.8rem;
  color: #94a3b8;
  margin-bottom: 0.5rem;
}

.breakdown-preview {
  font-size: 0.85rem;
  color: #22c55e;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.breakdown-details {
  margin-top: 0.5rem;
}

.breakdown-details summary {
  color: #93c5fd;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.25rem 0;
}

.breakdown-details summary:hover {
  color: #bfdbfe;
}

.breakdown-body {
  margin-top: 0.5rem;
  padding: 0.75rem;
  background: rgba(2, 6, 23, 0.4);
  border-radius: 0.5rem;
  font-size: 0.85rem;
}

.breakdown-body .calc-text {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  line-height: 1.6;
  white-space: pre-wrap;
}

/* Variable Tracking Improvements */
#variableTrackingTable {
  font-size: 0.9rem;
}

#variableTrackingTable thead th {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.5rem 0.4rem;
  color: #64748b;
}

#variableTrackingTable tbody td {
  padding: 0.4rem;
  font-size: 0.85rem;
}

#variableTrackingTable code {
  font-size: 0.8rem;
  padding: 0.15rem 0.35rem;
}

.var-tracking-active {
  background: linear-gradient(90deg, rgba(34, 197, 94, 0.15), rgba(34, 197, 94, 0.05)) !important;
  border-left: 2px solid #22c55e !important;
}

/* Timeline Improvements */
.var-timeline-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.var-timeline-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.var-timeline-label {
  width: 65px;
  font-size: 0.75rem;
  color: #94a3b8;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-weight: 500;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.var-timeline-track {
  flex: 1;
  height: 20px;
  background: rgba(148, 163, 184, 0.08);
  border-radius: 10px;
  position: relative;
}

.var-timeline-dot {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 0 0 2px rgba(10, 16, 30, 0.9);
}

.var-timeline-dot:hover {
  transform: translate(-50%, -50%) scale(1.3);
  z-index: 10;
}

.var-timeline-dot.active {
  transform: translate(-50%, -50%) scale(1.4);
  box-shadow: 0 0 0 2px rgba(10, 16, 30, 0.9), 0 0 10px currentColor;
  z-index: 10;
}

/* Filter Buttons */
.variable-tracking-controls .btn-group .btn {
  font-size: 0.75rem;
  padding: 0.35rem 0.6rem;
  font-weight: 500;
  border-color: rgba(148, 163, 184, 0.25);
}

.variable-tracking-controls .btn-group .btn:hover {
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.3);
}

.variable-tracking-controls .btn-group .btn.active {
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(59, 130, 246, 0.4);
  color: #93c5fd;
}

/* ==========================================
   Practice Workspace: Hints & Mentor Styling
   ========================================== */

.practice-hint-btn {
  border-radius: 0.75rem;
  border-color: rgba(148, 163, 184, 0.6);
  color: #e2e8f0;
  font-weight: 500;
  font-size: 0.9rem;
  padding: 0.55rem 0.85rem;
  background: rgba(15, 23, 42, 0.6);
}

.practice-hint-btn:hover,
.practice-hint-btn:focus {
  background: rgba(59, 130, 246, 0.16);
  border-color: rgba(59, 130, 246, 0.7);
  color: #e0f2fe;
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.6);
}

.practice-hint-card {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 0.9rem;
  padding: 0.9rem 1rem;
}

.practice-mentor-card {
  background: radial-gradient(circle at top left, rgba(59, 130, 246, 0.18), transparent 55%),
              rgba(15, 23, 42, 0.95);
  border-radius: 1rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  padding: 1rem 1.15rem;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.85);
}

.practice-mentor-card ul {
  padding-left: 1.1rem;
}

.practice-mentor-card li::marker {
  color: #38bdf8;
}
