/* ==============================
   Parsons Puzzle — Enhanced CSS
   ============================== */

/* Container styling */
.parsons-container {
  border: 1px solid #e5e7eb;
  padding: 1.2em;
  margin-bottom: 1.5em;
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

/* Source and target lists */
.parsons-source,
.parsons-target-list {
  list-style: none;
  padding: 0.8em;
  margin: 0.8em 0;
  min-height: 2.5em;
  border: 2px dashed #cbd5e1;
  border-radius: 6px;
  background: #f9fafb;
}

.parsons-drop-hover {
  background: #e0f2fe;
  border-color: #3b82f6;
}

/* Individual lines */
.parsons-line {
  position: relative;
  display: flex;
  align-items: center;
  margin: 0.3em 0;
  padding: 0.5em 0.8em;
  background: #f3f4f6;
  cursor: grab;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  transition: background-color 0.3s ease, border-left 0.3s ease, margin-left 0.3s ease;
}

/* Hover effect */
.parsons-line:hover {
  background: #e0f2fe;
  border-left: 4px solid #3b82f6;
}

/* Drag feedback */
.parsons-line.dragging {
  opacity: 0.6;
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* Optional indentation markers */
.parsons-line[data-indent="1"] { border-left-color: #dbeafe; }
.parsons-line[data-indent="2"] { border-left-color: #bfdbfe; }
.parsons-line[data-indent="3"] { border-left-color: #93c5fd; }
/* Add more if deeper nesting */

/* Number badge */
.line-label {
  flex-shrink: 0;
  margin-right: 0.8em;
  padding: 0.2em 0.6em;
  align-items: center;
  background: #e0e7ff;
  color: #1e3a8a;
  font-weight: bold;
  border-radius: 4px;
  transition: background-color 0.25s ease, color 0.25s ease;
}

/* Code text */
.parsons-line pre {
  margin: 0;
  font-family: monospace;
  flex-grow: 1;
}

.parsons-line pre .lineno,
.parsons-line pre .copybutton,
.parsons-line pre .copybtn,
.parsons-line pre .sphinx-copybutton {
  display: none !important;
}

/* Controls */
.parsons-controls {
  margin-top: 0.8em;
  display: flex;
  gap: 0.6em;
}
.parsons-controls button {
  flex: 1;
  padding: 0.6em 1em;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  color: #fff;
  font-weight: 600;
  transition: background-color 0.25s ease, transform 0.2s ease;
}
.parsons-controls button:hover {
  transform: translateY(-2px);
}

/* Distinct colours */
.parsons-check { background: #3b82f6; }
.parsons-check:hover { background: #2563eb; }
.parsons-reset { background: #6b7280; }
.parsons-reset:hover { background: #4b5563; }
.parsons-solution { background: #f97316; }
.parsons-solution:hover { background: #ea580c; }

/* Feedback */
.parsons-message {
  margin-top: 0.6em;
  font-weight: bold;
  color: #374151;
}

/* Container states */
.parsons-correct {
  border-color: #22c55e;
  box-shadow: 0 0 0 3px rgba(34,197,94,0.3);
}
.parsons-incorrect {
  border-color: #e74c3c;
  box-shadow: 0 0 0 3px rgba(231,76,60,0.3);
}

/* Per-line highlighting */
.line-correct {
  background-color: #d1fae5;
  border-left: 4px solid #22c55e;
}
.line-correct .line-label {
  background-color: #22c55e;
  color: #fff;
}

.line-incorrect {
  background-color: #fee2e2;
  border-left: 4px solid #e74c3c;
}
.line-incorrect .line-label {
  background-color: #e74c3c;
  color: #fff;
}

.line-solution {
  background-color: #fef9c3;
  border-left: 4px solid #fbbf24;
}
.line-solution .line-label {
  background-color: #f59e0b;
  color: #fff;
}
