/* Python IDE Styles - Simple Two Column Layout */

/* Reset and Base */
* {
  box-sizing: border-box;
}

.ide-page {
  font-family: 'Fira Code', monospace;
  margin: 0;
  padding: 0;
  background-color: #1e1e1e;
  color: #ffffff;
  height: 100vh;
  overflow: hidden;
}

/* IDE Container */
.ide-container {
  height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.ide-header {
  background-color: #2d2d30;
  padding: 1rem 2rem;
  border-bottom: 1px solid #3e3e42;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-left h1 {
  margin: 0;
  font-size: 1.5rem;
  color: #ffffff;
  font-weight: 600;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.breadcrumb {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: #cccccc;
}

.breadcrumb a {
  color: #569cd6;
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

/* Main Layout */
.ide-main {
  flex: 1;
  display: grid;
  grid-template-columns: 300px 1fr 8px 1fr; /* Sidebar, Editor, Vertical Handle, Right Panel */
  gap: 0;
  height: calc(100vh - 80px);
}

.ide-main.sidebar-collapsed {
  grid-template-columns: 40px 1fr 8px 1fr;
}

/* Lessons Sidebar */
.lessons-sidebar {
  background-color: #252526;
  border-right: 1px solid #3e3e42;
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
  max-height: 100%;
  overflow: hidden;
}

.lessons-sidebar.collapsed {
  width: 40px;
}

.sidebar-header {
  background-color: #2d2d30;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #3e3e42;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sidebar-header h3 {
  margin: 0;
  font-size: 0.9rem;
  color: #ffffff;
  font-weight: 600;
}

.lessons-sidebar.collapsed .sidebar-header h3 {
  display: none;
}

.lessons-sidebar.collapsed #toggleSidebar {
  transform: rotate(180deg);
}

.lessons-container {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.5rem 0;
  min-height: 0; /* This forces the flex item to shrink below its content size */
}

.lesson-item {
  margin-bottom: 0.75rem; /* Increased spacing */
  border-radius: 6px;
  overflow: hidden;
  background-color: #2d2d30;
  margin: 0 0.5rem 0.75rem 0.5rem; /* Increased bottom margin */
  transition: all 0.2s ease;
}

.lesson-item:hover {
  background-color: #3e3e42;
}

.lesson-item.active {
  background-color: #0e639c;
  border-left: 3px solid #1177bb;
}

.lesson-item.completed {
  border-left: 3px solid #16825d;
}

.lesson-item.completed .lesson-header::after {
  content: "✓";
  color: #16825d;
  font-weight: bold;
  margin-left: auto;
}

.lesson-header {
  padding: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  user-select: none;
}

.lesson-number {
  background-color: #0e639c;
  color: #ffffff;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: bold;
  min-width: 2rem;
  text-align: center;
  transition: background-color 0.2s ease;
}

/* Orange when lesson is expanded (not collapsed) */
.lesson-item:not(.collapsed) .lesson-header .lesson-number {
  background-color: #ff8c00 !important;
}

/* Purple when lesson is loaded */
.lesson-item.loaded .lesson-header .lesson-number {
  background-color: #8a2be2 !important;
}

/* Green when lesson challenge is active */
.lesson-item.active .lesson-header .lesson-number {
  background-color: #16825d !important;
}

.lesson-title {
  flex: 1;
  font-size: 0.85rem;
  font-weight: 500;
  color: #ffffff;
}

.lesson-toggle {
  color: #cccccc;
  font-size: 0.8rem;
  transition: transform 0.2s ease;
}

.lesson-item.collapsed .lesson-toggle {
  transform: rotate(-90deg);
}

.lesson-content {
  padding: 0.75rem 0.75rem 1rem 0.75rem; /* Increased bottom padding */
  display: block;
  animation: slideDown 0.3s ease;
}

.lesson-item.collapsed .lesson-content {
  display: none;
}

.lesson-content p {
  margin: 0 0 1rem 0; /* Increased margin */
  font-size: 0.8rem;
  color: #cccccc;
  line-height: 1.4;
}

.lesson-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.5rem; /* Add some top margin */
}

.lesson-load-btn, .lesson-challenge-btn {
  padding: 0.5rem 0.75rem; /* Increased padding */
  background-color: #0e639c;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
  flex: 1;
  min-width: 80px;
}

.lesson-challenge-btn {
  background-color: #16825d;
}

.lesson-load-btn:hover {
  background-color: #1177bb;
}

.lesson-challenge-btn:hover {
  background-color: #1a9969;
}

@keyframes slideDown {
  from {
    opacity: 0;
    max-height: 0;
  }
  to {
    opacity: 1;
    max-height: 200px;
  }
}

/* Collapsed sidebar styles */
.lessons-sidebar.collapsed .lesson-item {
  margin: 0.25rem;
}

.lessons-sidebar.collapsed .lesson-header {
  padding: 0.5rem;
  justify-content: center;
}

.lessons-sidebar.collapsed .lesson-title,
.lessons-sidebar.collapsed .lesson-toggle,
.lessons-sidebar.collapsed .lesson-content {
  display: none;
}

/* Panel Styles */
.editor-panel {
  background-color: #1e1e1e;
  border-right: 1px solid #3e3e42;
  display: flex;
  flex-direction: column;
  min-height: 0; /* Allow shrinking */
  height: 100%; /* Ensure full height usage */
}

.right-panel {
  background-color: #1e1e1e;
  display: flex;
  flex-direction: column;
}

.output-panel,
.execution-panel {
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid #3e3e42;
  min-height: 0; /* Important for flex children to shrink */
  overflow: hidden; /* Prevent panel overflow, but let container scroll */
}

.output-panel {
  flex: 2 1 66.7%; /* Default to 2/3 of space but allow grow/shrink */
  min-height: 200px; /* Increased minimum height for better usability */
  max-height: calc(66vh - 100px); /* Adjusted max height for new proportion */
}

/* 80s CRT Monitor styling for output panel header */
.output-panel .panel-header {
  background: linear-gradient(180deg, #003300, #001100);
  border-bottom: 2px solid #00ff00;
  box-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
}

.output-panel .panel-title {
  color: #00cc00;
  text-shadow: 0 0 1px #00cc00;
  font-family: 'Courier New', 'Fira Code', monospace;
  font-weight: bold;
  letter-spacing: 1px;
}

.output-panel .btn {
  background: rgba(0, 204, 0, 0.1);
  border: 1px solid #00cc00;
  color: #00cc00;
  text-shadow: 0 0 0.5px #00cc00;
}

.output-panel .btn:hover {
  background: rgba(0, 204, 0, 0.2);
  box-shadow: 0 0 4px rgba(0, 204, 0, 0.5);
}

.execution-panel {
  flex: 1 1 33.3%; /* Default to 1/3 of space but allow grow/shrink */
  min-height: 120px; /* Reduced but still usable minimum height */
  border-bottom: none;
}

/* Resize Handle - Enhanced */
.resize-handle {
  height: 8px;
  background-color: #2d2d30;
  cursor: row-resize;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border-top: 1px solid #3e3e42;
  border-bottom: 1px solid #3e3e42;
  transition: all 0.2s ease;
  flex-shrink: 0; /* Don't allow the handle to shrink */
}

.resize-handle:hover {
  background-color: #4CAF50;
  border-color: #4CAF50;
  height: 10px;
}

.resize-handle:active {
  background-color: #45a049;
  border-color: #45a049;
}

.resize-line {
  width: 80px;
  height: 2px;
  background-color: #666;
  border-radius: 1px;
  transition: all 0.2s ease;
  pointer-events: none; /* Allow clicks to pass through to handle */
  position: relative;
}

.resize-line::before,
.resize-line::after {
  content: '';
  position: absolute;
  width: 4px;
  height: 2px;
  background-color: inherit;
  border-radius: 1px;
  top: 0;
}

.resize-line::before {
  left: -8px;
}

.resize-line::after {
  right: -8px;
}

.resize-handle:hover .resize-line {
  background-color: #ffffff;
  width: 100px;
}

.resize-handle:active .resize-line {
  background-color: #ffffff;
  width: 120px;
}

/* Vertical Resize Handle - Enhanced */
.vertical-resize-handle {
  width: 8px;
  background-color: #2d2d30;
  cursor: col-resize;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border-left: 1px solid #3e3e42;
  border-right: 1px solid #3e3e42;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.vertical-resize-handle:hover {
  background-color: #4CAF50;
  border-color: #4CAF50;
  width: 10px;
}

.vertical-resize-handle:active {
  background-color: #45a049;
  border-color: #45a049;
}

.vertical-resize-line {
  height: 80px;
  width: 2px;
  background-color: #666;
  border-radius: 1px;
  transition: all 0.2s ease;
  pointer-events: none;
  position: relative;
}

.vertical-resize-line::before,
.vertical-resize-line::after {
  content: '';
  position: absolute;
  height: 4px;
  width: 2px;
  background-color: inherit;
  border-radius: 1px;
  left: 0;
}

.vertical-resize-line::before {
  top: -8px;
}

.vertical-resize-line::after {
  bottom: -8px;
}

.vertical-resize-handle:hover .vertical-resize-line {
  background-color: #ffffff;
  height: 100px;
}

.vertical-resize-handle:active .vertical-resize-line {
  background-color: #ffffff;
  height: 120px;
}

.panel-header {
  background-color: #2d2d30;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #3e3e42;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.panel-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: #ffffff;
}

/* Editor Styles */
.editor-container {
  flex: 1;
  position: relative;
  min-height: 0; /* Allow flex shrinking */
  overflow: hidden; /* Prevent container overflow */
}

.CodeMirror {
  height: 100% !important;
  font-family: 'Fira Code', monospace !important;
  font-size: 14px;
  background-color: #1e1e1e !important;
  overflow-y: auto !important; /* Vertical scrolling only */
  overflow-x: hidden !important; /* No horizontal scrolling */
  word-wrap: break-word; /* Wrap long lines */
}

.CodeMirror-scroll {
  overflow-x: hidden !important; /* Force no horizontal scroll in CodeMirror */
  overflow-y: auto !important; /* Allow vertical scrolling */
}

/* Ensure CodeMirror uses our custom scrollbar styling */
.CodeMirror-scroll {
  scrollbar-width: thin;
  scrollbar-color: #404040 #1e1e1e;
}

.CodeMirror-gutters {
  background-color: #1e1e1e !important;
  border-right: 1px solid #3e3e42 !important;
}

/* Custom Scrollbar Styling for Retro Theme */
.CodeMirror-scrollbar-filler,
.CodeMirror-gutter-filler {
  background-color: transparent !important;
}

/* Hide CodeMirror's default scrollbars - use webkit custom ones instead */
.CodeMirror-vscrollbar {
  display: none !important;
}

.CodeMirror-hscrollbar {
  display: none !important;
}

/* Custom scrollbar for webkit browsers (Chrome, Safari, Edge) */
.output-container::-webkit-scrollbar,
.CodeMirror::-webkit-scrollbar,
.CodeMirror-scroll::-webkit-scrollbar {
  width: 12px;
  height: 0px; /* Hide horizontal scrollbar */
}

.output-container::-webkit-scrollbar-track,
.CodeMirror::-webkit-scrollbar-track,
.CodeMirror-scroll::-webkit-scrollbar-track {
  background: #1e1e1e;
  border-radius: 6px;
}

.output-container::-webkit-scrollbar-thumb,
.CodeMirror::-webkit-scrollbar-thumb,
.CodeMirror-scroll::-webkit-scrollbar-thumb {
  background: #404040;
  border-radius: 6px;
  border: 2px solid #1e1e1e;
}

.output-container::-webkit-scrollbar-thumb:hover,
.CodeMirror::-webkit-scrollbar-thumb:hover,
.CodeMirror-scroll::-webkit-scrollbar-thumb:hover {
  background: #505050;
}

/* Hide horizontal scrollbar specifically for CodeMirror */
.CodeMirror::-webkit-scrollbar:horizontal,
.CodeMirror-scroll::-webkit-scrollbar:horizontal {
  display: none;
}

/* Force consistent scrollbar styling - override any default scrollbars */
.CodeMirror-scrollbar-filler,
.CodeMirror-gutter-filler,
.CodeMirror-vscrollbar,
.CodeMirror-hscrollbar {
  background: transparent !important;
}

/* CRT monitor green glow scrollbar for output */
.output-container::-webkit-scrollbar-thumb {
  background: linear-gradient(to bottom, #003300, #001100);
  border: 1px solid #00cc00;
  box-shadow: 0 0 3px rgba(0, 204, 0, 0.5);
}

.output-container::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(to bottom, #004400, #002200);
  box-shadow: 0 0 5px rgba(0, 204, 0, 0.8);
}

/* Output Styles - 80s CRT Monitor Aesthetic */
.output-container,
.execution-container {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  min-height: 0;
  max-height: 100%;
  /* Force proper scrolling bounds */
  height: 0; /* This forces flex to calculate height properly */
}

.output-container {
  background: #001100;
  border: 2px solid #333;
  border-radius: 8px;
  position: relative;
  /* CRT Screen curvature effect */
  background: 
    radial-gradient(ellipse at center, 
      rgba(0, 255, 0, 0.15) 0%, 
      rgba(0, 255, 0, 0.05) 40%, 
      rgba(0, 0, 0, 0.4) 100%),
    linear-gradient(180deg, 
      rgba(0, 255, 0, 0.02) 0%, 
      rgba(0, 0, 0, 0.8) 100%),
    #000800;
}

/* CRT Scanlines effect */
.output-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 255, 0, 0.03) 0px,
    rgba(0, 255, 0, 0.03) 1px,
    transparent 1px,
    transparent 3px
  );
  z-index: 1;
}

/* CRT Screen flicker animation */
.output-container::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  background: rgba(0, 255, 0, 0.02);
  animation: flicker 0.15s infinite linear alternate;
  z-index: 1;
}

@keyframes flicker {
  0% { opacity: 1; }
  98% { opacity: 1; }
  99% { opacity: 0.98; }
  100% { opacity: 1; }
}

/* 80s CRT Monitor Scrollbar */
.output-container::-webkit-scrollbar {
  width: 8px;
}

.output-container::-webkit-scrollbar-track {
  background: #002200;
  border-radius: 3px;
  border: 1px solid #003300;
}

.output-container::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #00cc00, #009900);
  border-radius: 3px;
  box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.5);
}

.output-container::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #00dd00, #00aa00);
}

/* Keep execution container with normal styling */
.execution-container::-webkit-scrollbar {
  width: 6px;
}

.execution-container::-webkit-scrollbar-track {
  background: #2d2d30;
  border-radius: 3px;
}

.output-container::-webkit-scrollbar-thumb,
.execution-container::-webkit-scrollbar-thumb {
  background: #3e3e42;
  border-radius: 3px;
}

.output-container::-webkit-scrollbar-thumb:hover,
.execution-container::-webkit-scrollbar-thumb:hover {
  background: #4e4e52;
}

/* 80s CRT Monitor Output Text */
#output {
  margin: 0;
  font-family: 'Courier New', 'Fira Code', monospace;
  font-size: 14px;
  line-height: 1.3;
  white-space: pre-wrap;
  color: #00cc00; /* Darker green phosphor */
  background: transparent;
  word-wrap: break-word;
  text-shadow: 0 0 1px #00cc00;
  position: relative;
  z-index: 2;
  /* Reduced CRT text glow effect */
  filter: brightness(1.05);
}

/* 80s Terminal styling for different output types */
.output-system {
  color: #00cc66;
  font-style: italic;
  text-shadow: 0 0 1px #00cc66;
}

.output-error {
  color: #ff4400;
  font-weight: bold;
  text-shadow: 0 0 1px #ff4400;
  animation: errorBlink 1s infinite alternate;
}

.output-success {
  color: #33cc33;
  text-shadow: 0 0 1px #33cc33;
}

/* Error blinking animation for that authentic 80s feel */
@keyframes errorBlink {
  0% { opacity: 1; }
  100% { opacity: 0.7; }
}

/* Execution Trace Styles */
.execution-content {
  font-family: 'Fira Code', monospace;
  font-size: 11px;
  line-height: 1.4;
  height: 100%;
  padding-right: 0.5rem;
  word-wrap: break-word;
}

.trace-line {
  display: flex;
  align-items: flex-start;
  margin-bottom: 0.4rem;
  padding: 0.2rem 0;
  word-break: break-word;
}

.trace-prompt {
  color: #4ec9b0;
  font-weight: normal;
  margin-right: 0.75rem;
  min-width: 1.5rem;
  flex-shrink: 0;
}

.trace-text {
  color: #cccccc;
  flex: 1;
}

.trace-variable {
  color: #9cdcfe;
  font-weight: 500;
}

.trace-value {
  color: #ce9178;
}

.trace-function {
  color: #dcdcaa;
  font-weight: 500;
}

.trace-output {
  color: #4ec9b0;
  background-color: rgba(78, 201, 176, 0.1);
  padding: 0.25rem 0.5rem;
  border-radius: 3px;
  margin: 0.25rem 0;
}

.trace-step {
  color: #569cd6;
  font-style: italic;
}

/* Button Styles */
.btn {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 4px;
  font-family: 'Fira Code', monospace;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
}

.btn.primary {
  background-color: #0e639c;
  color: #ffffff;
}

.btn.primary:hover {
  background-color: #1177bb;
}

/* Enhanced Run Button States */
.btn.primary.running {
  background-color: #4CAF50 !important;
  border-color: #45a049 !important;
  color: #ffffff !important;
  animation: runPulse 1.5s infinite;
  box-shadow: 0 0 10px rgba(76, 175, 80, 0.4);
}

.btn.primary.running:hover {
  background-color: #45a049 !important;
  transform: none;
}

/* Run button pulse animation */
@keyframes runPulse {
  0% { box-shadow: 0 0 10px rgba(76, 175, 80, 0.4); }
  50% { box-shadow: 0 0 20px rgba(76, 175, 80, 0.6); }
  100% { box-shadow: 0 0 10px rgba(76, 175, 80, 0.4); }
}

.btn.ghost {
  background-color: transparent;
  color: #cccccc;
  border: 1px solid #3e3e42;
}

.btn.ghost:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

/* Challenges Counter Styling */
.challenges-counter {
  background-color: #0e639c;
  color: #ffffff;
  font-weight: bold;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-family: 'Fira Code', monospace;
  font-size: 0.85rem;
  margin-right: 1rem;
  min-width: 2.5rem;
  text-align: center;
  border: 2px solid #1177bb;
  box-shadow: 0 2px 4px rgba(14, 99, 156, 0.3);
  transition: all 0.2s ease;
}

.challenges-counter:hover {
  background-color: #1177bb;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(14, 99, 156, 0.4);
}

/* Progress-based styling */
.challenges-counter.half-completed {
  background-color: #ff8c00;
  border-color: #ffa500;
  box-shadow: 0 2px 4px rgba(255, 140, 0, 0.3);
}

.challenges-counter.half-completed:hover {
  background-color: #ffa500;
  box-shadow: 0 4px 8px rgba(255, 140, 0, 0.4);
}

.challenges-counter.all-completed {
  background-color: #16825d;
  border-color: #1a9969;
  box-shadow: 0 2px 4px rgba(22, 130, 93, 0.3);
}

.challenges-counter.all-completed:hover {
  background-color: #1a9969;
  box-shadow: 0 4px 8px rgba(22, 130, 93, 0.4);
}

/* Username Display Styling */
.username-display {
  background: linear-gradient(45deg, #ffd700, #ffed4e, #ffd700);
  background-size: 200% 200%;
  color: #000 !important;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 20px;
  border: 2px solid #ffb700;
  font-family: 'Fira Code', monospace;
  font-size: 14px;
  box-shadow: 
    0 2px 8px rgba(255, 215, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  animation: pulse-glow 2s ease-in-out infinite;
  user-select: none;
  cursor: default;
}

/* Special styling for teacher demo mode */
.username-display.teacher-mode {
  background: linear-gradient(45deg, #8a2be2, #9932cc, #8a2be2);
  background-size: 200% 200%;
  color: #ffffff !important;
  border: 2px solid #9932cc;
  box-shadow: 
    0 2px 8px rgba(138, 43, 226, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  animation: teacher-pulse 2s ease-in-out infinite;
}

@keyframes teacher-pulse {
  0%, 100% {
    background-position: 0% 50%;
    box-shadow: 
      0 2px 8px rgba(138, 43, 226, 0.4),
      inset 0 1px 0 rgba(255, 255, 255, 0.2),
      0 0 0 0 rgba(138, 43, 226, 0.7);
  }
  50% {
    background-position: 100% 50%;
    box-shadow: 
      0 4px 16px rgba(138, 43, 226, 0.6),
      inset 0 1px 0 rgba(255, 255, 255, 0.2),
      0 0 0 4px rgba(138, 43, 226, 0.3);
  }
}

@keyframes pulse-glow {
  0%, 100% {
    background-position: 0% 50%;
    box-shadow: 
      0 2px 8px rgba(255, 215, 0, 0.4),
      inset 0 1px 0 rgba(255, 255, 255, 0.3),
      0 0 0 0 rgba(255, 215, 0, 0.7);
  }
  50% {
    background-position: 100% 50%;
    box-shadow: 
      0 4px 16px rgba(255, 215, 0, 0.6),
      inset 0 1px 0 rgba(255, 255, 255, 0.3),
      0 0 0 4px rgba(255, 215, 0, 0.3);
  }
}

.username-display:hover {
  animation-duration: 1s;
}

.btn.mini {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
}

.editor-actions {
  display: flex;
  gap: 0.5rem;
}

/* Input Modal */
.input-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.input-modal-content {
  background-color: #2d2d30;
  border-radius: 8px;
  width: 400px;
  max-width: 90vw;
  border: 1px solid #3e3e42;
}

.input-modal-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #3e3e42;
}

.input-modal-header h3 {
  margin: 0;
  color: #ffffff;
  font-size: 1.1rem;
}

.input-modal-body {
  padding: 1.5rem;
}

.input-modal-body p {
  margin: 0 0 1rem 0;
  color: #cccccc;
}

.input-modal-body input {
  width: 100%;
  padding: 0.75rem;
  background-color: #1e1e1e;
  border: 1px solid #3e3e42;
  border-radius: 4px;
  color: #ffffff;
  font-family: 'Fira Code', monospace;
  font-size: 14px;
}

.input-modal-body input:focus {
  outline: none;
  border-color: #0e639c;
}

.input-modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid #3e3e42;
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

/* Completion Certificate Prompt */
.completion-prompt {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.completion-content {
  background: linear-gradient(135deg, #2d2d30 0%, #1e1e1e 100%);
  border-radius: 12px;
  width: 450px;
  max-width: 90vw;
  border: 2px solid #4CAF50;
  box-shadow: 0 10px 30px rgba(76, 175, 80, 0.3);
}

.completion-header {
  padding: 1.5rem;
  border-bottom: 1px solid #3e3e42;
  text-align: center;
  background: linear-gradient(135deg, #4CAF50, #45a049);
  border-radius: 10px 10px 0 0;
}

.completion-header h3 {
  margin: 0;
  color: #ffffff;
  font-size: 1.4rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.completion-body {
  padding: 2rem 1.5rem;
  text-align: center;
}

.completion-body p {
  margin: 0 0 1rem 0;
  color: #cccccc;
  line-height: 1.5;
}

.completion-body p:last-child {
  margin-bottom: 0;
  font-weight: 500;
  color: #ffffff;
}

.completion-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid #3e3e42;
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.btn.success {
  background-color: #4CAF50;
  color: white;
  border: none;
}

.btn.success:hover {
  background-color: #45a049;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(76, 175, 80, 0.3);
}

/* Responsive Design */
@media (max-width: 768px) {
  .ide-main {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr 1fr;
  }
  
  .ide-main.sidebar-collapsed {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr 1fr;
  }
  
  .lessons-sidebar {
    height: auto;
    max-height: 200px;
  }
  
  .right-panel {
    grid-template-rows: 1fr 1fr;
  }
  
  .panel-header {
    padding: 0.5rem 1rem;
  }
  
  .ide-header {
    padding: 0.75rem 1rem;
  }
  
  .header-left h1 {
    font-size: 1.25rem;
  }
  
  .trace-line {
    font-size: 10px;
  }
}
