$primary: #6366f1;

// ─── Shell ────────────────────────────────────────────────────────────────────
.learningpaths-shell {
  display: flex;
  height: 100%;
  overflow: hidden;
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: #f3f4f6;
}

// ─── List Panel ───────────────────────────────────────────────────────────────
.list-panel {
  width: 280px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-right: 1px solid #e5e7eb;
  overflow-y: auto;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid #e5e7eb;

  h3 {
    font-size: 15px;
    font-weight: 700;
    color: #111827;
    margin: 0;
  }
}

.btn-new {
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  background: $primary;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;

  &:hover { background: #4f46e5; }
}

.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid #f3f4f6;
  transition: background 0.15s;
  gap: 8px;

  &:hover { background: #f9fafb; }
  &.selected { background: #eef2ff; }
}

.item-name {
  font-size: 13px;
  font-weight: 500;
  color: #111827;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-count {
  font-size: 11px;
  color: #9ca3af;
  white-space: nowrap;
}

.loading-state,
.empty {
  padding: 24px 16px;
  font-size: 13px;
  color: #9ca3af;
  text-align: center;
}

// ─── Detail Panel ─────────────────────────────────────────────────────────────
.detail-panel {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.detail-title {
  font-size: 16px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 20px;
}

.detail-form {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 24px;
}

.field-label {
  display: flex;
  flex-direction: column;
  font-size: 13px;
  font-weight: 500;
  color: #374151;
  margin-bottom: 16px;
}

.field-input {
  margin-top: 6px;
  padding: 9px 12px;
  font-size: 14px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  color: #111827;
  background: #fff;
  outline: none;
  transition: border-color 0.2s;

  &:focus { border-color: $primary; box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1); }
}

.field-textarea {
  margin-top: 6px;
  padding: 9px 12px;
  font-size: 14px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  color: #111827;
  background: #fff;
  outline: none;
  resize: vertical;
  transition: border-color 0.2s;
  font-family: inherit;

  &:focus { border-color: $primary; box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1); }
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

.btn-save {
  padding: 9px 24px;
  font-size: 13px;
  font-weight: 600;
  background: $primary;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;

  &:hover { background: #4f46e5; }
}

// ─── Items Section ────────────────────────────────────────────────────────────
.items-section {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px;
}

.section-title {
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  margin: 0 0 16px;
}

.empty-items {
  font-size: 13px;
  color: #9ca3af;
  text-align: center;
  padding: 16px 0;
}

.path-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  margin-bottom: 8px;
  background: #fafafa;
  transition: background 0.15s;

  &:hover { background: #f3f4f6; }
}

.item-pos {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #e0e7ff;
  color: $primary;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.item-title {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  color: #111827;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-actions {
  display: flex;
  gap: 4px;
}

.btn-move {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  cursor: pointer;
  color: #374151;
  transition: background 0.2s, border-color 0.2s;

  &:hover:not([disabled]) {
    background: #e0e7ff;
    border-color: $primary;
    color: $primary;
  }

  &[disabled] {
    opacity: 0.35;
    cursor: not-allowed;
  }
}

// ─── Add Item Form ────────────────────────────────────────────────────────────
.add-item-form {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  align-items: center;

  .field-input {
    flex: 1;
    margin-top: 0;
  }
}

.btn-add {
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 600;
  background: $primary;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;

  &:hover { background: #4f46e5; }
}

// ─── Placeholder ──────────────────────────────────────────────────────────────
.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #9ca3af;

  p {
    font-size: 14px;
    margin: 0;
  }
}
